diff options
Diffstat (limited to 'Documentation')
73 files changed, 2510 insertions, 449 deletions
diff --git a/Documentation/ABI/testing/configfs-usb-gadget-ffs b/Documentation/ABI/testing/configfs-usb-gadget-ffs new file mode 100644 index 000000000000..14343e237e83 --- /dev/null +++ b/Documentation/ABI/testing/configfs-usb-gadget-ffs | |||
@@ -0,0 +1,9 @@ | |||
1 | What: /config/usb-gadget/gadget/functions/ffs.name | ||
2 | Date: Nov 2013 | ||
3 | KenelVersion: 3.13 | ||
4 | Description: The purpose of this directory is to create and remove it. | ||
5 | |||
6 | A corresponding USB function instance is created/removed. | ||
7 | There are no attributes here. | ||
8 | |||
9 | All parameters are set through FunctionFS. | ||
diff --git a/Documentation/ABI/testing/configfs-usb-gadget-loopback b/Documentation/ABI/testing/configfs-usb-gadget-loopback new file mode 100644 index 000000000000..852b2365a5b5 --- /dev/null +++ b/Documentation/ABI/testing/configfs-usb-gadget-loopback | |||
@@ -0,0 +1,8 @@ | |||
1 | What: /config/usb-gadget/gadget/functions/Loopback.name | ||
2 | Date: Nov 2013 | ||
3 | KenelVersion: 3.13 | ||
4 | Description: | ||
5 | The attributes: | ||
6 | |||
7 | qlen - depth of loopback queue | ||
8 | bulk_buflen - buffer length | ||
diff --git a/Documentation/ABI/testing/configfs-usb-gadget-sourcesink b/Documentation/ABI/testing/configfs-usb-gadget-sourcesink new file mode 100644 index 000000000000..a30f3093ef6c --- /dev/null +++ b/Documentation/ABI/testing/configfs-usb-gadget-sourcesink | |||
@@ -0,0 +1,12 @@ | |||
1 | What: /config/usb-gadget/gadget/functions/SourceSink.name | ||
2 | Date: Nov 2013 | ||
3 | KenelVersion: 3.13 | ||
4 | Description: | ||
5 | The attributes: | ||
6 | |||
7 | pattern - 0 (all zeros), 1 (mod63), 2 (none) | ||
8 | isoc_interval - 1..16 | ||
9 | isoc_maxpacket - 0 - 1023 (fs), 0 - 1024 (hs/ss) | ||
10 | isoc_mult - 0..2 (hs/ss only) | ||
11 | isoc_maxburst - 0..15 (ss only) | ||
12 | qlen - buffer length | ||
diff --git a/Documentation/ABI/testing/debugfs-driver-genwqe b/Documentation/ABI/testing/debugfs-driver-genwqe new file mode 100644 index 000000000000..1c2f25674e8c --- /dev/null +++ b/Documentation/ABI/testing/debugfs-driver-genwqe | |||
@@ -0,0 +1,91 @@ | |||
1 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/ddcb_info | ||
2 | Date: Oct 2013 | ||
3 | Contact: haver@linux.vnet.ibm.com | ||
4 | Description: DDCB queue dump used for debugging queueing problems. | ||
5 | |||
6 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/curr_regs | ||
7 | Date: Oct 2013 | ||
8 | Contact: haver@linux.vnet.ibm.com | ||
9 | Description: Dump of the current error registers. | ||
10 | Only available for PF. | ||
11 | |||
12 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/curr_dbg_uid0 | ||
13 | Date: Oct 2013 | ||
14 | Contact: haver@linux.vnet.ibm.com | ||
15 | Description: Internal chip state of UID0 (unit id 0). | ||
16 | Only available for PF. | ||
17 | |||
18 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/curr_dbg_uid1 | ||
19 | Date: Oct 2013 | ||
20 | Contact: haver@linux.vnet.ibm.com | ||
21 | Description: Internal chip state of UID1. | ||
22 | Only available for PF. | ||
23 | |||
24 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/curr_dbg_uid2 | ||
25 | Date: Oct 2013 | ||
26 | Contact: haver@linux.vnet.ibm.com | ||
27 | Description: Internal chip state of UID2. | ||
28 | Only available for PF. | ||
29 | |||
30 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/prev_regs | ||
31 | Date: Oct 2013 | ||
32 | Contact: haver@linux.vnet.ibm.com | ||
33 | Description: Dump of the error registers before the last reset of | ||
34 | the card occured. | ||
35 | Only available for PF. | ||
36 | |||
37 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/prev_dbg_uid0 | ||
38 | Date: Oct 2013 | ||
39 | Contact: haver@linux.vnet.ibm.com | ||
40 | Description: Internal chip state of UID0 before card was reset. | ||
41 | Only available for PF. | ||
42 | |||
43 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/prev_dbg_uid1 | ||
44 | Date: Oct 2013 | ||
45 | Contact: haver@linux.vnet.ibm.com | ||
46 | Description: Internal chip state of UID1 before card was reset. | ||
47 | Only available for PF. | ||
48 | |||
49 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/prev_dbg_uid2 | ||
50 | Date: Oct 2013 | ||
51 | Contact: haver@linux.vnet.ibm.com | ||
52 | Description: Internal chip state of UID2 before card was reset. | ||
53 | Only available for PF. | ||
54 | |||
55 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/info | ||
56 | Date: Oct 2013 | ||
57 | Contact: haver@linux.vnet.ibm.com | ||
58 | Description: Comprehensive summary of bitstream version and software | ||
59 | version. Used bitstream and bitstream clocking information. | ||
60 | |||
61 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/err_inject | ||
62 | Date: Oct 2013 | ||
63 | Contact: haver@linux.vnet.ibm.com | ||
64 | Description: Possibility to inject error cases to ensure that the drivers | ||
65 | error handling code works well. | ||
66 | |||
67 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/vf<0..14>_jobtimeout_msec | ||
68 | Date: Oct 2013 | ||
69 | Contact: haver@linux.vnet.ibm.com | ||
70 | Description: Default VF timeout 250ms. Testing might require 1000ms. | ||
71 | Using 0 will use the cards default value (whatever that is). | ||
72 | |||
73 | The timeout depends on the max number of available cards | ||
74 | in the system and the maximum allowed queue size. | ||
75 | |||
76 | The driver ensures that the settings are done just before | ||
77 | the VFs get enabled. Changing the timeouts in flight is not | ||
78 | possible. | ||
79 | Only available for PF. | ||
80 | |||
81 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/jobtimer | ||
82 | Date: Oct 2013 | ||
83 | Contact: haver@linux.vnet.ibm.com | ||
84 | Description: Dump job timeout register values for PF and VFs. | ||
85 | Only available for PF. | ||
86 | |||
87 | What: /sys/kernel/debug/genwqe/genwqe<n>_card/queue_working_time | ||
88 | Date: Dec 2013 | ||
89 | Contact: haver@linux.vnet.ibm.com | ||
90 | Description: Dump queue working time register values for PF and VFs. | ||
91 | Only available for PF. | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index b20e829d350f..6e02c5029152 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio | |||
@@ -197,6 +197,19 @@ Description: | |||
197 | Raw pressure measurement from channel Y. Units after | 197 | Raw pressure measurement from channel Y. Units after |
198 | application of scale and offset are kilopascal. | 198 | application of scale and offset are kilopascal. |
199 | 199 | ||
200 | What: /sys/bus/iio/devices/iio:deviceX/in_humidityrelative_raw | ||
201 | KernelVersion: 3.14 | ||
202 | Contact: linux-iio@vger.kernel.org | ||
203 | Description: | ||
204 | Raw humidity measurement of air. Units after application of | ||
205 | scale and offset are milli percent. | ||
206 | |||
207 | What: /sys/bus/iio/devices/iio:deviceX/in_humidityrelative_input | ||
208 | KernelVersion: 3.14 | ||
209 | Contact: linux-iio@vger.kernel.org | ||
210 | Description: | ||
211 | Scaled humidity measurement in milli percent. | ||
212 | |||
200 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_offset | 213 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_offset |
201 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_x_offset | 214 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_x_offset |
202 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_offset | 215 | What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_offset |
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index 1430f584b266..614d451cee41 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb | |||
@@ -50,13 +50,19 @@ Description: | |||
50 | This may allow the driver to support more hardware than | 50 | This may allow the driver to support more hardware than |
51 | was included in the driver's static device ID support | 51 | was included in the driver's static device ID support |
52 | table at compile time. The format for the device ID is: | 52 | table at compile time. The format for the device ID is: |
53 | idVendor idProduct bInterfaceClass. | 53 | idVendor idProduct bInterfaceClass RefIdVendor RefIdProduct |
54 | The vendor ID and device ID fields are required, the | 54 | The vendor ID and device ID fields are required, the |
55 | interface class is optional. | 55 | rest is optional. The Ref* tuple can be used to tell the |
56 | driver to use the same driver_data for the new device as | ||
57 | it is used for the reference device. | ||
56 | Upon successfully adding an ID, the driver will probe | 58 | Upon successfully adding an ID, the driver will probe |
57 | for the device and attempt to bind to it. For example: | 59 | for the device and attempt to bind to it. For example: |
58 | # echo "8086 10f5" > /sys/bus/usb/drivers/foo/new_id | 60 | # echo "8086 10f5" > /sys/bus/usb/drivers/foo/new_id |
59 | 61 | ||
62 | Here add a new device (0458:7045) using driver_data from | ||
63 | an already supported device (0458:704c): | ||
64 | # echo "0458 7045 0 0458 704c" > /sys/bus/usb/drivers/foo/new_id | ||
65 | |||
60 | Reading from this file will list all dynamically added | 66 | Reading from this file will list all dynamically added |
61 | device IDs in the same format, with one entry per | 67 | device IDs in the same format, with one entry per |
62 | line. For example: | 68 | line. For example: |
diff --git a/Documentation/ABI/testing/sysfs-driver-genwqe b/Documentation/ABI/testing/sysfs-driver-genwqe new file mode 100644 index 000000000000..1870737a1f5e --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-genwqe | |||
@@ -0,0 +1,62 @@ | |||
1 | What: /sys/class/genwqe/genwqe<n>_card/version | ||
2 | Date: Oct 2013 | ||
3 | Contact: haver@linux.vnet.ibm.com | ||
4 | Description: Unique bitstream identification e.g. | ||
5 | '0000000330336283.00000000475a4950'. | ||
6 | |||
7 | What: /sys/class/genwqe/genwqe<n>_card/appid | ||
8 | Date: Oct 2013 | ||
9 | Contact: haver@linux.vnet.ibm.com | ||
10 | Description: Identifies the currently active card application e.g. 'GZIP' | ||
11 | for compression/decompression. | ||
12 | |||
13 | What: /sys/class/genwqe/genwqe<n>_card/type | ||
14 | Date: Oct 2013 | ||
15 | Contact: haver@linux.vnet.ibm.com | ||
16 | Description: Type of the card e.g. 'GenWQE5-A7'. | ||
17 | |||
18 | What: /sys/class/genwqe/genwqe<n>_card/curr_bitstream | ||
19 | Date: Oct 2013 | ||
20 | Contact: haver@linux.vnet.ibm.com | ||
21 | Description: Currently active bitstream. 1 is default, 0 is backup. | ||
22 | |||
23 | What: /sys/class/genwqe/genwqe<n>_card/next_bitstream | ||
24 | Date: Oct 2013 | ||
25 | Contact: haver@linux.vnet.ibm.com | ||
26 | Description: Interface to set the next bitstream to be used. | ||
27 | |||
28 | What: /sys/class/genwqe/genwqe<n>_card/tempsens | ||
29 | Date: Oct 2013 | ||
30 | Contact: haver@linux.vnet.ibm.com | ||
31 | Description: Interface to read the cards temperature sense register. | ||
32 | |||
33 | What: /sys/class/genwqe/genwqe<n>_card/freerunning_timer | ||
34 | Date: Oct 2013 | ||
35 | Contact: haver@linux.vnet.ibm.com | ||
36 | Description: Interface to read the cards free running timer. | ||
37 | Used for performance and utilization measurements. | ||
38 | |||
39 | What: /sys/class/genwqe/genwqe<n>_card/queue_working_time | ||
40 | Date: Oct 2013 | ||
41 | Contact: haver@linux.vnet.ibm.com | ||
42 | Description: Interface to read queue working time. | ||
43 | Used for performance and utilization measurements. | ||
44 | |||
45 | What: /sys/class/genwqe/genwqe<n>_card/state | ||
46 | Date: Oct 2013 | ||
47 | Contact: haver@linux.vnet.ibm.com | ||
48 | Description: State of the card: "unused", "used", "error". | ||
49 | |||
50 | What: /sys/class/genwqe/genwqe<n>_card/base_clock | ||
51 | Date: Oct 2013 | ||
52 | Contact: haver@linux.vnet.ibm.com | ||
53 | Description: Base clock frequency of the card. | ||
54 | |||
55 | What: /sys/class/genwqe/genwqe<n>_card/device/sriov_numvfs | ||
56 | Date: Oct 2013 | ||
57 | Contact: haver@linux.vnet.ibm.com | ||
58 | Description: Enable VFs (1..15): | ||
59 | sudo sh -c 'echo 15 > \ | ||
60 | /sys/bus/pci/devices/0000\:1b\:00.0/sriov_numvfs' | ||
61 | Disable VFs: | ||
62 | Write a 0 into the same sysfs entry. | ||
diff --git a/Documentation/ABI/testing/sysfs-firmware-efi b/Documentation/ABI/testing/sysfs-firmware-efi new file mode 100644 index 000000000000..05874da7ce80 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-firmware-efi | |||
@@ -0,0 +1,20 @@ | |||
1 | What: /sys/firmware/efi/fw_vendor | ||
2 | Date: December 2013 | ||
3 | Contact: Dave Young <dyoung@redhat.com> | ||
4 | Description: It shows the physical address of firmware vendor field in the | ||
5 | EFI system table. | ||
6 | Users: Kexec | ||
7 | |||
8 | What: /sys/firmware/efi/runtime | ||
9 | Date: December 2013 | ||
10 | Contact: Dave Young <dyoung@redhat.com> | ||
11 | Description: It shows the physical address of runtime service table entry in | ||
12 | the EFI system table. | ||
13 | Users: Kexec | ||
14 | |||
15 | What: /sys/firmware/efi/config_table | ||
16 | Date: December 2013 | ||
17 | Contact: Dave Young <dyoung@redhat.com> | ||
18 | Description: It shows the physical address of config table entry in the EFI | ||
19 | system table. | ||
20 | Users: Kexec | ||
diff --git a/Documentation/ABI/testing/sysfs-firmware-efi-runtime-map b/Documentation/ABI/testing/sysfs-firmware-efi-runtime-map new file mode 100644 index 000000000000..c61b9b348e99 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-firmware-efi-runtime-map | |||
@@ -0,0 +1,34 @@ | |||
1 | What: /sys/firmware/efi/runtime-map/ | ||
2 | Date: December 2013 | ||
3 | Contact: Dave Young <dyoung@redhat.com> | ||
4 | Description: Switching efi runtime services to virtual mode requires | ||
5 | that all efi memory ranges which have the runtime attribute | ||
6 | bit set to be mapped to virtual addresses. | ||
7 | |||
8 | The efi runtime services can only be switched to virtual | ||
9 | mode once without rebooting. The kexec kernel must maintain | ||
10 | the same physical to virtual address mappings as the first | ||
11 | kernel. The mappings are exported to sysfs so userspace tools | ||
12 | can reassemble them and pass them into the kexec kernel. | ||
13 | |||
14 | /sys/firmware/efi/runtime-map/ is the directory the kernel | ||
15 | exports that information in. | ||
16 | |||
17 | subdirectories are named with the number of the memory range: | ||
18 | |||
19 | /sys/firmware/efi/runtime-map/0 | ||
20 | /sys/firmware/efi/runtime-map/1 | ||
21 | /sys/firmware/efi/runtime-map/2 | ||
22 | /sys/firmware/efi/runtime-map/3 | ||
23 | ... | ||
24 | |||
25 | Each subdirectory contains five files: | ||
26 | |||
27 | attribute : The attributes of the memory range. | ||
28 | num_pages : The size of the memory range in pages. | ||
29 | phys_addr : The physical address of the memory range. | ||
30 | type : The type of the memory range. | ||
31 | virt_addr : The virtual address of the memory range. | ||
32 | |||
33 | Above values are all hexadecimal numbers with the '0x' prefix. | ||
34 | Users: Kexec | ||
diff --git a/Documentation/ABI/testing/sysfs-kernel-boot_params b/Documentation/ABI/testing/sysfs-kernel-boot_params new file mode 100644 index 000000000000..eca38ce2852d --- /dev/null +++ b/Documentation/ABI/testing/sysfs-kernel-boot_params | |||
@@ -0,0 +1,38 @@ | |||
1 | What: /sys/kernel/boot_params | ||
2 | Date: December 2013 | ||
3 | Contact: Dave Young <dyoung@redhat.com> | ||
4 | Description: The /sys/kernel/boot_params directory contains two | ||
5 | files: "data" and "version" and one subdirectory "setup_data". | ||
6 | It is used to export the kernel boot parameters of an x86 | ||
7 | platform to userspace for kexec and debugging purpose. | ||
8 | |||
9 | If there's no setup_data in boot_params the subdirectory will | ||
10 | not be created. | ||
11 | |||
12 | "data" file is the binary representation of struct boot_params. | ||
13 | |||
14 | "version" file is the string representation of boot | ||
15 | protocol version. | ||
16 | |||
17 | "setup_data" subdirectory contains the setup_data data | ||
18 | structure in boot_params. setup_data is maintained in kernel | ||
19 | as a link list. In "setup_data" subdirectory there's one | ||
20 | subdirectory for each link list node named with the number | ||
21 | of the list nodes. The list node subdirectory contains two | ||
22 | files "type" and "data". "type" file is the string | ||
23 | representation of setup_data type. "data" file is the binary | ||
24 | representation of setup_data payload. | ||
25 | |||
26 | The whole boot_params directory structure is like below: | ||
27 | /sys/kernel/boot_params | ||
28 | |__ data | ||
29 | |__ setup_data | ||
30 | | |__ 0 | ||
31 | | | |__ data | ||
32 | | | |__ type | ||
33 | | |__ 1 | ||
34 | | |__ data | ||
35 | | |__ type | ||
36 | |__ version | ||
37 | |||
38 | Users: Kexec | ||
diff --git a/Documentation/ABI/testing/sysfs-platform-tahvo-usb b/Documentation/ABI/testing/sysfs-platform-tahvo-usb new file mode 100644 index 000000000000..f6e20ce4b538 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-platform-tahvo-usb | |||
@@ -0,0 +1,16 @@ | |||
1 | What: /sys/bus/platform/devices/tahvo-usb/otg_mode | ||
2 | Date: December 2013 | ||
3 | Contact: Aaro Koskinen <aaro.koskinen@iki.fi> | ||
4 | Description: | ||
5 | Set or read the current OTG mode. Valid values are "host" and | ||
6 | "peripheral". | ||
7 | |||
8 | Reading: returns the current mode. | ||
9 | |||
10 | What: /sys/bus/platform/devices/tahvo-usb/vbus | ||
11 | Date: December 2013 | ||
12 | Contact: Aaro Koskinen <aaro.koskinen@iki.fi> | ||
13 | Description: | ||
14 | Read the current VBUS state. | ||
15 | |||
16 | Reading: returns "on" or "off". | ||
diff --git a/Documentation/HOWTO b/Documentation/HOWTO index 27faae3e3846..57cf5efb044d 100644 --- a/Documentation/HOWTO +++ b/Documentation/HOWTO | |||
@@ -112,7 +112,7 @@ required reading: | |||
112 | 112 | ||
113 | Other excellent descriptions of how to create patches properly are: | 113 | Other excellent descriptions of how to create patches properly are: |
114 | "The Perfect Patch" | 114 | "The Perfect Patch" |
115 | http://kerneltrap.org/node/3737 | 115 | http://www.ozlabs.org/~akpm/stuff/tpp.txt |
116 | "Linux kernel patch submission format" | 116 | "Linux kernel patch submission format" |
117 | http://linux.yyz.us/patch-format.html | 117 | http://linux.yyz.us/patch-format.html |
118 | 118 | ||
@@ -579,7 +579,7 @@ all time. It should describe the patch completely, containing: | |||
579 | For more details on what this should all look like, please see the | 579 | For more details on what this should all look like, please see the |
580 | ChangeLog section of the document: | 580 | ChangeLog section of the document: |
581 | "The Perfect Patch" | 581 | "The Perfect Patch" |
582 | http://userweb.kernel.org/~akpm/stuff/tpp.txt | 582 | http://www.ozlabs.org/~akpm/stuff/tpp.txt |
583 | 583 | ||
584 | 584 | ||
585 | 585 | ||
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt index f3778f8952da..910870b15acd 100644 --- a/Documentation/RCU/trace.txt +++ b/Documentation/RCU/trace.txt | |||
@@ -396,14 +396,14 @@ o Each element of the form "3/3 ..>. 0:7 ^0" represents one rcu_node | |||
396 | 396 | ||
397 | The output of "cat rcu/rcu_sched/rcu_pending" looks as follows: | 397 | The output of "cat rcu/rcu_sched/rcu_pending" looks as follows: |
398 | 398 | ||
399 | 0!np=26111 qsp=29 rpq=5386 cbr=1 cng=570 gpc=3674 gps=577 nn=15903 | 399 | 0!np=26111 qsp=29 rpq=5386 cbr=1 cng=570 gpc=3674 gps=577 nn=15903 ndw=0 |
400 | 1!np=28913 qsp=35 rpq=6097 cbr=1 cng=448 gpc=3700 gps=554 nn=18113 | 400 | 1!np=28913 qsp=35 rpq=6097 cbr=1 cng=448 gpc=3700 gps=554 nn=18113 ndw=0 |
401 | 2!np=32740 qsp=37 rpq=6202 cbr=0 cng=476 gpc=4627 gps=546 nn=20889 | 401 | 2!np=32740 qsp=37 rpq=6202 cbr=0 cng=476 gpc=4627 gps=546 nn=20889 ndw=0 |
402 | 3 np=23679 qsp=22 rpq=5044 cbr=1 cng=415 gpc=3403 gps=347 nn=14469 | 402 | 3 np=23679 qsp=22 rpq=5044 cbr=1 cng=415 gpc=3403 gps=347 nn=14469 ndw=0 |
403 | 4!np=30714 qsp=4 rpq=5574 cbr=0 cng=528 gpc=3931 gps=639 nn=20042 | 403 | 4!np=30714 qsp=4 rpq=5574 cbr=0 cng=528 gpc=3931 gps=639 nn=20042 ndw=0 |
404 | 5 np=28910 qsp=2 rpq=5246 cbr=0 cng=428 gpc=4105 gps=709 nn=18422 | 404 | 5 np=28910 qsp=2 rpq=5246 cbr=0 cng=428 gpc=4105 gps=709 nn=18422 ndw=0 |
405 | 6!np=38648 qsp=5 rpq=7076 cbr=0 cng=840 gpc=4072 gps=961 nn=25699 | 405 | 6!np=38648 qsp=5 rpq=7076 cbr=0 cng=840 gpc=4072 gps=961 nn=25699 ndw=0 |
406 | 7 np=37275 qsp=2 rpq=6873 cbr=0 cng=868 gpc=3416 gps=971 nn=25147 | 406 | 7 np=37275 qsp=2 rpq=6873 cbr=0 cng=868 gpc=3416 gps=971 nn=25147 ndw=0 |
407 | 407 | ||
408 | The fields are as follows: | 408 | The fields are as follows: |
409 | 409 | ||
@@ -432,6 +432,10 @@ o "gpc" is the number of times that an old grace period had | |||
432 | o "gps" is the number of times that a new grace period had started, | 432 | o "gps" is the number of times that a new grace period had started, |
433 | but this CPU was not yet aware of it. | 433 | but this CPU was not yet aware of it. |
434 | 434 | ||
435 | o "ndw" is the number of times that a wakeup of an rcuo | ||
436 | callback-offload kthread had to be deferred in order to avoid | ||
437 | deadlock. | ||
438 | |||
435 | o "nn" is the number of times that this CPU needed nothing. | 439 | o "nn" is the number of times that this CPU needed nothing. |
436 | 440 | ||
437 | 441 | ||
@@ -443,7 +447,7 @@ The output of "cat rcu/rcuboost" looks as follows: | |||
443 | balk: nt=0 egt=6541 bt=0 nb=0 ny=126 nos=0 | 447 | balk: nt=0 egt=6541 bt=0 nb=0 ny=126 nos=0 |
444 | 448 | ||
445 | This information is output only for rcu_preempt. Each two-line entry | 449 | This information is output only for rcu_preempt. Each two-line entry |
446 | corresponds to a leaf rcu_node strcuture. The fields are as follows: | 450 | corresponds to a leaf rcu_node structure. The fields are as follows: |
447 | 451 | ||
448 | o "n:m" is the CPU-number range for the corresponding two-line | 452 | o "n:m" is the CPU-number range for the corresponding two-line |
449 | entry. In the sample output above, the first entry covers | 453 | entry. In the sample output above, the first entry covers |
diff --git a/Documentation/acpi/apei/einj.txt b/Documentation/acpi/apei/einj.txt index a58b63da1a36..f51861bcb07b 100644 --- a/Documentation/acpi/apei/einj.txt +++ b/Documentation/acpi/apei/einj.txt | |||
@@ -45,11 +45,22 @@ directory apei/einj. The following files are provided. | |||
45 | injection. Before this, please specify all necessary error | 45 | injection. Before this, please specify all necessary error |
46 | parameters. | 46 | parameters. |
47 | 47 | ||
48 | - flags | ||
49 | Present for kernel version 3.13 and above. Used to specify which | ||
50 | of param{1..4} are valid and should be used by BIOS during injection. | ||
51 | Value is a bitmask as specified in ACPI5.0 spec for the | ||
52 | SET_ERROR_TYPE_WITH_ADDRESS data structure: | ||
53 | Bit 0 - Processor APIC field valid (see param3 below) | ||
54 | Bit 1 - Memory address and mask valid (param1 and param2) | ||
55 | Bit 2 - PCIe (seg,bus,dev,fn) valid (param4 below) | ||
56 | If set to zero, legacy behaviour is used where the type of injection | ||
57 | specifies just one bit set, and param1 is multiplexed. | ||
58 | |||
48 | - param1 | 59 | - param1 |
49 | This file is used to set the first error parameter value. Effect of | 60 | This file is used to set the first error parameter value. Effect of |
50 | parameter depends on error_type specified. For example, if error | 61 | parameter depends on error_type specified. For example, if error |
51 | type is memory related type, the param1 should be a valid physical | 62 | type is memory related type, the param1 should be a valid physical |
52 | memory address. | 63 | memory address. [Unless "flag" is set - see above] |
53 | 64 | ||
54 | - param2 | 65 | - param2 |
55 | This file is used to set the second error parameter value. Effect of | 66 | This file is used to set the second error parameter value. Effect of |
@@ -58,6 +69,12 @@ directory apei/einj. The following files are provided. | |||
58 | address mask. Linux requires page or narrower granularity, say, | 69 | address mask. Linux requires page or narrower granularity, say, |
59 | 0xfffffffffffff000. | 70 | 0xfffffffffffff000. |
60 | 71 | ||
72 | - param3 | ||
73 | Used when the 0x1 bit is set in "flag" to specify the APIC id | ||
74 | |||
75 | - param4 | ||
76 | Used when the 0x4 bit is set in "flag" to specify target PCIe device | ||
77 | |||
61 | - notrigger | 78 | - notrigger |
62 | The EINJ mechanism is a two step process. First inject the error, then | 79 | The EINJ mechanism is a two step process. First inject the error, then |
63 | perform some actions to trigger it. Setting "notrigger" to 1 skips the | 80 | perform some actions to trigger it. Setting "notrigger" to 1 skips the |
diff --git a/Documentation/acpi/enumeration.txt b/Documentation/acpi/enumeration.txt index b994bcb32b92..2a1519b87177 100644 --- a/Documentation/acpi/enumeration.txt +++ b/Documentation/acpi/enumeration.txt | |||
@@ -293,36 +293,13 @@ the device to the driver. For example: | |||
293 | 293 | ||
294 | These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0" | 294 | These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0" |
295 | specifies the path to the controller. In order to use these GPIOs in Linux | 295 | specifies the path to the controller. In order to use these GPIOs in Linux |
296 | we need to translate them to the Linux GPIO numbers. | 296 | we need to translate them to the corresponding Linux GPIO descriptors. |
297 | 297 | ||
298 | In a simple case of just getting the Linux GPIO number from device | 298 | There is a standard GPIO API for that and is documented in |
299 | resources one can use acpi_get_gpio_by_index() helper function. It takes | 299 | Documentation/gpio.txt. |
300 | pointer to the device and index of the GpioIo/GpioInt descriptor in the | ||
301 | device resources list. For example: | ||
302 | 300 | ||
303 | int gpio_irq, gpio_power; | 301 | In the above example we can get the corresponding two GPIO descriptors with |
304 | int ret; | 302 | a code like this: |
305 | |||
306 | gpio_irq = acpi_get_gpio_by_index(dev, 1, NULL); | ||
307 | if (gpio_irq < 0) | ||
308 | /* handle error */ | ||
309 | |||
310 | gpio_power = acpi_get_gpio_by_index(dev, 0, NULL); | ||
311 | if (gpio_power < 0) | ||
312 | /* handle error */ | ||
313 | |||
314 | /* Now we can use the GPIO numbers */ | ||
315 | |||
316 | Other GpioIo parameters must be converted first by the driver to be | ||
317 | suitable to the gpiolib before passing them. | ||
318 | |||
319 | In case of GpioInt resource an additional call to gpio_to_irq() must be | ||
320 | done before calling request_irq(). | ||
321 | |||
322 | Note that the above API is ACPI specific and not recommended for drivers | ||
323 | that need to support non-ACPI systems. The recommended way is to use | ||
324 | the descriptor based GPIO interfaces. The above example looks like this | ||
325 | when converted to the GPIO desc: | ||
326 | 303 | ||
327 | #include <linux/gpio/consumer.h> | 304 | #include <linux/gpio/consumer.h> |
328 | ... | 305 | ... |
@@ -339,4 +316,5 @@ when converted to the GPIO desc: | |||
339 | 316 | ||
340 | /* Now we can use the GPIO descriptors */ | 317 | /* Now we can use the GPIO descriptors */ |
341 | 318 | ||
342 | See also Documentation/gpio.txt. | 319 | There are also devm_* versions of these functions which release the |
320 | descriptors once the device is released. | ||
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt index 8b46c79679c4..0ebd7e2244d0 100644 --- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt +++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt | |||
@@ -85,21 +85,10 @@ between the calls. | |||
85 | Headers | 85 | Headers |
86 | ------- | 86 | ------- |
87 | 87 | ||
88 | See arch/arm/mach-s3c2410/include/mach/regs-gpio.h for the list | 88 | See arch/arm/mach-s3c24xx/include/mach/regs-gpio.h for the list |
89 | of GPIO pins, and the configuration values for them. This | 89 | of GPIO pins, and the configuration values for them. This |
90 | is included by using #include <mach/regs-gpio.h> | 90 | is included by using #include <mach/regs-gpio.h> |
91 | 91 | ||
92 | The GPIO management functions are defined in the hardware | ||
93 | header arch/arm/mach-s3c2410/include/mach/hardware.h which can be | ||
94 | included by #include <mach/hardware.h> | ||
95 | |||
96 | A useful amount of documentation can be found in the hardware | ||
97 | header on how the GPIO functions (and others) work. | ||
98 | |||
99 | Whilst a number of these functions do make some checks on what | ||
100 | is passed to them, for speed of use, they may not always ensure | ||
101 | that the user supplied data to them is correct. | ||
102 | |||
103 | 92 | ||
104 | PIN Numbers | 93 | PIN Numbers |
105 | ----------- | 94 | ----------- |
diff --git a/Documentation/circular-buffers.txt b/Documentation/circular-buffers.txt index 8117e5bf6065..88951b179262 100644 --- a/Documentation/circular-buffers.txt +++ b/Documentation/circular-buffers.txt | |||
@@ -160,6 +160,7 @@ The producer will look something like this: | |||
160 | spin_lock(&producer_lock); | 160 | spin_lock(&producer_lock); |
161 | 161 | ||
162 | unsigned long head = buffer->head; | 162 | unsigned long head = buffer->head; |
163 | /* The spin_unlock() and next spin_lock() provide needed ordering. */ | ||
163 | unsigned long tail = ACCESS_ONCE(buffer->tail); | 164 | unsigned long tail = ACCESS_ONCE(buffer->tail); |
164 | 165 | ||
165 | if (CIRC_SPACE(head, tail, buffer->size) >= 1) { | 166 | if (CIRC_SPACE(head, tail, buffer->size) >= 1) { |
@@ -168,9 +169,8 @@ The producer will look something like this: | |||
168 | 169 | ||
169 | produce_item(item); | 170 | produce_item(item); |
170 | 171 | ||
171 | smp_wmb(); /* commit the item before incrementing the head */ | 172 | smp_store_release(buffer->head, |
172 | 173 | (head + 1) & (buffer->size - 1)); | |
173 | buffer->head = (head + 1) & (buffer->size - 1); | ||
174 | 174 | ||
175 | /* wake_up() will make sure that the head is committed before | 175 | /* wake_up() will make sure that the head is committed before |
176 | * waking anyone up */ | 176 | * waking anyone up */ |
@@ -183,9 +183,14 @@ This will instruct the CPU that the contents of the new item must be written | |||
183 | before the head index makes it available to the consumer and then instructs the | 183 | before the head index makes it available to the consumer and then instructs the |
184 | CPU that the revised head index must be written before the consumer is woken. | 184 | CPU that the revised head index must be written before the consumer is woken. |
185 | 185 | ||
186 | Note that wake_up() doesn't have to be the exact mechanism used, but whatever | 186 | Note that wake_up() does not guarantee any sort of barrier unless something |
187 | is used must guarantee a (write) memory barrier between the update of the head | 187 | is actually awakened. We therefore cannot rely on it for ordering. However, |
188 | index and the change of state of the consumer, if a change of state occurs. | 188 | there is always one element of the array left empty. Therefore, the |
189 | producer must produce two elements before it could possibly corrupt the | ||
190 | element currently being read by the consumer. Therefore, the unlock-lock | ||
191 | pair between consecutive invocations of the consumer provides the necessary | ||
192 | ordering between the read of the index indicating that the consumer has | ||
193 | vacated a given element and the write by the producer to that same element. | ||
189 | 194 | ||
190 | 195 | ||
191 | THE CONSUMER | 196 | THE CONSUMER |
@@ -195,21 +200,20 @@ The consumer will look something like this: | |||
195 | 200 | ||
196 | spin_lock(&consumer_lock); | 201 | spin_lock(&consumer_lock); |
197 | 202 | ||
198 | unsigned long head = ACCESS_ONCE(buffer->head); | 203 | /* Read index before reading contents at that index. */ |
204 | unsigned long head = smp_load_acquire(buffer->head); | ||
199 | unsigned long tail = buffer->tail; | 205 | unsigned long tail = buffer->tail; |
200 | 206 | ||
201 | if (CIRC_CNT(head, tail, buffer->size) >= 1) { | 207 | if (CIRC_CNT(head, tail, buffer->size) >= 1) { |
202 | /* read index before reading contents at that index */ | ||
203 | smp_read_barrier_depends(); | ||
204 | 208 | ||
205 | /* extract one item from the buffer */ | 209 | /* extract one item from the buffer */ |
206 | struct item *item = buffer[tail]; | 210 | struct item *item = buffer[tail]; |
207 | 211 | ||
208 | consume_item(item); | 212 | consume_item(item); |
209 | 213 | ||
210 | smp_mb(); /* finish reading descriptor before incrementing tail */ | 214 | /* Finish reading descriptor before incrementing tail. */ |
211 | 215 | smp_store_release(buffer->tail, | |
212 | buffer->tail = (tail + 1) & (buffer->size - 1); | 216 | (tail + 1) & (buffer->size - 1)); |
213 | } | 217 | } |
214 | 218 | ||
215 | spin_unlock(&consumer_lock); | 219 | spin_unlock(&consumer_lock); |
@@ -218,12 +222,17 @@ This will instruct the CPU to make sure the index is up to date before reading | |||
218 | the new item, and then it shall make sure the CPU has finished reading the item | 222 | the new item, and then it shall make sure the CPU has finished reading the item |
219 | before it writes the new tail pointer, which will erase the item. | 223 | before it writes the new tail pointer, which will erase the item. |
220 | 224 | ||
221 | 225 | Note the use of ACCESS_ONCE() and smp_load_acquire() to read the | |
222 | Note the use of ACCESS_ONCE() in both algorithms to read the opposition index. | 226 | opposition index. This prevents the compiler from discarding and |
223 | This prevents the compiler from discarding and reloading its cached value - | 227 | reloading its cached value - which some compilers will do across |
224 | which some compilers will do across smp_read_barrier_depends(). This isn't | 228 | smp_read_barrier_depends(). This isn't strictly needed if you can |
225 | strictly needed if you can be sure that the opposition index will _only_ be | 229 | be sure that the opposition index will _only_ be used the once. |
226 | used the once. | 230 | The smp_load_acquire() additionally forces the CPU to order against |
231 | subsequent memory references. Similarly, smp_store_release() is used | ||
232 | in both algorithms to write the thread's index. This documents the | ||
233 | fact that we are writing to something that can be read concurrently, | ||
234 | prevents the compiler from tearing the store, and enforces ordering | ||
235 | against previous accesses. | ||
227 | 236 | ||
228 | 237 | ||
229 | =============== | 238 | =============== |
diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt index 1196290082d1..78530e621a1e 100644 --- a/Documentation/devicetree/bindings/arm/atmel-at91.txt +++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt | |||
@@ -20,6 +20,10 @@ TC/TCLIB Timer required properties: | |||
20 | - interrupts: Should contain all interrupts for the TC block | 20 | - interrupts: Should contain all interrupts for the TC block |
21 | Note that you can specify several interrupt cells if the TC | 21 | Note that you can specify several interrupt cells if the TC |
22 | block has one interrupt per channel. | 22 | block has one interrupt per channel. |
23 | - clock-names: tuple listing input clock names. | ||
24 | Required elements: "t0_clk" | ||
25 | Optional elements: "t1_clk", "t2_clk" | ||
26 | - clocks: phandles to input clocks. | ||
23 | 27 | ||
24 | Examples: | 28 | Examples: |
25 | 29 | ||
@@ -28,6 +32,8 @@ One interrupt per TC block: | |||
28 | compatible = "atmel,at91rm9200-tcb"; | 32 | compatible = "atmel,at91rm9200-tcb"; |
29 | reg = <0xfff7c000 0x100>; | 33 | reg = <0xfff7c000 0x100>; |
30 | interrupts = <18 4>; | 34 | interrupts = <18 4>; |
35 | clocks = <&tcb0_clk>; | ||
36 | clock-names = "t0_clk"; | ||
31 | }; | 37 | }; |
32 | 38 | ||
33 | One interrupt per TC channel in a TC block: | 39 | One interrupt per TC channel in a TC block: |
@@ -35,6 +41,8 @@ One interrupt per TC channel in a TC block: | |||
35 | compatible = "atmel,at91rm9200-tcb"; | 41 | compatible = "atmel,at91rm9200-tcb"; |
36 | reg = <0xfffdc000 0x100>; | 42 | reg = <0xfffdc000 0x100>; |
37 | interrupts = <26 4 27 4 28 4>; | 43 | interrupts = <26 4 27 4 28 4>; |
44 | clocks = <&tcb1_clk>; | ||
45 | clock-names = "t0_clk"; | ||
38 | }; | 46 | }; |
39 | 47 | ||
40 | RSTC Reset Controller required properties: | 48 | RSTC Reset Controller required properties: |
diff --git a/Documentation/devicetree/bindings/extcon/extcon-palmas.txt b/Documentation/devicetree/bindings/extcon/extcon-palmas.txt index 7dab6a8f4a0e..45414bbcd945 100644 --- a/Documentation/devicetree/bindings/extcon/extcon-palmas.txt +++ b/Documentation/devicetree/bindings/extcon/extcon-palmas.txt | |||
@@ -2,7 +2,11 @@ EXTCON FOR PALMAS/TWL CHIPS | |||
2 | 2 | ||
3 | PALMAS USB COMPARATOR | 3 | PALMAS USB COMPARATOR |
4 | Required Properties: | 4 | Required Properties: |
5 | - compatible : Should be "ti,palmas-usb" or "ti,twl6035-usb" | 5 | - compatible: should contain one of: |
6 | * "ti,palmas-usb-vid". | ||
7 | * "ti,twl6035-usb-vid". | ||
8 | * "ti,palmas-usb" (DEPRECATED - use "ti,palmas-usb-vid"). | ||
9 | * "ti,twl6035-usb" (DEPRECATED - use "ti,twl6035-usb-vid"). | ||
6 | 10 | ||
7 | Optional Properties: | 11 | Optional Properties: |
8 | - ti,wakeup : To enable the wakeup comparator in probe | 12 | - ti,wakeup : To enable the wakeup comparator in probe |
diff --git a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt index daa30174bcc1..3ddc7ccfe5f3 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt | |||
@@ -38,12 +38,38 @@ Required device specific properties (only for SPI chips): | |||
38 | removed. | 38 | removed. |
39 | - spi-max-frequency = The maximum frequency this chip is able to handle | 39 | - spi-max-frequency = The maximum frequency this chip is able to handle |
40 | 40 | ||
41 | Example I2C: | 41 | Optional properties: |
42 | - #interrupt-cells : Should be two. | ||
43 | - first cell is the pin number | ||
44 | - second cell is used to specify flags. | ||
45 | - interrupt-controller: Marks the device node as a interrupt controller. | ||
46 | NOTE: The interrupt functionality is only supported for i2c versions of the | ||
47 | chips. The spi chips can also do the interrupts, but this is not supported by | ||
48 | the linux driver yet. | ||
49 | |||
50 | Optional device specific properties: | ||
51 | - microchip,irq-mirror: Sets the mirror flag in the IOCON register. Devices | ||
52 | with two interrupt outputs (these are the devices ending with 17 and | ||
53 | those that have 16 IOs) have two IO banks: IO 0-7 form bank 1 and | ||
54 | IO 8-15 are bank 2. These chips have two different interrupt outputs: | ||
55 | One for bank 1 and another for bank 2. If irq-mirror is set, both | ||
56 | interrupts are generated regardless of the bank that an input change | ||
57 | occured on. If it is not set, the interrupt are only generated for the | ||
58 | bank they belong to. | ||
59 | On devices with only one interrupt output this property is useless. | ||
60 | |||
61 | Example I2C (with interrupt): | ||
42 | gpiom1: gpio@20 { | 62 | gpiom1: gpio@20 { |
43 | compatible = "microchip,mcp23017"; | 63 | compatible = "microchip,mcp23017"; |
44 | gpio-controller; | 64 | gpio-controller; |
45 | #gpio-cells = <2>; | 65 | #gpio-cells = <2>; |
46 | reg = <0x20>; | 66 | reg = <0x20>; |
67 | |||
68 | interrupt-parent = <&gpio1>; | ||
69 | interrupts = <17 IRQ_TYPE_LEVEL_LOW>; | ||
70 | interrupt-controller; | ||
71 | #interrupt-cells=<2>; | ||
72 | microchip,irq-mirror; | ||
47 | }; | 73 | }; |
48 | 74 | ||
49 | Example SPI: | 75 | Example SPI: |
diff --git a/Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt b/Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt new file mode 100644 index 000000000000..f8e8f185a3db --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | MOXA ART GPIO Controller | ||
2 | |||
3 | Required properties: | ||
4 | |||
5 | - #gpio-cells : Should be 2, The first cell is the pin number, | ||
6 | the second cell is used to specify polarity: | ||
7 | 0 = active high | ||
8 | 1 = active low | ||
9 | - compatible : Must be "moxa,moxart-gpio" | ||
10 | - reg : Should contain registers location and length | ||
11 | |||
12 | Example: | ||
13 | |||
14 | gpio: gpio@98700000 { | ||
15 | gpio-controller; | ||
16 | #gpio-cells = <2>; | ||
17 | compatible = "moxa,moxart-gpio"; | ||
18 | reg = <0x98700000 0xC>; | ||
19 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt index 8655df9440d5..f61cef74a212 100644 --- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt +++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt | |||
@@ -2,10 +2,11 @@ | |||
2 | 2 | ||
3 | Required Properties: | 3 | Required Properties: |
4 | 4 | ||
5 | - compatible: should be one of the following. | 5 | - compatible: should contain one of the following. |
6 | - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller. | 6 | - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller. |
7 | - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller. | 7 | - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller. |
8 | - "renesas,gpio-r8a7790": for R8A7790 (R-Car H2) compatible GPIO controller. | 8 | - "renesas,gpio-r8a7790": for R8A7790 (R-Car H2) compatible GPIO controller. |
9 | - "renesas,gpio-r8a7791": for R8A7791 (R-Car M2) compatible GPIO controller. | ||
9 | - "renesas,gpio-rcar": for generic R-Car GPIO controller. | 10 | - "renesas,gpio-rcar": for generic R-Car GPIO controller. |
10 | 11 | ||
11 | - reg: Base address and length of each memory resource used by the GPIO | 12 | - reg: Base address and length of each memory resource used by the GPIO |
diff --git a/Documentation/devicetree/bindings/i2c/i2c-at91.txt b/Documentation/devicetree/bindings/i2c/i2c-at91.txt index b689a0d9441c..4fade84bea16 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-at91.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-at91.txt | |||
@@ -9,6 +9,7 @@ Required properties : | |||
9 | - interrupts: interrupt number to the cpu. | 9 | - interrupts: interrupt number to the cpu. |
10 | - #address-cells = <1>; | 10 | - #address-cells = <1>; |
11 | - #size-cells = <0>; | 11 | - #size-cells = <0>; |
12 | - clocks: phandles to input clocks. | ||
12 | 13 | ||
13 | Optional properties: | 14 | Optional properties: |
14 | - Child nodes conforming to i2c bus binding | 15 | - Child nodes conforming to i2c bus binding |
@@ -21,6 +22,7 @@ i2c0: i2c@fff84000 { | |||
21 | interrupts = <12 4 6>; | 22 | interrupts = <12 4 6>; |
22 | #address-cells = <1>; | 23 | #address-cells = <1>; |
23 | #size-cells = <0>; | 24 | #size-cells = <0>; |
25 | clocks = <&twi0_clk>; | ||
24 | 26 | ||
25 | 24c512@50 { | 27 | 24c512@50 { |
26 | compatible = "24c512"; | 28 | compatible = "24c512"; |
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt new file mode 100644 index 000000000000..34a3fb6f8488 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt | |||
@@ -0,0 +1,50 @@ | |||
1 | * NXP PCA954x I2C bus switch | ||
2 | |||
3 | Required Properties: | ||
4 | |||
5 | - compatible: Must contain one of the following. | ||
6 | "nxp,pca9540", "nxp,pca9542", "nxp,pca9543", "nxp,pca9544", | ||
7 | "nxp,pca9545", "nxp,pca9546", "nxp,pca9547", "nxp,pca9548" | ||
8 | |||
9 | - reg: The I2C address of the device. | ||
10 | |||
11 | The following required properties are defined externally: | ||
12 | |||
13 | - Standard I2C mux properties. See i2c-mux.txt in this directory. | ||
14 | - I2C child bus nodes. See i2c-mux.txt in this directory. | ||
15 | |||
16 | Optional Properties: | ||
17 | |||
18 | - reset-gpios: Reference to the GPIO connected to the reset input. | ||
19 | |||
20 | |||
21 | Example: | ||
22 | |||
23 | i2c-switch@74 { | ||
24 | compatible = "nxp,pca9548"; | ||
25 | #address-cells = <1>; | ||
26 | #size-cells = <0>; | ||
27 | reg = <0x74>; | ||
28 | |||
29 | i2c@2 { | ||
30 | #address-cells = <1>; | ||
31 | #size-cells = <0>; | ||
32 | reg = <2>; | ||
33 | |||
34 | eeprom@54 { | ||
35 | compatible = "at,24c08"; | ||
36 | reg = <0x54>; | ||
37 | }; | ||
38 | }; | ||
39 | |||
40 | i2c@4 { | ||
41 | #address-cells = <1>; | ||
42 | #size-cells = <0>; | ||
43 | reg = <4>; | ||
44 | |||
45 | rtc@51 { | ||
46 | compatible = "nxp,pcf8563"; | ||
47 | reg = <0x51>; | ||
48 | }; | ||
49 | }; | ||
50 | }; | ||
diff --git a/Documentation/devicetree/bindings/i2c/i2c-riic.txt b/Documentation/devicetree/bindings/i2c/i2c-riic.txt new file mode 100644 index 000000000000..0bcc4716c319 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-riic.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | Device tree configuration for Renesas RIIC driver | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "renesas,riic-<soctype>". "renesas,riic-rz" as fallback | ||
5 | - reg : address start and address range size of device | ||
6 | - interrupts : 8 interrupts (TEI, RI, TI, SPI, STI, NAKI, ALI, TMOI) | ||
7 | - clock-frequency : frequency of bus clock in Hz | ||
8 | - #address-cells : should be <1> | ||
9 | - #size-cells : should be <0> | ||
10 | |||
11 | Pinctrl properties might be needed, too. See there. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | i2c0: i2c@fcfee000 { | ||
16 | compatible = "renesas,riic-r7s72100", "renesas,riic-rz"; | ||
17 | reg = <0xfcfee000 0x44>; | ||
18 | interrupts = <0 157 IRQ_TYPE_LEVEL_HIGH>, | ||
19 | <0 158 IRQ_TYPE_EDGE_RISING>, | ||
20 | <0 159 IRQ_TYPE_EDGE_RISING>, | ||
21 | <0 160 IRQ_TYPE_LEVEL_HIGH>, | ||
22 | <0 161 IRQ_TYPE_LEVEL_HIGH>, | ||
23 | <0 162 IRQ_TYPE_LEVEL_HIGH>, | ||
24 | <0 163 IRQ_TYPE_LEVEL_HIGH>, | ||
25 | <0 164 IRQ_TYPE_LEVEL_HIGH>; | ||
26 | clock-frequency = <100000>; | ||
27 | #address-cells = <1>; | ||
28 | #size-cells = <0>; | ||
29 | }; | ||
diff --git a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt index 296eb4536129..278de8e64bbf 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt | |||
@@ -10,6 +10,8 @@ Required properties: | |||
10 | inside HDMIPHY block found on several samsung SoCs | 10 | inside HDMIPHY block found on several samsung SoCs |
11 | (d) "samsung, exynos5440-i2c", for s3c2440-like i2c used | 11 | (d) "samsung, exynos5440-i2c", for s3c2440-like i2c used |
12 | on EXYNOS5440 which does not need GPIO configuration. | 12 | on EXYNOS5440 which does not need GPIO configuration. |
13 | (e) "samsung, exynos5-sata-phy-i2c", for s3c2440-like i2c used as | ||
14 | a host to SATA PHY controller on an internal bus. | ||
13 | - reg: physical base address of the controller and length of memory mapped | 15 | - reg: physical base address of the controller and length of memory mapped |
14 | region. | 16 | region. |
15 | - interrupts: interrupt number to the cpu. | 17 | - interrupts: interrupt number to the cpu. |
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index b1cb3415e6f1..c65f71cfaa5c 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt | |||
@@ -16,6 +16,7 @@ adt7461 +/-1C TDM Extended Temp Range I.C | |||
16 | at,24c08 i2c serial eeprom (24cxx) | 16 | at,24c08 i2c serial eeprom (24cxx) |
17 | atmel,24c02 i2c serial eeprom (24cxx) | 17 | atmel,24c02 i2c serial eeprom (24cxx) |
18 | atmel,at97sc3204t i2c trusted platform module (TPM) | 18 | atmel,at97sc3204t i2c trusted platform module (TPM) |
19 | capella,cm32181 CM32181: Ambient Light Sensor | ||
19 | catalyst,24c32 i2c serial eeprom | 20 | catalyst,24c32 i2c serial eeprom |
20 | dallas,ds1307 64 x 8, Serial, I2C Real-Time Clock | 21 | dallas,ds1307 64 x 8, Serial, I2C Real-Time Clock |
21 | dallas,ds1338 I2C RTC with 56-Byte NV RAM | 22 | dallas,ds1338 I2C RTC with 56-Byte NV RAM |
diff --git a/Documentation/devicetree/bindings/iio/humidity/dht11.txt b/Documentation/devicetree/bindings/iio/humidity/dht11.txt new file mode 100644 index 000000000000..ecc24c199fd6 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/humidity/dht11.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | * DHT11 humidity/temperature sensor (and compatibles like DHT22) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "dht11" | ||
5 | - gpios: Should specify the GPIO connected to the sensor's data | ||
6 | line, see "gpios property" in | ||
7 | Documentation/devicetree/bindings/gpio/gpio.txt. | ||
8 | |||
9 | Example: | ||
10 | |||
11 | humidity_sensor { | ||
12 | compatible = "dht11"; | ||
13 | gpios = <&gpio0 6 0>; | ||
14 | } | ||
diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt new file mode 100644 index 000000000000..f91e809e736e --- /dev/null +++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | * AMS TAOS TSL2563 ambient light sensor | ||
2 | |||
3 | Required properties: | ||
4 | |||
5 | - compatible : should be "amstaos,tsl2563" | ||
6 | - reg : the I2C address of the sensor | ||
7 | |||
8 | Optional properties: | ||
9 | |||
10 | - amstaos,cover-comp-gain : integer used as multiplier for gain | ||
11 | compensation (default = 1) | ||
12 | |||
13 | Example: | ||
14 | |||
15 | tsl2563@29 { | ||
16 | compatible = "amstaos,tsl2563"; | ||
17 | reg = <0x29>; | ||
18 | amstaos,cover-comp-gain = <16>; | ||
19 | }; | ||
diff --git a/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt b/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt new file mode 100644 index 000000000000..90d5f34db04e --- /dev/null +++ b/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * Honeywell HMC5843 magnetometer sensor | ||
2 | |||
3 | Required properties: | ||
4 | |||
5 | - compatible : should be "honeywell,hmc5843" | ||
6 | - reg : the I2C address of the magnetometer - typically 0x1e | ||
7 | |||
8 | Optional properties: | ||
9 | |||
10 | - gpios : should be device tree identifier of the magnetometer DRDY pin | ||
11 | |||
12 | Example: | ||
13 | |||
14 | hmc5843@1e { | ||
15 | compatible = "honeywell,hmc5843" | ||
16 | reg = <0x1e>; | ||
17 | }; | ||
diff --git a/Documentation/devicetree/bindings/misc/atmel-ssc.txt b/Documentation/devicetree/bindings/misc/atmel-ssc.txt index a45ae08c8ed1..60960b2755f4 100644 --- a/Documentation/devicetree/bindings/misc/atmel-ssc.txt +++ b/Documentation/devicetree/bindings/misc/atmel-ssc.txt | |||
@@ -6,6 +6,9 @@ Required properties: | |||
6 | - atmel,at91sam9g45-ssc: support dma transfer | 6 | - atmel,at91sam9g45-ssc: support dma transfer |
7 | - reg: Should contain SSC registers location and length | 7 | - reg: Should contain SSC registers location and length |
8 | - interrupts: Should contain SSC interrupt | 8 | - interrupts: Should contain SSC interrupt |
9 | - clock-names: tuple listing input clock names. | ||
10 | Required elements: "pclk" | ||
11 | - clocks: phandles to input clocks. | ||
9 | 12 | ||
10 | 13 | ||
11 | Required properties for devices compatible with "atmel,at91sam9g45-ssc": | 14 | Required properties for devices compatible with "atmel,at91sam9g45-ssc": |
@@ -20,6 +23,8 @@ ssc0: ssc@fffbc000 { | |||
20 | compatible = "atmel,at91rm9200-ssc"; | 23 | compatible = "atmel,at91rm9200-ssc"; |
21 | reg = <0xfffbc000 0x4000>; | 24 | reg = <0xfffbc000 0x4000>; |
22 | interrupts = <14 4 5>; | 25 | interrupts = <14 4 5>; |
26 | clocks = <&ssc0_clk>; | ||
27 | clock-names = "pclk"; | ||
23 | }; | 28 | }; |
24 | 29 | ||
25 | - DMA transfer: | 30 | - DMA transfer: |
diff --git a/Documentation/devicetree/bindings/misc/bmp085.txt b/Documentation/devicetree/bindings/misc/bmp085.txt index 91dfda2e4e11..d7a6deb6b21e 100644 --- a/Documentation/devicetree/bindings/misc/bmp085.txt +++ b/Documentation/devicetree/bindings/misc/bmp085.txt | |||
@@ -8,6 +8,8 @@ Optional properties: | |||
8 | - temp-measurement-period: temperature measurement period (milliseconds) | 8 | - temp-measurement-period: temperature measurement period (milliseconds) |
9 | - default-oversampling: default oversampling value to be used at startup, | 9 | - default-oversampling: default oversampling value to be used at startup, |
10 | value range is 0-3 with rising sensitivity. | 10 | value range is 0-3 with rising sensitivity. |
11 | - interrupt-parent: should be the phandle for the interrupt controller | ||
12 | - interrupts: interrupt mapping for IRQ | ||
11 | 13 | ||
12 | Example: | 14 | Example: |
13 | 15 | ||
@@ -17,4 +19,6 @@ pressure@77 { | |||
17 | chip-id = <10>; | 19 | chip-id = <10>; |
18 | temp-measurement-period = <100>; | 20 | temp-measurement-period = <100>; |
19 | default-oversampling = <2>; | 21 | default-oversampling = <2>; |
22 | interrupt-parent = <&gpio0>; | ||
23 | interrupts = <25 IRQ_TYPE_EDGE_RISING>; | ||
20 | }; | 24 | }; |
diff --git a/Documentation/devicetree/bindings/phy/bcm-phy.txt b/Documentation/devicetree/bindings/phy/bcm-phy.txt new file mode 100644 index 000000000000..3dc8b3d2ffbb --- /dev/null +++ b/Documentation/devicetree/bindings/phy/bcm-phy.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | BROADCOM KONA USB2 PHY | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: brcm,kona-usb2-phy | ||
5 | - reg: offset and length of the PHY registers | ||
6 | - #phy-cells: must be 0 | ||
7 | Refer to phy/phy-bindings.txt for the generic PHY binding properties | ||
8 | |||
9 | Example: | ||
10 | |||
11 | usbphy: usb-phy@3f130000 { | ||
12 | compatible = "brcm,kona-usb2-phy"; | ||
13 | reg = <0x3f130000 0x28>; | ||
14 | #phy-cells = <0>; | ||
15 | }; | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt new file mode 100644 index 000000000000..9e9e9ef9f852 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt | |||
@@ -0,0 +1,461 @@ | |||
1 | Broadcom Capri Pin Controller | ||
2 | |||
3 | This is a pin controller for the Broadcom BCM281xx SoC family, which includes | ||
4 | BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. | ||
5 | |||
6 | === Pin Controller Node === | ||
7 | |||
8 | Required Properties: | ||
9 | |||
10 | - compatible: Must be "brcm,capri-pinctrl". | ||
11 | - reg: Base address of the PAD Controller register block and the size | ||
12 | of the block. | ||
13 | |||
14 | For example, the following is the bare minimum node: | ||
15 | |||
16 | pinctrl@35004800 { | ||
17 | compatible = "brcm,capri-pinctrl"; | ||
18 | reg = <0x35004800 0x430>; | ||
19 | }; | ||
20 | |||
21 | As a pin controller device, in addition to the required properties, this node | ||
22 | should also contain the pin configuration nodes that client devices reference, | ||
23 | if any. | ||
24 | |||
25 | === Pin Configuration Node === | ||
26 | |||
27 | Each pin configuration node is a sub-node of the pin controller node and is a | ||
28 | container of an arbitrary number of subnodes, called pin group nodes in this | ||
29 | document. | ||
30 | |||
31 | Please refer to the pinctrl-bindings.txt in this directory for details of the | ||
32 | common pinctrl bindings used by client devices, including the definition of a | ||
33 | "pin configuration node". | ||
34 | |||
35 | === Pin Group Node === | ||
36 | |||
37 | A pin group node specifies the desired pin mux and/or pin configuration for an | ||
38 | arbitrary number of pins. The name of the pin group node is optional and not | ||
39 | used. | ||
40 | |||
41 | A pin group node only affects the properties specified in the node, and has no | ||
42 | effect on any properties that are omitted. | ||
43 | |||
44 | The pin group node accepts a subset of the generic pin config properties. For | ||
45 | details generic pin config properties, please refer to pinctrl-bindings.txt | ||
46 | and <include/linux/pinctrl/pinconfig-generic.h>. | ||
47 | |||
48 | Each pin controlled by this pin controller belong to one of three types: | ||
49 | Standard, I2C, and HDMI. Each type accepts a different set of pin config | ||
50 | properties. A list of pins and their types is provided below. | ||
51 | |||
52 | Required Properties (applicable to all pins): | ||
53 | |||
54 | - pins: Multiple strings. Specifies the name(s) of one or more pins to | ||
55 | be configured by this node. | ||
56 | |||
57 | Optional Properties (for standard pins): | ||
58 | |||
59 | - function: String. Specifies the pin mux selection. Values | ||
60 | must be one of: "alt1", "alt2", "alt3", "alt4" | ||
61 | - input-schmitt-enable: No arguments. Enable schmitt-trigger mode. | ||
62 | - input-schmitt-disable: No arguments. Disable schmitt-trigger mode. | ||
63 | - bias-pull-up: No arguments. Pull up on pin. | ||
64 | - bias-pull-down: No arguments. Pull down on pin. | ||
65 | - bias-disable: No arguments. Disable pin bias. | ||
66 | - slew-rate: Integer. Meaning depends on configured pin mux: | ||
67 | *_SCL or *_SDA: | ||
68 | 0: Standard(100kbps)& Fast(400kbps) mode | ||
69 | 1: Highspeed (3.4Mbps) mode | ||
70 | IC_DM or IC_DP: | ||
71 | 0: normal slew rate | ||
72 | 1: fast slew rate | ||
73 | Otherwise: | ||
74 | 0: fast slew rate | ||
75 | 1: normal slew rate | ||
76 | - input-enable: No arguements. Enable input (does not affect | ||
77 | output.) | ||
78 | - input-disable: No arguements. Disable input (does not affect | ||
79 | output.) | ||
80 | - drive-strength: Integer. Drive strength in mA. Valid values are | ||
81 | 2, 4, 6, 8, 10, 12, 14, 16 mA. | ||
82 | |||
83 | Optional Properties (for I2C pins): | ||
84 | |||
85 | - function: String. Specifies the pin mux selection. Values | ||
86 | must be one of: "alt1", "alt2", "alt3", "alt4" | ||
87 | - bias-pull-up: Integer. Pull up strength in Ohm. There are 3 | ||
88 | pull-up resisitors (1.2k, 1.8k, 2.7k) available | ||
89 | in parallel for I2C pins, so the valid values | ||
90 | are: 568, 720, 831, 1080, 1200, 1800, 2700 Ohm. | ||
91 | - bias-disable: No arguments. Disable pin bias. | ||
92 | - slew-rate: Integer. Meaning depends on configured pin mux: | ||
93 | *_SCL or *_SDA: | ||
94 | 0: Standard(100kbps)& Fast(400kbps) mode | ||
95 | 1: Highspeed (3.4Mbps) mode | ||
96 | IC_DM or IC_DP: | ||
97 | 0: normal slew rate | ||
98 | 1: fast slew rate | ||
99 | Otherwise: | ||
100 | 0: fast slew rate | ||
101 | 1: normal slew rate | ||
102 | - input-enable: No arguements. Enable input (does not affect | ||
103 | output.) | ||
104 | - input-disable: No arguements. Disable input (does not affect | ||
105 | output.) | ||
106 | |||
107 | Optional Properties (for HDMI pins): | ||
108 | |||
109 | - function: String. Specifies the pin mux selection. Values | ||
110 | must be one of: "alt1", "alt2", "alt3", "alt4" | ||
111 | - slew-rate: Integer. Controls slew rate. | ||
112 | 0: Standard(100kbps)& Fast(400kbps) mode | ||
113 | 1: Highspeed (3.4Mbps) mode | ||
114 | - input-enable: No arguements. Enable input (does not affect | ||
115 | output.) | ||
116 | - input-disable: No arguements. Disable input (does not affect | ||
117 | output.) | ||
118 | |||
119 | Example: | ||
120 | // pin controller node | ||
121 | pinctrl@35004800 { | ||
122 | compatible = "brcm,capri-pinctrl"; | ||
123 | reg = <0x35004800 0x430>; | ||
124 | |||
125 | // pin configuration node | ||
126 | dev_a_default: dev_a_active { | ||
127 | //group node defining 1 standard pin | ||
128 | grp_1 { | ||
129 | pins = "std_pin1"; | ||
130 | function = "alt1"; | ||
131 | input-schmitt-enable; | ||
132 | bias-disable; | ||
133 | slew-rate = <1>; | ||
134 | drive-strength = <4>; | ||
135 | }; | ||
136 | |||
137 | // group node defining 2 I2C pins | ||
138 | grp_2 { | ||
139 | pins = "i2c_pin1", "i2c_pin2"; | ||
140 | function = "alt2"; | ||
141 | bias-pull-up = <720>; | ||
142 | input-enable; | ||
143 | }; | ||
144 | |||
145 | // group node defining 2 HDMI pins | ||
146 | grp_3 { | ||
147 | pins = "hdmi_pin1", "hdmi_pin2"; | ||
148 | function = "alt3"; | ||
149 | slew-rate = <1>; | ||
150 | }; | ||
151 | |||
152 | // other pin group nodes | ||
153 | ... | ||
154 | }; | ||
155 | |||
156 | // other pin configuration nodes | ||
157 | ... | ||
158 | }; | ||
159 | |||
160 | In the example above, "dev_a_active" is a pin configuration node with a number | ||
161 | of sub-nodes. In the pin group node "grp_1", one pin, "std_pin1", is defined in | ||
162 | the "pins" property. Thus, the remaining properties in the "grp_1" node applies | ||
163 | only to this pin, including the following settings: | ||
164 | - setting pinmux to "alt1" | ||
165 | - enabling schmitt-trigger (hystersis) mode | ||
166 | - disabling pin bias | ||
167 | - setting the slew-rate to 1 | ||
168 | - setting the drive strength to 4 mA | ||
169 | Note that neither "input-enable" nor "input-disable" was specified - the pinctrl | ||
170 | subsystem will therefore leave this property unchanged from whatever state it | ||
171 | was in before applying these changes. | ||
172 | |||
173 | The "pins" property in the pin group node "grp_2" specifies two pins - | ||
174 | "i2c_pin1" and "i2c_pin2"; the remaining properties in this pin group node, | ||
175 | therefore, applies to both of these pins. The properties include: | ||
176 | - setting pinmux to "alt2" | ||
177 | - setting pull-up resistance to 720 Ohm (ie. enabling 1.2k and 1.8k resistors | ||
178 | in parallel) | ||
179 | - enabling both pins' input | ||
180 | "slew-rate" is not specified in this pin group node, so the slew-rate for these | ||
181 | pins are left as-is. | ||
182 | |||
183 | Finally, "grp_3" defines two HDMI pins. The following properties are applied to | ||
184 | both pins: | ||
185 | - setting pinmux to "alt3" | ||
186 | - setting slew-rate to 1; for HDMI pins, this corresponds to the 3.4 Mbps | ||
187 | Highspeed mode | ||
188 | The input is neither enabled or disabled, and is left untouched. | ||
189 | |||
190 | === Pin Names and Type === | ||
191 | |||
192 | The following are valid pin names and their pin types: | ||
193 | |||
194 | "adcsync", Standard | ||
195 | "bat_rm", Standard | ||
196 | "bsc1_scl", I2C | ||
197 | "bsc1_sda", I2C | ||
198 | "bsc2_scl", I2C | ||
199 | "bsc2_sda", I2C | ||
200 | "classgpwr", Standard | ||
201 | "clk_cx8", Standard | ||
202 | "clkout_0", Standard | ||
203 | "clkout_1", Standard | ||
204 | "clkout_2", Standard | ||
205 | "clkout_3", Standard | ||
206 | "clkreq_in_0", Standard | ||
207 | "clkreq_in_1", Standard | ||
208 | "cws_sys_req1", Standard | ||
209 | "cws_sys_req2", Standard | ||
210 | "cws_sys_req3", Standard | ||
211 | "digmic1_clk", Standard | ||
212 | "digmic1_dq", Standard | ||
213 | "digmic2_clk", Standard | ||
214 | "digmic2_dq", Standard | ||
215 | "gpen13", Standard | ||
216 | "gpen14", Standard | ||
217 | "gpen15", Standard | ||
218 | "gpio00", Standard | ||
219 | "gpio01", Standard | ||
220 | "gpio02", Standard | ||
221 | "gpio03", Standard | ||
222 | "gpio04", Standard | ||
223 | "gpio05", Standard | ||
224 | "gpio06", Standard | ||
225 | "gpio07", Standard | ||
226 | "gpio08", Standard | ||
227 | "gpio09", Standard | ||
228 | "gpio10", Standard | ||
229 | "gpio11", Standard | ||
230 | "gpio12", Standard | ||
231 | "gpio13", Standard | ||
232 | "gpio14", Standard | ||
233 | "gps_pablank", Standard | ||
234 | "gps_tmark", Standard | ||
235 | "hdmi_scl", HDMI | ||
236 | "hdmi_sda", HDMI | ||
237 | "ic_dm", Standard | ||
238 | "ic_dp", Standard | ||
239 | "kp_col_ip_0", Standard | ||
240 | "kp_col_ip_1", Standard | ||
241 | "kp_col_ip_2", Standard | ||
242 | "kp_col_ip_3", Standard | ||
243 | "kp_row_op_0", Standard | ||
244 | "kp_row_op_1", Standard | ||
245 | "kp_row_op_2", Standard | ||
246 | "kp_row_op_3", Standard | ||
247 | "lcd_b_0", Standard | ||
248 | "lcd_b_1", Standard | ||
249 | "lcd_b_2", Standard | ||
250 | "lcd_b_3", Standard | ||
251 | "lcd_b_4", Standard | ||
252 | "lcd_b_5", Standard | ||
253 | "lcd_b_6", Standard | ||
254 | "lcd_b_7", Standard | ||
255 | "lcd_g_0", Standard | ||
256 | "lcd_g_1", Standard | ||
257 | "lcd_g_2", Standard | ||
258 | "lcd_g_3", Standard | ||
259 | "lcd_g_4", Standard | ||
260 | "lcd_g_5", Standard | ||
261 | "lcd_g_6", Standard | ||
262 | "lcd_g_7", Standard | ||
263 | "lcd_hsync", Standard | ||
264 | "lcd_oe", Standard | ||
265 | "lcd_pclk", Standard | ||
266 | "lcd_r_0", Standard | ||
267 | "lcd_r_1", Standard | ||
268 | "lcd_r_2", Standard | ||
269 | "lcd_r_3", Standard | ||
270 | "lcd_r_4", Standard | ||
271 | "lcd_r_5", Standard | ||
272 | "lcd_r_6", Standard | ||
273 | "lcd_r_7", Standard | ||
274 | "lcd_vsync", Standard | ||
275 | "mdmgpio0", Standard | ||
276 | "mdmgpio1", Standard | ||
277 | "mdmgpio2", Standard | ||
278 | "mdmgpio3", Standard | ||
279 | "mdmgpio4", Standard | ||
280 | "mdmgpio5", Standard | ||
281 | "mdmgpio6", Standard | ||
282 | "mdmgpio7", Standard | ||
283 | "mdmgpio8", Standard | ||
284 | "mphi_data_0", Standard | ||
285 | "mphi_data_1", Standard | ||
286 | "mphi_data_2", Standard | ||
287 | "mphi_data_3", Standard | ||
288 | "mphi_data_4", Standard | ||
289 | "mphi_data_5", Standard | ||
290 | "mphi_data_6", Standard | ||
291 | "mphi_data_7", Standard | ||
292 | "mphi_data_8", Standard | ||
293 | "mphi_data_9", Standard | ||
294 | "mphi_data_10", Standard | ||
295 | "mphi_data_11", Standard | ||
296 | "mphi_data_12", Standard | ||
297 | "mphi_data_13", Standard | ||
298 | "mphi_data_14", Standard | ||
299 | "mphi_data_15", Standard | ||
300 | "mphi_ha0", Standard | ||
301 | "mphi_hat0", Standard | ||
302 | "mphi_hat1", Standard | ||
303 | "mphi_hce0_n", Standard | ||
304 | "mphi_hce1_n", Standard | ||
305 | "mphi_hrd_n", Standard | ||
306 | "mphi_hwr_n", Standard | ||
307 | "mphi_run0", Standard | ||
308 | "mphi_run1", Standard | ||
309 | "mtx_scan_clk", Standard | ||
310 | "mtx_scan_data", Standard | ||
311 | "nand_ad_0", Standard | ||
312 | "nand_ad_1", Standard | ||
313 | "nand_ad_2", Standard | ||
314 | "nand_ad_3", Standard | ||
315 | "nand_ad_4", Standard | ||
316 | "nand_ad_5", Standard | ||
317 | "nand_ad_6", Standard | ||
318 | "nand_ad_7", Standard | ||
319 | "nand_ale", Standard | ||
320 | "nand_cen_0", Standard | ||
321 | "nand_cen_1", Standard | ||
322 | "nand_cle", Standard | ||
323 | "nand_oen", Standard | ||
324 | "nand_rdy_0", Standard | ||
325 | "nand_rdy_1", Standard | ||
326 | "nand_wen", Standard | ||
327 | "nand_wp", Standard | ||
328 | "pc1", Standard | ||
329 | "pc2", Standard | ||
330 | "pmu_int", Standard | ||
331 | "pmu_scl", I2C | ||
332 | "pmu_sda", I2C | ||
333 | "rfst2g_mtsloten3g", Standard | ||
334 | "rgmii_0_rx_ctl", Standard | ||
335 | "rgmii_0_rxc", Standard | ||
336 | "rgmii_0_rxd_0", Standard | ||
337 | "rgmii_0_rxd_1", Standard | ||
338 | "rgmii_0_rxd_2", Standard | ||
339 | "rgmii_0_rxd_3", Standard | ||
340 | "rgmii_0_tx_ctl", Standard | ||
341 | "rgmii_0_txc", Standard | ||
342 | "rgmii_0_txd_0", Standard | ||
343 | "rgmii_0_txd_1", Standard | ||
344 | "rgmii_0_txd_2", Standard | ||
345 | "rgmii_0_txd_3", Standard | ||
346 | "rgmii_1_rx_ctl", Standard | ||
347 | "rgmii_1_rxc", Standard | ||
348 | "rgmii_1_rxd_0", Standard | ||
349 | "rgmii_1_rxd_1", Standard | ||
350 | "rgmii_1_rxd_2", Standard | ||
351 | "rgmii_1_rxd_3", Standard | ||
352 | "rgmii_1_tx_ctl", Standard | ||
353 | "rgmii_1_txc", Standard | ||
354 | "rgmii_1_txd_0", Standard | ||
355 | "rgmii_1_txd_1", Standard | ||
356 | "rgmii_1_txd_2", Standard | ||
357 | "rgmii_1_txd_3", Standard | ||
358 | "rgmii_gpio_0", Standard | ||
359 | "rgmii_gpio_1", Standard | ||
360 | "rgmii_gpio_2", Standard | ||
361 | "rgmii_gpio_3", Standard | ||
362 | "rtxdata2g_txdata3g1", Standard | ||
363 | "rtxen2g_txdata3g2", Standard | ||
364 | "rxdata3g0", Standard | ||
365 | "rxdata3g1", Standard | ||
366 | "rxdata3g2", Standard | ||
367 | "sdio1_clk", Standard | ||
368 | "sdio1_cmd", Standard | ||
369 | "sdio1_data_0", Standard | ||
370 | "sdio1_data_1", Standard | ||
371 | "sdio1_data_2", Standard | ||
372 | "sdio1_data_3", Standard | ||
373 | "sdio4_clk", Standard | ||
374 | "sdio4_cmd", Standard | ||
375 | "sdio4_data_0", Standard | ||
376 | "sdio4_data_1", Standard | ||
377 | "sdio4_data_2", Standard | ||
378 | "sdio4_data_3", Standard | ||
379 | "sim_clk", Standard | ||
380 | "sim_data", Standard | ||
381 | "sim_det", Standard | ||
382 | "sim_resetn", Standard | ||
383 | "sim2_clk", Standard | ||
384 | "sim2_data", Standard | ||
385 | "sim2_det", Standard | ||
386 | "sim2_resetn", Standard | ||
387 | "sri_c", Standard | ||
388 | "sri_d", Standard | ||
389 | "sri_e", Standard | ||
390 | "ssp_extclk", Standard | ||
391 | "ssp0_clk", Standard | ||
392 | "ssp0_fs", Standard | ||
393 | "ssp0_rxd", Standard | ||
394 | "ssp0_txd", Standard | ||
395 | "ssp2_clk", Standard | ||
396 | "ssp2_fs_0", Standard | ||
397 | "ssp2_fs_1", Standard | ||
398 | "ssp2_fs_2", Standard | ||
399 | "ssp2_fs_3", Standard | ||
400 | "ssp2_rxd_0", Standard | ||
401 | "ssp2_rxd_1", Standard | ||
402 | "ssp2_txd_0", Standard | ||
403 | "ssp2_txd_1", Standard | ||
404 | "ssp3_clk", Standard | ||
405 | "ssp3_fs", Standard | ||
406 | "ssp3_rxd", Standard | ||
407 | "ssp3_txd", Standard | ||
408 | "ssp4_clk", Standard | ||
409 | "ssp4_fs", Standard | ||
410 | "ssp4_rxd", Standard | ||
411 | "ssp4_txd", Standard | ||
412 | "ssp5_clk", Standard | ||
413 | "ssp5_fs", Standard | ||
414 | "ssp5_rxd", Standard | ||
415 | "ssp5_txd", Standard | ||
416 | "ssp6_clk", Standard | ||
417 | "ssp6_fs", Standard | ||
418 | "ssp6_rxd", Standard | ||
419 | "ssp6_txd", Standard | ||
420 | "stat_1", Standard | ||
421 | "stat_2", Standard | ||
422 | "sysclken", Standard | ||
423 | "traceclk", Standard | ||
424 | "tracedt00", Standard | ||
425 | "tracedt01", Standard | ||
426 | "tracedt02", Standard | ||
427 | "tracedt03", Standard | ||
428 | "tracedt04", Standard | ||
429 | "tracedt05", Standard | ||
430 | "tracedt06", Standard | ||
431 | "tracedt07", Standard | ||
432 | "tracedt08", Standard | ||
433 | "tracedt09", Standard | ||
434 | "tracedt10", Standard | ||
435 | "tracedt11", Standard | ||
436 | "tracedt12", Standard | ||
437 | "tracedt13", Standard | ||
438 | "tracedt14", Standard | ||
439 | "tracedt15", Standard | ||
440 | "txdata3g0", Standard | ||
441 | "txpwrind", Standard | ||
442 | "uartb1_ucts", Standard | ||
443 | "uartb1_urts", Standard | ||
444 | "uartb1_urxd", Standard | ||
445 | "uartb1_utxd", Standard | ||
446 | "uartb2_urxd", Standard | ||
447 | "uartb2_utxd", Standard | ||
448 | "uartb3_ucts", Standard | ||
449 | "uartb3_urts", Standard | ||
450 | "uartb3_urxd", Standard | ||
451 | "uartb3_utxd", Standard | ||
452 | "uartb4_ucts", Standard | ||
453 | "uartb4_urts", Standard | ||
454 | "uartb4_urxd", Standard | ||
455 | "uartb4_utxd", Standard | ||
456 | "vc_cam1_scl", I2C | ||
457 | "vc_cam1_sda", I2C | ||
458 | "vc_cam2_scl", I2C | ||
459 | "vc_cam2_sda", I2C | ||
460 | "vc_cam3_scl", I2C | ||
461 | "vc_cam3_sda", I2C | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx25-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx25-pinctrl.txt new file mode 100644 index 000000000000..fd653bde18d5 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx25-pinctrl.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | * Freescale IMX25 IOMUX Controller | ||
2 | |||
3 | Please refer to fsl,imx-pinctrl.txt in this directory for common binding part | ||
4 | and usage. | ||
5 | |||
6 | CONFIG bits definition: | ||
7 | PAD_CTL_HYS (1 << 8) | ||
8 | PAD_CTL_PKE (1 << 7) | ||
9 | PAD_CTL_PUE (1 << 6) | ||
10 | PAD_CTL_PUS_100K_DOWN (0 << 4) | ||
11 | PAD_CTL_PUS_47K_UP (1 << 4) | ||
12 | PAD_CTL_PUS_100K_UP (2 << 4) | ||
13 | PAD_CTL_PUS_22K_UP (3 << 4) | ||
14 | PAD_CTL_ODE_CMOS (0 << 3) | ||
15 | PAD_CTL_ODE_OPENDRAIN (1 << 3) | ||
16 | PAD_CTL_DSE_NOMINAL (0 << 1) | ||
17 | PAD_CTL_DSE_HIGH (1 << 1) | ||
18 | PAD_CTL_DSE_MAX (2 << 1) | ||
19 | PAD_CTL_SRE_FAST (1 << 0) | ||
20 | PAD_CTL_SRE_SLOW (0 << 0) | ||
21 | |||
22 | Refer to imx25-pinfunc.h in device tree source folder for all available | ||
23 | imx25 PIN_FUNC_ID. | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt index 353eca0efbf8..d1706ea82572 100644 --- a/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt | |||
@@ -52,12 +52,25 @@ Required properties for pin configuration node: | |||
52 | CONFIG can be 0 or 1, meaning Pullup disable/enable. | 52 | CONFIG can be 0 or 1, meaning Pullup disable/enable. |
53 | 53 | ||
54 | 54 | ||
55 | The iomux controller has gpio child nodes which are embedded in the iomux | ||
56 | control registers. They have to be defined as child nodes of the iomux device | ||
57 | node. If gpio subnodes are defined "#address-cells", "#size-cells" and "ranges" | ||
58 | properties for the iomux device node are required. | ||
55 | 59 | ||
56 | Example: | 60 | Example: |
57 | 61 | ||
58 | iomuxc: iomuxc@10015000 { | 62 | iomuxc: iomuxc@10015000 { |
59 | compatible = "fsl,imx27-iomuxc"; | 63 | compatible = "fsl,imx27-iomuxc"; |
60 | reg = <0x10015000 0x600>; | 64 | reg = <0x10015000 0x600>; |
65 | #address-cells = <1>; | ||
66 | #size-cells = <1>; | ||
67 | ranges; | ||
68 | |||
69 | gpio1: gpio@10015000 { | ||
70 | ... | ||
71 | }; | ||
72 | |||
73 | ... | ||
61 | 74 | ||
62 | uart { | 75 | uart { |
63 | pinctrl_uart1: uart-1 { | 76 | pinctrl_uart1: uart-1 { |
@@ -83,6 +96,15 @@ The above example using macros: | |||
83 | iomuxc: iomuxc@10015000 { | 96 | iomuxc: iomuxc@10015000 { |
84 | compatible = "fsl,imx27-iomuxc"; | 97 | compatible = "fsl,imx27-iomuxc"; |
85 | reg = <0x10015000 0x600>; | 98 | reg = <0x10015000 0x600>; |
99 | #address-cells = <1>; | ||
100 | #size-cells = <1>; | ||
101 | ranges; | ||
102 | |||
103 | gpio1: gpio@10015000 { | ||
104 | ... | ||
105 | }; | ||
106 | |||
107 | ... | ||
86 | 108 | ||
87 | uart { | 109 | uart { |
88 | pinctrl_uart1: uart-1 { | 110 | pinctrl_uart1: uart-1 { |
diff --git a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt new file mode 100644 index 000000000000..6464bf769460 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt | |||
@@ -0,0 +1,144 @@ | |||
1 | NVIDIA Tegra124 pinmux controller | ||
2 | |||
3 | The Tegra124 pinctrl binding is very similar to the Tegra20 and Tegra30 | ||
4 | pinctrl binding, as described in nvidia,tegra20-pinmux.txt and | ||
5 | nvidia,tegra30-pinmux.txt. In fact, this document assumes that binding as | ||
6 | a baseline, and only documents the differences between the two bindings. | ||
7 | |||
8 | Required properties: | ||
9 | - compatible: "nvidia,tegra124-pinmux" | ||
10 | - reg: Should contain a list of base address and size pairs for: | ||
11 | -- first entry - the drive strength and pad control registers. | ||
12 | -- second entry - the pinmux registers | ||
13 | |||
14 | Tegra124 adds the following optional properties for pin configuration subnodes. | ||
15 | The macros for options are defined in the | ||
16 | include/dt-binding/pinctrl/pinctrl-tegra.h. | ||
17 | - nvidia,enable-input: Integer. Enable the pin's input path. | ||
18 | enable :TEGRA_PIN_ENABLE0 and | ||
19 | disable or output only: TEGRA_PIN_DISABLE. | ||
20 | - nvidia,open-drain: Integer. | ||
21 | enable: TEGRA_PIN_ENABLE. | ||
22 | disable: TEGRA_PIN_DISABLE. | ||
23 | - nvidia,lock: Integer. Lock the pin configuration against further changes | ||
24 | until reset. | ||
25 | enable: TEGRA_PIN_ENABLE. | ||
26 | disable: TEGRA_PIN_DISABLE. | ||
27 | - nvidia,io-reset: Integer. Reset the IO path. | ||
28 | enable: TEGRA_PIN_ENABLE. | ||
29 | disable: TEGRA_PIN_DISABLE. | ||
30 | - nvidia,rcv-sel: Integer. Select VIL/VIH receivers. | ||
31 | normal: TEGRA_PIN_DISABLE | ||
32 | high: TEGRA_PIN_ENABLE | ||
33 | |||
34 | Please refer the Tegra TRM for complete details regarding which groups | ||
35 | support which functionality. | ||
36 | |||
37 | Valid values for pin and group names are: | ||
38 | |||
39 | per-pin mux groups: | ||
40 | |||
41 | These all support nvidia,function, nvidia,tristate, nvidia,pull, | ||
42 | nvidia,enable-input. Some support nvidia,lock nvidia,open-drain, | ||
43 | nvidia,io-reset and nvidia,rcv-sel. | ||
44 | |||
45 | ulpi_data0_po1, ulpi_data1_po2, ulpi_data2_po3, ulpi_data3_po4, | ||
46 | ulpi_data4_po5, ulpi_data5_po6, ulpi_data6_po7, ulpi_data7_po0, | ||
47 | ulpi_clk_py0, ulpi_dir_py1, ulpi_nxt_py2, ulpi_stp_py3, dap3_fs_pp0, | ||
48 | dap3_din_pp1, dap3_dout_pp2, dap3_sclk_pp3, pv0, pv1, sdmmc1_clk_pz0, | ||
49 | sdmmc1_cmd_pz1, sdmmc1_dat3_py4, sdmmc1_dat2_py5, sdmmc1_dat1_py6, | ||
50 | sdmmc1_dat0_py7, clk2_out_pw5, clk2_req_pcc5, hdmi_int_pn7, ddc_scl_pv4, | ||
51 | ddc_sda_pv5, uart2_rxd_pc3, uart2_txd_pc2, uart2_rts_n_pj6, | ||
52 | uart2_cts_n_pj5, uart3_txd_pw6, uart3_rxd_pw7, uart3_cts_n_pa1, | ||
53 | uart3_rts_n_pc0, pu0, pu1, pu2, pu3, pu4, pu5, pu6, gen1_i2c_scl_pc4, | ||
54 | gen1_i2c_sda_pc5, dap4_fs_pp4, dap4_din_pp5, dap4_dout_pp6, | ||
55 | dap4_sclk_pp7, clk3_out_pee0, clk3_req_pee1, pc7, pi5, pi7, pk0, pk1, | ||
56 | pj0, pj2, pk3, pk4, pk2, pi3, pi6, pg0, pg1, pg2, pg3, pg4, pg5, pg6, | ||
57 | pg7, ph0, ph1, ph2, ph3, ph4, ph5, ph6, ph7, pj7, pb0, pb1, pk7, pi0, | ||
58 | pi1, pi2, pi4, gen2_i2c_scl_pt5, gen2_i2c_sda_pt6, sdmmc4_clk_pcc4, | ||
59 | sdmmc4_cmd_pt7, sdmmc4_dat0_paa0, sdmmc4_dat1_paa1, sdmmc4_dat2_paa2, | ||
60 | sdmmc4_dat3_paa3, sdmmc4_dat4_paa4, sdmmc4_dat5_paa5, sdmmc4_dat6_paa6, | ||
61 | sdmmc4_dat7_paa7, cam_mclk_pcc0, pcc1, pbb0, cam_i2c_scl_pbb1, | ||
62 | cam_i2c_sda_pbb2, pbb3, pbb4, pbb5, pbb6, pbb7, pcc2, jtag_rtck, | ||
63 | pwr_i2c_scl_pz6, pwr_i2c_sda_pz7, kb_row0_pr0, kb_row1_pr1, kb_row2_pr2, | ||
64 | kb_row3_pr3, kb_row4_pr4, kb_row5_pr5, kb_row6_pr6, kb_row7_pr7, | ||
65 | kb_row8_ps0, kb_row9_ps1, kb_row10_ps2, kb_row11_ps3, kb_row12_ps4, | ||
66 | kb_row13_ps5, kb_row14_ps6, kb_row15_ps7, kb_col0_pq0, kb_col1_pq1, | ||
67 | kb_col2_pq2, kb_col3_pq3, kb_col4_pq4, kb_col5_pq5, kb_col6_pq6, | ||
68 | kb_col7_pq7, clk_32k_out_pa0, core_pwr_req, cpu_pwr_req, pwr_int_n, | ||
69 | clk_32k_in, owr, dap1_fs_pn0, dap1_din_pn1, dap1_dout_pn2, | ||
70 | dap1_sclk_pn3, dap_mclk1_req_pee2, dap_mclk1_pw4, spdif_in_pk6, | ||
71 | spdif_out_pk5, dap2_fs_pa2, dap2_din_pa4, dap2_dout_pa5, dap2_sclk_pa3, | ||
72 | dvfs_pwm_px0, gpio_x1_aud_px1, gpio_x3_aud_px3, dvfs_clk_px2, | ||
73 | gpio_x4_aud_px4, gpio_x5_aud_px5, gpio_x6_aud_px6, gpio_x7_aud_px7, | ||
74 | sdmmc3_clk_pa6, sdmmc3_cmd_pa7, sdmmc3_dat0_pb7, sdmmc3_dat1_pb6, | ||
75 | sdmmc3_dat2_pb5, sdmmc3_dat3_pb4, pex_l0_rst_n_pdd1, | ||
76 | pex_l0_clkreq_n_pdd2, pex_wake_n_pdd3, pex_l1_rst_n_pdd5, | ||
77 | pex_l1_clkreq_n_pdd6, hdmi_cec_pee3, sdmmc1_wp_n_pv3, | ||
78 | sdmmc3_cd_n_pv2, gpio_w2_aud_pw2, gpio_w3_aud_pw3, usb_vbus_en0_pn4, | ||
79 | usb_vbus_en1_pn5, sdmmc3_clk_lb_out_pee4, sdmmc3_clk_lb_in_pee5, | ||
80 | gmi_clk_lb, reset_out_n, kb_row16_pt0, kb_row17_pt1, usb_vbus_en2_pff1, | ||
81 | pff2, dp_hpd_pff0, | ||
82 | |||
83 | drive groups: | ||
84 | |||
85 | These all support nvidia,pull-down-strength, nvidia,pull-up-strength, | ||
86 | nvidia,slew-rate-rising, nvidia,slew-rate-falling. Most but not all | ||
87 | support nvidia,high-speed-mode, nvidia,schmitt, nvidia,low-power-mode | ||
88 | and nvidia,drive-type. | ||
89 | |||
90 | ao1, ao2, at1, at2, at3, at4, at5, cdev1, cdev2, dap1, dap2, dap3, dap4, | ||
91 | dbg, sdio3, spi, uaa, uab, uart2, uart3, sdio1, ddc, gma, gme, gmf, gmg, | ||
92 | gmh, owr, uda, gpv, dev3, cec, usb_vbus_en, ao3, ao0, hv0, sdio4, ao4. | ||
93 | |||
94 | Valid values for nvidia,functions are: | ||
95 | |||
96 | blink, cec, cldvfs, clk12, cpu, dap, dap1, dap2, dev3, displaya, | ||
97 | displaya_alt, displayb, dtv, extperiph1, extperiph2, extperiph3, | ||
98 | gmi, gmi_alt, hda, hsi, i2c1, i2c2, i2c3, i2c4, i2cpwr, i2s0, | ||
99 | i2s1, i2s2, i2s3, i2s4, irda, kbc, owr, pmi, pwm0, pwm1, pwm2, pwm3, | ||
100 | pwron, reset_out_n, rsvd1, rsvd2, rsvd3, rsvd4, sdmmc1, sdmmc2, sdmmc3, | ||
101 | sdmmc4, soc, spdif, spi1, spi2, spi3, spi4, spi5, spi6, trace, uarta, | ||
102 | uartb, uartc, uartd, ulpi, usb, vgp1, vgp2, vgp3, vgp4, vgp5, vgp6, | ||
103 | vi, vi_alt1, vi_alt3, vimclk2, vimclk2_alt, sata, ccla, pe0, pe, pe1, | ||
104 | dp, rtck, sys, clk tmds. | ||
105 | |||
106 | Example: | ||
107 | |||
108 | pinmux: pinmux { | ||
109 | compatible = "nvidia,tegra124-pinmux"; | ||
110 | reg = <0x70000868 0x164 /* Pad control registers */ | ||
111 | 0x70003000 0x434>; /* PinMux registers */ | ||
112 | }; | ||
113 | |||
114 | Example pinmux entries: | ||
115 | |||
116 | pinctrl { | ||
117 | sdmmc4_default: pinmux { | ||
118 | sdmmc4_clk_pcc4 { | ||
119 | nvidia,pins = "sdmmc4_clk_pcc4", | ||
120 | nvidia,function = "sdmmc4"; | ||
121 | nvidia,pull = <TEGRA_PIN_PULL_NONE>; | ||
122 | nvidia,tristate = <TEGRA_PIN_DISABLE>; | ||
123 | }; | ||
124 | |||
125 | sdmmc4_dat0_paa0 { | ||
126 | nvidia,pins = "sdmmc4_dat0_paa0", | ||
127 | "sdmmc4_dat1_paa1", | ||
128 | "sdmmc4_dat2_paa2", | ||
129 | "sdmmc4_dat3_paa3", | ||
130 | "sdmmc4_dat4_paa4", | ||
131 | "sdmmc4_dat5_paa5", | ||
132 | "sdmmc4_dat6_paa6", | ||
133 | "sdmmc4_dat7_paa7"; | ||
134 | nvidia,function = "sdmmc4"; | ||
135 | nvidia,pull = <TEGRA_PIN_PULL_UP>; | ||
136 | nvidia,tristate = <TEGRA_PIN_DISABLE>; | ||
137 | }; | ||
138 | }; | ||
139 | }; | ||
140 | |||
141 | sdhci@78000400 { | ||
142 | pinctrl-names = "default"; | ||
143 | pinctrl-0 = <&sdmmc4_default>; | ||
144 | }; | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt index 1958ca9f9e5c..4414163e76d2 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt | |||
@@ -151,6 +151,8 @@ drive-push-pull - drive actively high and low | |||
151 | drive-open-drain - drive with open drain | 151 | drive-open-drain - drive with open drain |
152 | drive-open-source - drive with open source | 152 | drive-open-source - drive with open source |
153 | drive-strength - sink or source at most X mA | 153 | drive-strength - sink or source at most X mA |
154 | input-enable - enable input on pin (no effect on output) | ||
155 | input-disable - disable input on pin (no effect on output) | ||
154 | input-schmitt-enable - enable schmitt-trigger mode | 156 | input-schmitt-enable - enable schmitt-trigger mode |
155 | input-schmitt-disable - disable schmitt-trigger mode | 157 | input-schmitt-disable - disable schmitt-trigger mode |
156 | input-debounce - debounce mode with debound time X | 158 | input-debounce - debounce mode with debound time X |
@@ -158,6 +160,7 @@ low-power-enable - enable low power mode | |||
158 | low-power-disable - disable low power mode | 160 | low-power-disable - disable low power mode |
159 | output-low - set the pin to output mode with low level | 161 | output-low - set the pin to output mode with low level |
160 | output-high - set the pin to output mode with high level | 162 | output-high - set the pin to output mode with high level |
163 | slew-rate - set the slew rate | ||
161 | 164 | ||
162 | Some of the generic properties take arguments. For those that do, the | 165 | Some of the generic properties take arguments. For those that do, the |
163 | arguments are described below. | 166 | arguments are described below. |
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt index 7069a0b84e3a..bc0dfdfdb148 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt | |||
@@ -98,7 +98,7 @@ below for more information. | |||
98 | In case when one register changes more than one pin's mux the | 98 | In case when one register changes more than one pin's mux the |
99 | pinctrl-single,bits need to be used which takes three parameters: | 99 | pinctrl-single,bits need to be used which takes three parameters: |
100 | 100 | ||
101 | pinctrl-single,bits = <0xdc 0x18, 0xff>; | 101 | pinctrl-single,bits = <0xdc 0x18 0xff>; |
102 | 102 | ||
103 | Where 0xdc is the offset from the pinctrl register base address for the | 103 | Where 0xdc is the offset from the pinctrl register base address for the |
104 | device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to | 104 | device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to |
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.txt new file mode 100644 index 000000000000..4c352be5dd61 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.txt | |||
@@ -0,0 +1,92 @@ | |||
1 | Qualcomm MSM8974 TLMM block | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: "qcom,msm8x74-pinctrl" | ||
5 | - reg: Should be the base address and length of the TLMM block. | ||
6 | - interrupts: Should be the parent IRQ of the TLMM block. | ||
7 | - interrupt-controller: Marks the device node as an interrupt controller. | ||
8 | - #interrupt-cells: Should be two. | ||
9 | - gpio-controller: Marks the device node as a GPIO controller. | ||
10 | - #gpio-cells : Should be two. | ||
11 | The first cell is the gpio pin number and the | ||
12 | second cell is used for optional parameters. | ||
13 | |||
14 | Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for | ||
15 | a general description of GPIO and interrupt bindings. | ||
16 | |||
17 | Please refer to pinctrl-bindings.txt in this directory for details of the | ||
18 | common pinctrl bindings used by client devices, including the meaning of the | ||
19 | phrase "pin configuration node". | ||
20 | |||
21 | Qualcomm's pin configuration nodes act as a container for an abitrary number of | ||
22 | subnodes. Each of these subnodes represents some desired configuration for a | ||
23 | pin, a group, or a list of pins or groups. This configuration can include the | ||
24 | mux function to select on those pin(s)/group(s), and various pin configuration | ||
25 | parameters, such as pull-up, drive strength, etc. | ||
26 | |||
27 | The name of each subnode is not important; all subnodes should be enumerated | ||
28 | and processed purely based on their content. | ||
29 | |||
30 | Each subnode only affects those parameters that are explicitly listed. In | ||
31 | other words, a subnode that lists a mux function but no pin configuration | ||
32 | parameters implies no information about any pin configuration parameters. | ||
33 | Similarly, a pin subnode that describes a pullup parameter implies no | ||
34 | information about e.g. the mux function. | ||
35 | |||
36 | |||
37 | The following generic properties as defined in pinctrl-bindings.txt are valid | ||
38 | to specify in a pin configuration subnode: | ||
39 | pins, function, bias-disable, bias-pull-down, bias-pull,up, drive-strength. | ||
40 | |||
41 | Non-empty subnodes must specify the 'pins' property. | ||
42 | Note that not all properties are valid for all pins. | ||
43 | |||
44 | |||
45 | Valid values for qcom,pins are: | ||
46 | gpio0-gpio145 | ||
47 | Supports mux, bias and drive-strength | ||
48 | |||
49 | sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, sdc2_data | ||
50 | Supports bias and drive-strength | ||
51 | |||
52 | Valid values for qcom,function are: | ||
53 | blsp_i2c2, blsp_i2c6, blsp_i2c11, blsp_spi1, blsp_uart2, blsp_uart8, slimbus | ||
54 | |||
55 | (Note that this is not yet the complete list of functions) | ||
56 | |||
57 | |||
58 | |||
59 | Example: | ||
60 | |||
61 | msmgpio: pinctrl@fd510000 { | ||
62 | compatible = "qcom,msm8974-pinctrl"; | ||
63 | reg = <0xfd510000 0x4000>; | ||
64 | |||
65 | gpio-controller; | ||
66 | #gpio-cells = <2>; | ||
67 | interrupt-controller; | ||
68 | #interrupt-cells = <2>; | ||
69 | interrupts = <0 208 0>; | ||
70 | |||
71 | pinctrl-names = "default"; | ||
72 | pinctrl-0 = <&uart2_default>; | ||
73 | |||
74 | uart2_default: uart2_default { | ||
75 | mux { | ||
76 | qcom,pins = "gpio4", "gpio5"; | ||
77 | qcom,function = "blsp_uart2"; | ||
78 | }; | ||
79 | |||
80 | tx { | ||
81 | qcom,pins = "gpio4"; | ||
82 | drive-strength = <4>; | ||
83 | bias-disable; | ||
84 | }; | ||
85 | |||
86 | rx { | ||
87 | qcom,pins = "gpio5"; | ||
88 | drive-strength = <2>; | ||
89 | bias-pull-up; | ||
90 | }; | ||
91 | }; | ||
92 | }; | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt index d5dac7b843a9..35d2e1f186f0 100644 --- a/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt | |||
@@ -26,6 +26,11 @@ Optional properties: | |||
26 | - #gpio-range-cells: Mandatory when the PFC doesn't handle GPIO, forbidden | 26 | - #gpio-range-cells: Mandatory when the PFC doesn't handle GPIO, forbidden |
27 | otherwise. Should be 3. | 27 | otherwise. Should be 3. |
28 | 28 | ||
29 | - interrupts-extended: Specify the interrupts associated with external | ||
30 | IRQ pins. This property is mandatory when the PFC handles GPIOs and | ||
31 | forbidden otherwise. When specified, it must contain one interrupt per | ||
32 | external IRQ, sorted by external IRQ number. | ||
33 | |||
29 | The PFC node also acts as a container for pin configuration nodes. Please refer | 34 | The PFC node also acts as a container for pin configuration nodes. Please refer |
30 | to pinctrl-bindings.txt in this directory for the definition of the term "pin | 35 | to pinctrl-bindings.txt in this directory for the definition of the term "pin |
31 | configuration node" and for the common pinctrl bindings used by client devices. | 36 | configuration node" and for the common pinctrl bindings used by client devices. |
@@ -103,6 +108,15 @@ Example 1: SH73A0 (SH-Mobile AG5) pin controller node | |||
103 | <0xe605801c 0x1c>; | 108 | <0xe605801c 0x1c>; |
104 | gpio-controller; | 109 | gpio-controller; |
105 | #gpio-cells = <2>; | 110 | #gpio-cells = <2>; |
111 | interrupts-extended = | ||
112 | <&irqpin0 0 0>, <&irqpin0 1 0>, <&irqpin0 2 0>, <&irqpin0 3 0>, | ||
113 | <&irqpin0 4 0>, <&irqpin0 5 0>, <&irqpin0 6 0>, <&irqpin0 7 0>, | ||
114 | <&irqpin1 0 0>, <&irqpin1 1 0>, <&irqpin1 2 0>, <&irqpin1 3 0>, | ||
115 | <&irqpin1 4 0>, <&irqpin1 5 0>, <&irqpin1 6 0>, <&irqpin1 7 0>, | ||
116 | <&irqpin2 0 0>, <&irqpin2 1 0>, <&irqpin2 2 0>, <&irqpin2 3 0>, | ||
117 | <&irqpin2 4 0>, <&irqpin2 5 0>, <&irqpin2 6 0>, <&irqpin2 7 0>, | ||
118 | <&irqpin3 0 0>, <&irqpin3 1 0>, <&irqpin3 2 0>, <&irqpin3 3 0>, | ||
119 | <&irqpin3 4 0>, <&irqpin3 5 0>, <&irqpin3 6 0>, <&irqpin3 7 0>; | ||
106 | }; | 120 | }; |
107 | 121 | ||
108 | Example 2: A GPIO LED node that references a GPIO | 122 | Example 2: A GPIO LED node that references a GPIO |
diff --git a/Documentation/devicetree/bindings/serial/atmel-usart.txt b/Documentation/devicetree/bindings/serial/atmel-usart.txt index 2191dcb9f1da..9c5d19ac935c 100644 --- a/Documentation/devicetree/bindings/serial/atmel-usart.txt +++ b/Documentation/devicetree/bindings/serial/atmel-usart.txt | |||
@@ -6,6 +6,9 @@ Required properties: | |||
6 | additional mode or an USART new feature. | 6 | additional mode or an USART new feature. |
7 | - reg: Should contain registers location and length | 7 | - reg: Should contain registers location and length |
8 | - interrupts: Should contain interrupt | 8 | - interrupts: Should contain interrupt |
9 | - clock-names: tuple listing input clock names. | ||
10 | Required elements: "usart" | ||
11 | - clocks: phandles to input clocks. | ||
9 | 12 | ||
10 | Optional properties: | 13 | Optional properties: |
11 | - atmel,use-dma-rx: use of PDC or DMA for receiving data | 14 | - atmel,use-dma-rx: use of PDC or DMA for receiving data |
@@ -26,6 +29,8 @@ Example: | |||
26 | compatible = "atmel,at91sam9260-usart"; | 29 | compatible = "atmel,at91sam9260-usart"; |
27 | reg = <0xfff8c000 0x4000>; | 30 | reg = <0xfff8c000 0x4000>; |
28 | interrupts = <7>; | 31 | interrupts = <7>; |
32 | clocks = <&usart0_clk>; | ||
33 | clock-names = "usart"; | ||
29 | atmel,use-dma-rx; | 34 | atmel,use-dma-rx; |
30 | atmel,use-dma-tx; | 35 | atmel,use-dma-tx; |
31 | }; | 36 | }; |
@@ -35,6 +40,8 @@ Example: | |||
35 | compatible = "atmel,at91sam9260-usart"; | 40 | compatible = "atmel,at91sam9260-usart"; |
36 | reg = <0xf001c000 0x100>; | 41 | reg = <0xf001c000 0x100>; |
37 | interrupts = <12 4 5>; | 42 | interrupts = <12 4 5>; |
43 | clocks = <&usart0_clk>; | ||
44 | clock-names = "usart"; | ||
38 | atmel,use-dma-rx; | 45 | atmel,use-dma-rx; |
39 | atmel,use-dma-tx; | 46 | atmel,use-dma-tx; |
40 | dmas = <&dma0 2 0x3>, | 47 | dmas = <&dma0 2 0x3>, |
diff --git a/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt b/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt new file mode 100644 index 000000000000..12f3cf834deb --- /dev/null +++ b/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | * Cirrus Logic CLPS711X Universal Asynchronous Receiver/Transmitter (UART) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "cirrus,clps711x-uart". | ||
5 | - reg: Address and length of the register set for the device. | ||
6 | - interrupts: Should contain UART TX and RX interrupt. | ||
7 | - clocks: Should contain UART core clock number. | ||
8 | - syscon: Phandle to SYSCON node, which contain UART control bits. | ||
9 | |||
10 | Optional properties: | ||
11 | - uart-use-ms: Indicate the UART has modem signal (DCD, DSR, CTS). | ||
12 | |||
13 | Note: Each UART port should have an alias correctly numbered | ||
14 | in "aliases" node. | ||
15 | |||
16 | Example: | ||
17 | aliases { | ||
18 | serial0 = &uart1; | ||
19 | }; | ||
20 | |||
21 | uart1: uart@80000480 { | ||
22 | compatible = "cirrus,clps711x-uart"; | ||
23 | reg = <0x80000480 0x80>; | ||
24 | interrupts = <12 13>; | ||
25 | clocks = <&clks 11>; | ||
26 | syscon = <&syscon1>; | ||
27 | uart-use-ms; | ||
28 | }; | ||
diff --git a/Documentation/devicetree/bindings/staging/dwc2.txt b/Documentation/devicetree/bindings/staging/dwc2.txt deleted file mode 100644 index 1a1b7cfa4845..000000000000 --- a/Documentation/devicetree/bindings/staging/dwc2.txt +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | Platform DesignWare HS OTG USB 2.0 controller | ||
2 | ----------------------------------------------------- | ||
3 | |||
4 | Required properties: | ||
5 | - compatible : "snps,dwc2" | ||
6 | - reg : Should contain 1 register range (address and length) | ||
7 | - interrupts : Should contain 1 interrupt | ||
8 | |||
9 | Example: | ||
10 | |||
11 | usb@101c0000 { | ||
12 | compatible = "ralink,rt3050-usb, snps,dwc2"; | ||
13 | reg = <0x101c0000 40000>; | ||
14 | interrupts = <18>; | ||
15 | }; | ||
diff --git a/Documentation/devicetree/bindings/staging/xillybus.txt b/Documentation/devicetree/bindings/staging/xillybus.txt new file mode 100644 index 000000000000..9e316dc2e40f --- /dev/null +++ b/Documentation/devicetree/bindings/staging/xillybus.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | * Xillybus driver for generic FPGA interface | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "xillybus,xillybus-1.00.a" | ||
5 | - reg: Address and length of the register set for the device | ||
6 | - interrupts: Contains one interrupt node, typically consisting of three cells. | ||
7 | - interrupt-parent: the phandle for the interrupt controller that | ||
8 | services interrupts for this device. | ||
9 | |||
10 | Optional properties: | ||
11 | - dma-coherent: Present if DMA operations are coherent | ||
12 | |||
13 | Example: | ||
14 | |||
15 | xillybus@ff200400 { | ||
16 | compatible = "xillybus,xillybus-1.00.a"; | ||
17 | reg = < 0xff200400 0x00000080 >; | ||
18 | interrupts = < 0 40 1 >; | ||
19 | interrupt-parent = <&intc>; | ||
20 | } ; | ||
diff --git a/Documentation/devicetree/bindings/timer/allwinner,sun5i-a13-hstimer.txt b/Documentation/devicetree/bindings/timer/allwinner,sun5i-a13-hstimer.txt new file mode 100644 index 000000000000..7c26154b8bbb --- /dev/null +++ b/Documentation/devicetree/bindings/timer/allwinner,sun5i-a13-hstimer.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | Allwinner SoCs High Speed Timer Controller | ||
2 | |||
3 | Required properties: | ||
4 | |||
5 | - compatible : should be "allwinner,sun5i-a13-hstimer" or | ||
6 | "allwinner,sun7i-a20-hstimer" | ||
7 | - reg : Specifies base physical address and size of the registers. | ||
8 | - interrupts : The interrupts of these timers (2 for the sun5i IP, 4 for the sun7i | ||
9 | one) | ||
10 | - clocks: phandle to the source clock (usually the AHB clock) | ||
11 | |||
12 | Example: | ||
13 | |||
14 | timer@01c60000 { | ||
15 | compatible = "allwinner,sun7i-a20-hstimer"; | ||
16 | reg = <0x01c60000 0x1000>; | ||
17 | interrupts = <0 51 1>, | ||
18 | <0 52 1>, | ||
19 | <0 53 1>, | ||
20 | <0 54 1>; | ||
21 | clocks = <&ahb1_gates 19>; | ||
22 | }; | ||
diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt index b4b5b7906c88..b4b5b7906c88 100644 --- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt | |||
diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt new file mode 100644 index 000000000000..b8b6871f116f --- /dev/null +++ b/Documentation/devicetree/bindings/usb/dwc2.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | Platform DesignWare HS OTG USB 2.0 controller | ||
2 | ----------------------------------------------------- | ||
3 | |||
4 | Required properties: | ||
5 | - compatible : One of: | ||
6 | - brcm,bcm2835-usb: The DWC2 USB controller instance in the BCM2835 SoC. | ||
7 | - snps,dwc2: A generic DWC2 USB controller with default parameters. | ||
8 | - reg : Should contain 1 register range (address and length) | ||
9 | - interrupts : Should contain 1 interrupt | ||
10 | - clocks: clock provider specifier | ||
11 | - clock-names: shall be "otg" | ||
12 | Refer to clk/clock-bindings.txt for generic clock consumer properties | ||
13 | |||
14 | Optional properties: | ||
15 | - phys: phy provider specifier | ||
16 | - phy-names: shall be "device" | ||
17 | Refer to phy/phy-bindings.txt for generic phy consumer properties | ||
18 | |||
19 | Example: | ||
20 | |||
21 | usb@101c0000 { | ||
22 | compatible = "ralink,rt3050-usb, snps,dwc2"; | ||
23 | reg = <0x101c0000 40000>; | ||
24 | interrupts = <18>; | ||
25 | clocks = <&usb_otg_ahb_clk>; | ||
26 | clock-names = "otg"; | ||
27 | phys = <&usbphy>; | ||
28 | phy-names = "usb2-phy"; | ||
29 | }; | ||
diff --git a/Documentation/devicetree/bindings/usb/gr-udc.txt b/Documentation/devicetree/bindings/usb/gr-udc.txt new file mode 100644 index 000000000000..0c5118f7a916 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/gr-udc.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | USB Peripheral Controller driver for Aeroflex Gaisler GRUSBDC. | ||
2 | |||
3 | The GRUSBDC USB Device Controller core is available in the GRLIB VHDL | ||
4 | IP core library. | ||
5 | |||
6 | Note: In the ordinary environment for the core, a Leon SPARC system, | ||
7 | these properties are built from information in the AMBA plug&play. | ||
8 | |||
9 | Required properties: | ||
10 | |||
11 | - name : Should be "GAISLER_USBDC" or "01_021" | ||
12 | |||
13 | - reg : Address and length of the register set for the device | ||
14 | |||
15 | - interrupts : Interrupt numbers for this device | ||
16 | |||
17 | Optional properties: | ||
18 | |||
19 | - epobufsizes : An array of buffer sizes for OUT endpoints. If the property is | ||
20 | not present, or for endpoints outside of the array, 1024 is assumed by | ||
21 | the driver. | ||
22 | |||
23 | - epibufsizes : An array of buffer sizes for IN endpoints. If the property is | ||
24 | not present, or for endpoints outside of the array, 1024 is assumed by | ||
25 | the driver. | ||
26 | |||
27 | For further information look in the documentation for the GLIB IP core library: | ||
28 | http://www.gaisler.com/products/grlib/grip.pdf | ||
diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt index 090e5e22bd2b..c495135115cb 100644 --- a/Documentation/devicetree/bindings/usb/omap-usb.txt +++ b/Documentation/devicetree/bindings/usb/omap-usb.txt | |||
@@ -87,6 +87,8 @@ Required properties: | |||
87 | e.g. USB3 PHY and SATA PHY on OMAP5. | 87 | e.g. USB3 PHY and SATA PHY on OMAP5. |
88 | "ti,control-phy-dra7usb2" - if it has power down register like USB2 PHY on | 88 | "ti,control-phy-dra7usb2" - if it has power down register like USB2 PHY on |
89 | DRA7 platform. | 89 | DRA7 platform. |
90 | "ti,control-phy-am437usb2" - if it has power down register like USB2 PHY on | ||
91 | AM437 platform. | ||
90 | - reg : Address and length of the register set for the device. It contains | 92 | - reg : Address and length of the register set for the device. It contains |
91 | the address of "otghs_control" for control-phy-otghs or "power" register | 93 | the address of "otghs_control" for control-phy-otghs or "power" register |
92 | for other types. | 94 | for other types. |
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index edbb8d88c85e..f29cd78b6698 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
@@ -9,6 +9,7 @@ aeroflexgaisler Aeroflex Gaisler AB | |||
9 | ak Asahi Kasei Corp. | 9 | ak Asahi Kasei Corp. |
10 | altr Altera Corp. | 10 | altr Altera Corp. |
11 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) | 11 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) |
12 | amstaos AMS-Taos Inc. | ||
12 | apm Applied Micro Circuits Corporation (APM) | 13 | apm Applied Micro Circuits Corporation (APM) |
13 | arm ARM Ltd. | 14 | arm ARM Ltd. |
14 | atmel Atmel Corporation | 15 | atmel Atmel Corporation |
diff --git a/Documentation/driver-model/design-patterns.txt b/Documentation/driver-model/design-patterns.txt new file mode 100644 index 000000000000..ba7b2df64904 --- /dev/null +++ b/Documentation/driver-model/design-patterns.txt | |||
@@ -0,0 +1,116 @@ | |||
1 | |||
2 | Device Driver Design Patterns | ||
3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4 | |||
5 | This document describes a few common design patterns found in device drivers. | ||
6 | It is likely that subsystem maintainers will ask driver developers to | ||
7 | conform to these design patterns. | ||
8 | |||
9 | 1. State Container | ||
10 | 2. container_of() | ||
11 | |||
12 | |||
13 | 1. State Container | ||
14 | ~~~~~~~~~~~~~~~~~~ | ||
15 | |||
16 | While the kernel contains a few device drivers that assume that they will | ||
17 | only be probed() once on a certain system (singletons), it is custom to assume | ||
18 | that the device the driver binds to will appear in several instances. This | ||
19 | means that the probe() function and all callbacks need to be reentrant. | ||
20 | |||
21 | The most common way to achieve this is to use the state container design | ||
22 | pattern. It usually has this form: | ||
23 | |||
24 | struct foo { | ||
25 | spinlock_t lock; /* Example member */ | ||
26 | (...) | ||
27 | }; | ||
28 | |||
29 | static int foo_probe(...) | ||
30 | { | ||
31 | struct foo *foo; | ||
32 | |||
33 | foo = devm_kzalloc(dev, sizeof(*foo), GFP_KERNEL); | ||
34 | if (!foo) | ||
35 | return -ENOMEM; | ||
36 | spin_lock_init(&foo->lock); | ||
37 | (...) | ||
38 | } | ||
39 | |||
40 | This will create an instance of struct foo in memory every time probe() is | ||
41 | called. This is our state container for this instance of the device driver. | ||
42 | Of course it is then necessary to always pass this instance of the | ||
43 | state around to all functions that need access to the state and its members. | ||
44 | |||
45 | For example, if the driver is registering an interrupt handler, you would | ||
46 | pass around a pointer to struct foo like this: | ||
47 | |||
48 | static irqreturn_t foo_handler(int irq, void *arg) | ||
49 | { | ||
50 | struct foo *foo = arg; | ||
51 | (...) | ||
52 | } | ||
53 | |||
54 | static int foo_probe(...) | ||
55 | { | ||
56 | struct foo *foo; | ||
57 | |||
58 | (...) | ||
59 | ret = request_irq(irq, foo_handler, 0, "foo", foo); | ||
60 | } | ||
61 | |||
62 | This way you always get a pointer back to the correct instance of foo in | ||
63 | your interrupt handler. | ||
64 | |||
65 | |||
66 | 2. container_of() | ||
67 | ~~~~~~~~~~~~~~~~~ | ||
68 | |||
69 | Continuing on the above example we add an offloaded work: | ||
70 | |||
71 | struct foo { | ||
72 | spinlock_t lock; | ||
73 | struct workqueue_struct *wq; | ||
74 | struct work_struct offload; | ||
75 | (...) | ||
76 | }; | ||
77 | |||
78 | static void foo_work(struct work_struct *work) | ||
79 | { | ||
80 | struct foo *foo = container_of(work, struct foo, offload); | ||
81 | |||
82 | (...) | ||
83 | } | ||
84 | |||
85 | static irqreturn_t foo_handler(int irq, void *arg) | ||
86 | { | ||
87 | struct foo *foo = arg; | ||
88 | |||
89 | queue_work(foo->wq, &foo->offload); | ||
90 | (...) | ||
91 | } | ||
92 | |||
93 | static int foo_probe(...) | ||
94 | { | ||
95 | struct foo *foo; | ||
96 | |||
97 | foo->wq = create_singlethread_workqueue("foo-wq"); | ||
98 | INIT_WORK(&foo->offload, foo_work); | ||
99 | (...) | ||
100 | } | ||
101 | |||
102 | The design pattern is the same for an hrtimer or something similar that will | ||
103 | return a single argument which is a pointer to a struct member in the | ||
104 | callback. | ||
105 | |||
106 | container_of() is a macro defined in <linux/kernel.h> | ||
107 | |||
108 | What container_of() does is to obtain a pointer to the containing struct from | ||
109 | a pointer to a member by a simple subtraction using the offsetof() macro from | ||
110 | standard C, which allows something similar to object oriented behaviours. | ||
111 | Notice that the contained member must not be a pointer, but an actual member | ||
112 | for this to work. | ||
113 | |||
114 | We can see here that we avoid having global pointers to our struct foo * | ||
115 | instance this way, while still keeping the number of parameters passed to the | ||
116 | work function to a single pointer. | ||
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index 5bdc8cb5fc28..4f7897e99cba 100644 --- a/Documentation/driver-model/devres.txt +++ b/Documentation/driver-model/devres.txt | |||
@@ -242,6 +242,8 @@ IIO | |||
242 | devm_iio_device_free() | 242 | devm_iio_device_free() |
243 | devm_iio_trigger_alloc() | 243 | devm_iio_trigger_alloc() |
244 | devm_iio_trigger_free() | 244 | devm_iio_trigger_free() |
245 | devm_iio_device_register() | ||
246 | devm_iio_device_unregister() | ||
245 | 247 | ||
246 | IO region | 248 | IO region |
247 | devm_request_region() | 249 | devm_request_region() |
diff --git a/Documentation/extcon/porting-android-switch-class b/Documentation/extcon/porting-android-switch-class index 5377f6317961..49c81caef84d 100644 --- a/Documentation/extcon/porting-android-switch-class +++ b/Documentation/extcon/porting-android-switch-class | |||
@@ -50,7 +50,7 @@ so that they are still compatible with legacy userspace processes. | |||
50 | Extcon's extended features for switch device drivers with | 50 | Extcon's extended features for switch device drivers with |
51 | complex features usually required magic numbers in state | 51 | complex features usually required magic numbers in state |
52 | value of switch_dev. With extcon, such magic numbers that | 52 | value of switch_dev. With extcon, such magic numbers that |
53 | support multiple cables ( | 53 | support multiple cables are no more required or supported. |
54 | 54 | ||
55 | 1. Define cable names at edev->supported_cable. | 55 | 1. Define cable names at edev->supported_cable. |
56 | 2. (Recommended) remove print_state callback. | 56 | 2. (Recommended) remove print_state callback. |
@@ -114,11 +114,8 @@ exclusive, the two cables cannot be in ATTACHED state simulteneously. | |||
114 | 114 | ||
115 | ****** ABI Location | 115 | ****** ABI Location |
116 | 116 | ||
117 | If "CONFIG_ANDROID" is enabled and "CONFIG_ANDROID_SWITCH" is | 117 | If "CONFIG_ANDROID" is enabled, /sys/class/switch/* are created |
118 | disabled, /sys/class/switch/* are created as symbolic links to | 118 | as symbolic links to /sys/class/extcon/*. |
119 | /sys/class/extcon/*. Because CONFIG_ANDROID_SWITCH creates | ||
120 | /sys/class/switch directory, we disable symboling linking if | ||
121 | CONFIG_ANDROID_SWITCH is enabled. | ||
122 | 119 | ||
123 | The two files of switch class, name and state, are provided with | 120 | The two files of switch class, name and state, are provided with |
124 | extcon, too. When the multistate support (STEP 2 of CHAPTER 1.) is | 121 | extcon, too. When the multistate support (STEP 2 of CHAPTER 1.) is |
diff --git a/Documentation/gpio/board.txt b/Documentation/gpio/board.txt index 0d03506f2cc5..ba169faad5c6 100644 --- a/Documentation/gpio/board.txt +++ b/Documentation/gpio/board.txt | |||
@@ -72,10 +72,11 @@ where | |||
72 | 72 | ||
73 | - chip_label is the label of the gpiod_chip instance providing the GPIO | 73 | - chip_label is the label of the gpiod_chip instance providing the GPIO |
74 | - chip_hwnum is the hardware number of the GPIO within the chip | 74 | - chip_hwnum is the hardware number of the GPIO within the chip |
75 | - dev_id is the identifier of the device that will make use of this GPIO. If | 75 | - dev_id is the identifier of the device that will make use of this GPIO. It |
76 | NULL, the GPIO will be available to all devices. | 76 | can be NULL, in which case it will be matched for calls to gpiod_get() |
77 | with a NULL device. | ||
77 | - con_id is the name of the GPIO function from the device point of view. It | 78 | - con_id is the name of the GPIO function from the device point of view. It |
78 | can be NULL. | 79 | can be NULL, in which case it will match any function. |
79 | - idx is the index of the GPIO within the function. | 80 | - idx is the index of the GPIO within the function. |
80 | - flags is defined to specify the following properties: | 81 | - flags is defined to specify the following properties: |
81 | * GPIOF_ACTIVE_LOW - to configure the GPIO as active-low | 82 | * GPIOF_ACTIVE_LOW - to configure the GPIO as active-low |
@@ -86,18 +87,23 @@ In the future, these flags might be extended to support more properties. | |||
86 | 87 | ||
87 | Note that GPIO_LOOKUP() is just a shortcut to GPIO_LOOKUP_IDX() where idx = 0. | 88 | Note that GPIO_LOOKUP() is just a shortcut to GPIO_LOOKUP_IDX() where idx = 0. |
88 | 89 | ||
89 | A lookup table can then be defined as follows: | 90 | A lookup table can then be defined as follows, with an empty entry defining its |
91 | end: | ||
90 | 92 | ||
91 | struct gpiod_lookup gpios_table[] = { | 93 | struct gpiod_lookup_table gpios_table = { |
92 | GPIO_LOOKUP_IDX("gpio.0", 15, "foo.0", "led", 0, GPIO_ACTIVE_HIGH), | 94 | .dev_id = "foo.0", |
93 | GPIO_LOOKUP_IDX("gpio.0", 16, "foo.0", "led", 1, GPIO_ACTIVE_HIGH), | 95 | .table = { |
94 | GPIO_LOOKUP_IDX("gpio.0", 17, "foo.0", "led", 2, GPIO_ACTIVE_HIGH), | 96 | GPIO_LOOKUP_IDX("gpio.0", 15, "led", 0, GPIO_ACTIVE_HIGH), |
95 | GPIO_LOOKUP("gpio.0", 1, "foo.0", "power", GPIO_ACTIVE_LOW), | 97 | GPIO_LOOKUP_IDX("gpio.0", 16, "led", 1, GPIO_ACTIVE_HIGH), |
96 | }; | 98 | GPIO_LOOKUP_IDX("gpio.0", 17, "led", 2, GPIO_ACTIVE_HIGH), |
99 | GPIO_LOOKUP("gpio.0", 1, "power", GPIO_ACTIVE_LOW), | ||
100 | { }, | ||
101 | }, | ||
102 | }; | ||
97 | 103 | ||
98 | And the table can be added by the board code as follows: | 104 | And the table can be added by the board code as follows: |
99 | 105 | ||
100 | gpiod_add_table(gpios_table, ARRAY_SIZE(gpios_table)); | 106 | gpiod_add_lookup_table(&gpios_table); |
101 | 107 | ||
102 | The driver controlling "foo.0" will then be able to obtain its GPIOs as follows: | 108 | The driver controlling "foo.0" will then be able to obtain its GPIOs as follows: |
103 | 109 | ||
diff --git a/Documentation/gpio/consumer.txt b/Documentation/gpio/consumer.txt index 07c74a3765a0..e42f77d8d4ca 100644 --- a/Documentation/gpio/consumer.txt +++ b/Documentation/gpio/consumer.txt | |||
@@ -38,7 +38,11 @@ device that displays digits), an additional index argument can be specified: | |||
38 | const char *con_id, unsigned int idx) | 38 | const char *con_id, unsigned int idx) |
39 | 39 | ||
40 | Both functions return either a valid GPIO descriptor, or an error code checkable | 40 | Both functions return either a valid GPIO descriptor, or an error code checkable |
41 | with IS_ERR(). They will never return a NULL pointer. | 41 | with IS_ERR() (they will never return a NULL pointer). -ENOENT will be returned |
42 | if and only if no GPIO has been assigned to the device/function/index triplet, | ||
43 | other error codes are used for cases where a GPIO has been assigned but an error | ||
44 | occured while trying to acquire it. This is useful to discriminate between mere | ||
45 | errors and an absence of GPIO for optional GPIO parameters. | ||
42 | 46 | ||
43 | Device-managed variants of these functions are also defined: | 47 | Device-managed variants of these functions are also defined: |
44 | 48 | ||
diff --git a/Documentation/i2c/fault-codes b/Documentation/i2c/fault-codes index 045765c0b9b5..47c25abb7d52 100644 --- a/Documentation/i2c/fault-codes +++ b/Documentation/i2c/fault-codes | |||
@@ -64,9 +64,6 @@ EINVAL | |||
64 | detected before any I/O operation was started. Use a more | 64 | detected before any I/O operation was started. Use a more |
65 | specific fault code when you can. | 65 | specific fault code when you can. |
66 | 66 | ||
67 | One example would be a driver trying an SMBus Block Write | ||
68 | with block size outside the range of 1-32 bytes. | ||
69 | |||
70 | EIO | 67 | EIO |
71 | This rather vague error means something went wrong when | 68 | This rather vague error means something went wrong when |
72 | performing an I/O operation. Use a more specific fault | 69 | performing an I/O operation. Use a more specific fault |
diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO index 8148a47fc70e..0091a8215ac1 100644 --- a/Documentation/ja_JP/HOWTO +++ b/Documentation/ja_JP/HOWTO | |||
@@ -149,7 +149,7 @@ linux-api@ver.kernel.org に送ることを勧めます。 | |||
149 | この他にパッチを作る方法についてのよくできた記述は- | 149 | この他にパッチを作る方法についてのよくできた記述は- |
150 | 150 | ||
151 | "The Perfect Patch" | 151 | "The Perfect Patch" |
152 | http://userweb.kernel.org/~akpm/stuff/tpp.txt | 152 | http://www.ozlabs.org/~akpm/stuff/tpp.txt |
153 | "Linux kernel patch submission format" | 153 | "Linux kernel patch submission format" |
154 | http://linux.yyz.us/patch-format.html | 154 | http://linux.yyz.us/patch-format.html |
155 | 155 | ||
@@ -622,7 +622,7 @@ Linux カーネルコミュニティは、一度に大量のコードの塊を | |||
622 | これについて全てがどのようにあるべきかについての詳細は、以下のドキュメ | 622 | これについて全てがどのようにあるべきかについての詳細は、以下のドキュメ |
623 | ントの ChangeLog セクションを見てください- | 623 | ントの ChangeLog セクションを見てください- |
624 | "The Perfect Patch" | 624 | "The Perfect Patch" |
625 | http://userweb.kernel.org/~akpm/stuff/tpp.txt | 625 | http://www.ozlabs.org/~akpm/stuff/tpp.txt |
626 | 626 | ||
627 | これらのどれもが、時にはとても困難です。これらの慣例を完璧に実施するに | 627 | これらのどれもが、時にはとても困難です。これらの慣例を完璧に実施するに |
628 | は数年かかるかもしれません。これは継続的な改善のプロセスであり、そのた | 628 | は数年かかるかもしれません。これは継続的な改善のプロセスであり、そのた |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index b9e9bd854298..4252af6ffda1 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -774,6 +774,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
774 | disable= [IPV6] | 774 | disable= [IPV6] |
775 | See Documentation/networking/ipv6.txt. | 775 | See Documentation/networking/ipv6.txt. |
776 | 776 | ||
777 | disable_cpu_apicid= [X86,APIC,SMP] | ||
778 | Format: <int> | ||
779 | The number of initial APIC ID for the | ||
780 | corresponding CPU to be disabled at boot, | ||
781 | mostly used for the kdump 2nd kernel to | ||
782 | disable BSP to wake up multiple CPUs without | ||
783 | causing system reset or hang due to sending | ||
784 | INIT from AP to BSP. | ||
785 | |||
777 | disable_ddw [PPC/PSERIES] | 786 | disable_ddw [PPC/PSERIES] |
778 | Disable Dynamic DMA Window support. Use this if | 787 | Disable Dynamic DMA Window support. Use this if |
779 | to workaround buggy firmware. | 788 | to workaround buggy firmware. |
@@ -881,6 +890,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
881 | 890 | ||
882 | The xen output can only be used by Xen PV guests. | 891 | The xen output can only be used by Xen PV guests. |
883 | 892 | ||
893 | edac_report= [HW,EDAC] Control how to report EDAC event | ||
894 | Format: {"on" | "off" | "force"} | ||
895 | on: enable EDAC to report H/W event. May be overridden | ||
896 | by other higher priority error reporting module. | ||
897 | off: disable H/W event reporting through EDAC. | ||
898 | force: enforce the use of EDAC to report H/W event. | ||
899 | default: on. | ||
900 | |||
884 | ekgdboc= [X86,KGDB] Allow early kernel console debugging | 901 | ekgdboc= [X86,KGDB] Allow early kernel console debugging |
885 | ekgdboc=kbd | 902 | ekgdboc=kbd |
886 | 903 | ||
@@ -890,6 +907,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
890 | edd= [EDD] | 907 | edd= [EDD] |
891 | Format: {"off" | "on" | "skip[mbr]"} | 908 | Format: {"off" | "on" | "skip[mbr]"} |
892 | 909 | ||
910 | efi= [EFI] | ||
911 | Format: { "old_map" } | ||
912 | old_map [X86-64]: switch to the old ioremap-based EFI | ||
913 | runtime services mapping. 32-bit still uses this one by | ||
914 | default. | ||
915 | |||
893 | efi_no_storage_paranoia [EFI; X86] | 916 | efi_no_storage_paranoia [EFI; X86] |
894 | Using this parameter you can use more than 50% of | 917 | Using this parameter you can use more than 50% of |
895 | your efi variable storage. Use this parameter only if | 918 | your efi variable storage. Use this parameter only if |
@@ -1994,6 +2017,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1994 | noapic [SMP,APIC] Tells the kernel to not make use of any | 2017 | noapic [SMP,APIC] Tells the kernel to not make use of any |
1995 | IOAPICs that may be present in the system. | 2018 | IOAPICs that may be present in the system. |
1996 | 2019 | ||
2020 | nokaslr [X86] | ||
2021 | Disable kernel base offset ASLR (Address Space | ||
2022 | Layout Randomization) if built into the kernel. | ||
2023 | |||
1997 | noautogroup Disable scheduler automatic task group creation. | 2024 | noautogroup Disable scheduler automatic task group creation. |
1998 | 2025 | ||
1999 | nobats [PPC] Do not use BATs for mapping kernel lowmem | 2026 | nobats [PPC] Do not use BATs for mapping kernel lowmem |
@@ -2627,7 +2654,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2627 | for RCU-preempt, and "s" for RCU-sched, and "N" | 2654 | for RCU-preempt, and "s" for RCU-sched, and "N" |
2628 | is the CPU number. This reduces OS jitter on the | 2655 | is the CPU number. This reduces OS jitter on the |
2629 | offloaded CPUs, which can be useful for HPC and | 2656 | offloaded CPUs, which can be useful for HPC and |
2630 | |||
2631 | real-time workloads. It can also improve energy | 2657 | real-time workloads. It can also improve energy |
2632 | efficiency for asymmetric multiprocessors. | 2658 | efficiency for asymmetric multiprocessors. |
2633 | 2659 | ||
@@ -2643,8 +2669,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2643 | periodically wake up to do the polling. | 2669 | periodically wake up to do the polling. |
2644 | 2670 | ||
2645 | rcutree.blimit= [KNL] | 2671 | rcutree.blimit= [KNL] |
2646 | Set maximum number of finished RCU callbacks to process | 2672 | Set maximum number of finished RCU callbacks to |
2647 | in one batch. | 2673 | process in one batch. |
2648 | 2674 | ||
2649 | rcutree.rcu_fanout_leaf= [KNL] | 2675 | rcutree.rcu_fanout_leaf= [KNL] |
2650 | Increase the number of CPUs assigned to each | 2676 | Increase the number of CPUs assigned to each |
@@ -2663,8 +2689,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2663 | value is one, and maximum value is HZ. | 2689 | value is one, and maximum value is HZ. |
2664 | 2690 | ||
2665 | rcutree.qhimark= [KNL] | 2691 | rcutree.qhimark= [KNL] |
2666 | Set threshold of queued | 2692 | Set threshold of queued RCU callbacks beyond which |
2667 | RCU callbacks over which batch limiting is disabled. | 2693 | batch limiting is disabled. |
2668 | 2694 | ||
2669 | rcutree.qlowmark= [KNL] | 2695 | rcutree.qlowmark= [KNL] |
2670 | Set threshold of queued RCU callbacks below which | 2696 | Set threshold of queued RCU callbacks below which |
diff --git a/Documentation/kmsg/s390/zcrypt b/Documentation/kmsg/s390/zcrypt new file mode 100644 index 000000000000..7fb2087409d6 --- /dev/null +++ b/Documentation/kmsg/s390/zcrypt | |||
@@ -0,0 +1,20 @@ | |||
1 | /*? | ||
2 | * Text: "Cryptographic device %x failed and was set offline\n" | ||
3 | * Severity: Error | ||
4 | * Parameter: | ||
5 | * @1: device index | ||
6 | * Description: | ||
7 | * A cryptographic device failed to process a cryptographic request. | ||
8 | * The cryptographic device driver could not correct the error and | ||
9 | * set the device offline. The application that issued the | ||
10 | * request received an indication that the request has failed. | ||
11 | * User action: | ||
12 | * Use the lszcrypt command to confirm that the cryptographic | ||
13 | * hardware is still configured to your LPAR or z/VM guest virtual | ||
14 | * machine. If the device is available to your Linux instance the | ||
15 | * command output contains a line that begins with 'card<device index>', | ||
16 | * where <device index> is the two-digit decimal number in the message text. | ||
17 | * After ensuring that the device is available, use the chzcrypt command to | ||
18 | * set it online again. | ||
19 | * If the error persists, contact your support organization. | ||
20 | */ | ||
diff --git a/Documentation/ko_KR/HOWTO b/Documentation/ko_KR/HOWTO index 680e64635958..dc2ff8f611e0 100644 --- a/Documentation/ko_KR/HOWTO +++ b/Documentation/ko_KR/HOWTO | |||
@@ -122,7 +122,7 @@ mtk.manpages@gmail.com의 메인테이너에게 보낼 것을 권장한다. | |||
122 | 122 | ||
123 | 올바른 패치들을 만드는 법에 관한 훌륭한 다른 문서들이 있다. | 123 | 올바른 패치들을 만드는 법에 관한 훌륭한 다른 문서들이 있다. |
124 | "The Perfect Patch" | 124 | "The Perfect Patch" |
125 | http://userweb.kernel.org/~akpm/stuff/tpp.txt | 125 | http://www.ozlabs.org/~akpm/stuff/tpp.txt |
126 | "Linux kernel patch submission format" | 126 | "Linux kernel patch submission format" |
127 | http://linux.yyz.us/patch-format.html | 127 | http://linux.yyz.us/patch-format.html |
128 | 128 | ||
@@ -213,7 +213,7 @@ Documentation/DocBook/ 디렉토리 내에서 만들어지며 PDF, Postscript, H | |||
213 | 것은 Linux Cross-Reference project이며 그것은 자기 참조 방식이며 | 213 | 것은 Linux Cross-Reference project이며 그것은 자기 참조 방식이며 |
214 | 소스코드를 인덱스된 웹 페이지들의 형태로 보여준다. 최신의 멋진 커널 | 214 | 소스코드를 인덱스된 웹 페이지들의 형태로 보여준다. 최신의 멋진 커널 |
215 | 코드 저장소는 다음을 통하여 참조할 수 있다. | 215 | 코드 저장소는 다음을 통하여 참조할 수 있다. |
216 | http://users.sosdg.org/~qiyong/lxr/ | 216 | http://lxr.linux.no/+trees |
217 | 217 | ||
218 | 218 | ||
219 | 개발 프로세스 | 219 | 개발 프로세스 |
@@ -222,20 +222,20 @@ Documentation/DocBook/ 디렉토리 내에서 만들어지며 PDF, Postscript, H | |||
222 | 리눅스 커널 개발 프로세스는 현재 몇몇 다른 메인 커널 "브랜치들"과 | 222 | 리눅스 커널 개발 프로세스는 현재 몇몇 다른 메인 커널 "브랜치들"과 |
223 | 서브시스템에 특화된 커널 브랜치들로 구성된다. 몇몇 다른 메인 | 223 | 서브시스템에 특화된 커널 브랜치들로 구성된다. 몇몇 다른 메인 |
224 | 브랜치들은 다음과 같다. | 224 | 브랜치들은 다음과 같다. |
225 | - main 2.6.x 커널 트리 | 225 | - main 3.x 커널 트리 |
226 | - 2.6.x.y - 안정된 커널 트리 | 226 | - 3.x.y - 안정된 커널 트리 |
227 | - 2.6.x -git 커널 패치들 | 227 | - 3.x -git 커널 패치들 |
228 | - 2.6.x -mm 커널 패치들 | ||
229 | - 서브시스템을 위한 커널 트리들과 패치들 | 228 | - 서브시스템을 위한 커널 트리들과 패치들 |
229 | - 3.x - 통합 테스트를 위한 next 커널 트리 | ||
230 | 230 | ||
231 | 2.6.x 커널 트리 | 231 | 3.x 커널 트리 |
232 | --------------- | 232 | --------------- |
233 | 233 | ||
234 | 2.6.x 커널들은 Linux Torvalds가 관리하며 kernel.org의 pub/linux/kernel/v2.6/ | 234 | 3.x 커널들은 Linux Torvalds가 관리하며 kernel.org의 pub/linux/kernel/v3.x/ |
235 | 디렉토리에서 참조될 수 있다.개발 프로세스는 다음과 같다. | 235 | 디렉토리에서 참조될 수 있다.개발 프로세스는 다음과 같다. |
236 | - 새로운 커널이 배포되자마자 2주의 시간이 주어진다. 이 기간동은 | 236 | - 새로운 커널이 배포되자마자 2주의 시간이 주어진다. 이 기간동은 |
237 | 메인테이너들은 큰 diff들을 Linus에게 제출할 수 있다. 대개 이 패치들은 | 237 | 메인테이너들은 큰 diff들을 Linus에게 제출할 수 있다. 대개 이 패치들은 |
238 | 몇 주 동안 -mm 커널내에 이미 있었던 것들이다. 큰 변경들을 제출하는 데 | 238 | 몇 주 동안 -next 커널내에 이미 있었던 것들이다. 큰 변경들을 제출하는 데 |
239 | 선호되는 방법은 git(커널의 소스 관리 툴, 더 많은 정보들은 http://git.or.cz/ | 239 | 선호되는 방법은 git(커널의 소스 관리 툴, 더 많은 정보들은 http://git.or.cz/ |
240 | 에서 참조할 수 있다)를 사용하는 것이지만 순수한 패치파일의 형식으로 보내는 | 240 | 에서 참조할 수 있다)를 사용하는 것이지만 순수한 패치파일의 형식으로 보내는 |
241 | 것도 무관하다. | 241 | 것도 무관하다. |
@@ -262,20 +262,20 @@ Andrew Morton의 글이 있다. | |||
262 | 버그의 상황에 따라 배포되는 것이지 미리정해 놓은 시간에 따라 | 262 | 버그의 상황에 따라 배포되는 것이지 미리정해 놓은 시간에 따라 |
263 | 배포되는 것은 아니기 때문이다." | 263 | 배포되는 것은 아니기 때문이다." |
264 | 264 | ||
265 | 2.6.x.y - 안정 커널 트리 | 265 | 3.x.y - 안정 커널 트리 |
266 | ------------------------ | 266 | ------------------------ |
267 | 267 | ||
268 | 4 자리 숫자로 이루어진 버젼의 커널들은 -stable 커널들이다. 그것들은 2.6.x | 268 | 3 자리 숫자로 이루어진 버젼의 커널들은 -stable 커널들이다. 그것들은 3.x |
269 | 커널에서 발견된 큰 회귀들이나 보안 문제들 중 비교적 작고 중요한 수정들을 | 269 | 커널에서 발견된 큰 회귀들이나 보안 문제들 중 비교적 작고 중요한 수정들을 |
270 | 포함한다. | 270 | 포함한다. |
271 | 271 | ||
272 | 이것은 가장 최근의 안정적인 커널을 원하는 사용자에게 추천되는 브랜치이며, | 272 | 이것은 가장 최근의 안정적인 커널을 원하는 사용자에게 추천되는 브랜치이며, |
273 | 개발/실험적 버젼을 테스트하는 것을 돕고자 하는 사용자들과는 별로 관련이 없다. | 273 | 개발/실험적 버젼을 테스트하는 것을 돕고자 하는 사용자들과는 별로 관련이 없다. |
274 | 274 | ||
275 | 어떤 2.6.x.y 커널도 사용할 수 없다면 그때는 가장 높은 숫자의 2.6.x | 275 | 어떤 3.x.y 커널도 사용할 수 없다면 그때는 가장 높은 숫자의 3.x |
276 | 커널이 현재의 안정 커널이다. | 276 | 커널이 현재의 안정 커널이다. |
277 | 277 | ||
278 | 2.6.x.y는 "stable" 팀<stable@kernel.org>에 의해 관리되며 거의 매번 격주로 | 278 | 3.x.y는 "stable" 팀<stable@vger.kernel.org>에 의해 관리되며 거의 매번 격주로 |
279 | 배포된다. | 279 | 배포된다. |
280 | 280 | ||
281 | 커널 트리 문서들 내에 Documentation/stable_kernel_rules.txt 파일은 어떤 | 281 | 커널 트리 문서들 내에 Documentation/stable_kernel_rules.txt 파일은 어떤 |
@@ -283,84 +283,46 @@ Andrew Morton의 글이 있다. | |||
283 | 진행되는지를 설명한다. | 283 | 진행되는지를 설명한다. |
284 | 284 | ||
285 | 285 | ||
286 | 2.6.x -git 패치들 | 286 | 3.x -git 패치들 |
287 | ------------------ | 287 | ------------------ |
288 | git 저장소(그러므로 -git이라는 이름이 붙음)에는 날마다 관리되는 Linus의 | 288 | git 저장소(그러므로 -git이라는 이름이 붙음)에는 날마다 관리되는 Linus의 |
289 | 커널 트리의 snapshot 들이 있다. 이 패치들은 일반적으로 날마다 배포되며 | 289 | 커널 트리의 snapshot 들이 있다. 이 패치들은 일반적으로 날마다 배포되며 |
290 | Linus의 트리의 현재 상태를 나타낸다. 이 패치들은 정상적인지 조금도 | 290 | Linus의 트리의 현재 상태를 나타낸다. 이 패치들은 정상적인지 조금도 |
291 | 살펴보지 않고 자동적으로 생성된 것이므로 -rc 커널들 보다도 더 실험적이다. | 291 | 살펴보지 않고 자동적으로 생성된 것이므로 -rc 커널들 보다도 더 실험적이다. |
292 | 292 | ||
293 | 2.6.x -mm 커널 패치들 | ||
294 | --------------------- | ||
295 | Andrew Morton에 의해 배포된 실험적인 커널 패치들이다. Andrew는 모든 다른 | ||
296 | 서브시스템 커널 트리와 패치들을 가져와서 리눅스 커널 메일링 리스트로 | ||
297 | 온 많은 패치들과 한데 묶는다. 이 트리는 새로운 기능들과 패치들을 위한 | ||
298 | 장소를 제공하는 역할을 한다. 하나의 패치가 -mm에 한동안 있으면서 그 가치가 | ||
299 | 증명되게 되면 Andrew나 서브시스템 메인테이너는 그것을 메인라인에 포함시키기 | ||
300 | 위하여 Linus에게 보낸다. | ||
301 | |||
302 | 커널 트리에 포함하고 싶은 모든 새로운 패치들은 Linus에게 보내지기 전에 | ||
303 | -mm 트리에서 테스트를 하는 것을 적극 추천한다. | ||
304 | |||
305 | 이 커널들은 안정되게 사용할 시스템에서에 실행하는 것은 적합하지 않으며 | ||
306 | 다른 브랜치들의 어떤 것들보다 위험하다. | ||
307 | |||
308 | 여러분이 커널 개발 프로세스를 돕길 원한다면 이 커널 배포들을 사용하고 | ||
309 | 테스트한 후 어떤 문제를 발견하거나 또는 모든 것이 잘 동작한다면 리눅스 | ||
310 | 커널 메일링 리스트로 피드백을 해달라. | ||
311 | |||
312 | 이 커널들은 일반적으로 모든 다른 실험적인 패치들과 배포될 당시의 | ||
313 | 사용가능한 메인라인 -git 커널들의 몇몇 변경을 포함한다. | ||
314 | |||
315 | -mm 커널들은 정해진 일정대로 배포되지 않는다. 하지만 대개 몇몇 -mm 커널들은 | ||
316 | 각 -rc 커널(1부터 3이 흔함) 사이에서 배포된다. | ||
317 | |||
318 | 서브시스템 커널 트리들과 패치들 | 293 | 서브시스템 커널 트리들과 패치들 |
319 | ------------------------------- | 294 | ------------------------------- |
320 | 많은 다른 커널 서브시스템 개발자들은 커널의 다른 부분들에서 무슨 일이 | 295 | 다양한 커널 서브시스템의 메인테이너들 --- 그리고 많은 커널 서브시스템 개발자들 |
321 | 일어나고 있는지를 볼수 있도록 그들의 개발 트리를 공개한다. 이 트리들은 | 296 | --- 은 그들의 현재 개발 상태를 소스 저장소로 노출한다. 이를 통해 다른 사람들도 |
322 | 위에서 설명하였던 것 처럼 -mm 커널 배포들로 합쳐진다. | 297 | 커널의 다른 영역에 어떤 변화가 이루어지고 있는지 알 수 있다. 급속히 개발이 |
323 | 298 | 진행되는 영역이 있고 그렇지 않은 영역이 있으므로, 개발자는 다른 개발자가 제출한 | |
324 | 다음은 활용가능한 커널 트리들을 나열한다. | 299 | 수정 사항과 자신의 수정사항의 충돌이나 동일한 일을 동시에 두사람이 따로 |
325 | git trees: | 300 | 진행하는 사태를 방지하기 위해 급속히 개발이 진행되고 있는 영역에 작업의 |
326 | - Kbuild development tree, Sam Ravnborg < sam@ravnborg.org> | 301 | 베이스를 맞춰줄 것이 요구된다. |
327 | git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git | 302 | |
328 | 303 | 대부분의 이러한 저장소는 git 트리지만, git이 아닌 SCM으로 관리되거나, quilt | |
329 | - ACPI development tree, Len Brown <len.brown@intel.com > | 304 | 시리즈로 제공되는 패치들도 존재한다. 이러한 서브시스템 저장소들은 MAINTAINERS |
330 | git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git | 305 | 파일에 나열되어 있다. 대부분은 http://git.kernel.org 에서 볼 수 있다. |
331 | 306 | ||
332 | - Block development tree, Jens Axboe <jens.axboe@oracle.com> | 307 | 제안된 패치는 서브시스템 트리에 커밋되기 전에 메일링 리스트를 통해 |
333 | git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git | 308 | 리뷰된다(아래의 관련 섹션을 참고하기 바란다). 일부 커널 서브시스템의 경우, 이 |
334 | 309 | 리뷰 프로세스는 patchwork라는 도구를 통해 추적된다. patchwork은 등록된 패치와 | |
335 | - DRM development tree, Dave Airlie <airlied@linux.ie> | 310 | 패치에 대한 코멘트, 패치의 버전을 볼 수 있는 웹 인터페이스를 제공하고, |
336 | git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git | 311 | 메인테이너는 패치를 리뷰 중, 리뷰 통과, 또는 반려됨으로 표시할 수 있다. |
337 | 312 | 대부분의 이러한 patchwork 사이트는 http://patchwork.kernel.org/ 또는 | |
338 | - ia64 development tree, Tony Luck < tony.luck@intel.com> | 313 | http://patchwork.ozlabs.org/ 에 나열되어 있다. |
339 | git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git | 314 | |
340 | 315 | 3.x - 통합 테스트를 위한 next 커널 트리 | |
341 | - infiniband, Roland Dreier <rolandd@cisco.com > | 316 | ----------------------------------------- |
342 | git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git | 317 | 서브시스템 트리들의 변경사항들은 mainline 3.x 트리로 들어오기 전에 통합 |
343 | 318 | 테스트를 거쳐야 한다. 이런 목적으로, 모든 서브시스템 트리의 변경사항을 거의 | |
344 | - libata, Jeff Garzik <jgarzik@pobox.com> | 319 | 매일 받아가는 특수한 테스트 저장소가 존재한다: |
345 | git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git | 320 | http://git.kernel.org/?p=linux/kernel/git/sfr/linux-next.git |
346 | 321 | http://linux.f-seidel.de/linux-next/pmwiki/ | |
347 | - network drivers, Jeff Garzik <jgarzik@pobox.com> | 322 | |
348 | git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git | 323 | 이런 식으로, -next 커널을 통해 다음 머지 기간에 메인라인 커널에 어떤 변경이 |
349 | 324 | 가해질 것인지 간략히 알 수 있다. 모험심 강한 테스터라면 -next 커널에서 테스트를 | |
350 | - pcmcia, Dominik Brodowski < linux@dominikbrodowski.net> | 325 | 수행하는 것도 좋을 것이다. |
351 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git | ||
352 | |||
353 | - SCSI, James Bottomley < James.Bottomley@SteelEye.com> | ||
354 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git | ||
355 | |||
356 | quilt trees: | ||
357 | - USB, PCI, Driver Core, and I2C, Greg Kroah-Hartman < gregkh@linuxfoundation.org> | ||
358 | kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ | ||
359 | - x86-64, partly i386, Andi Kleen < ak@suse.de> | ||
360 | ftp.firstfloor.org:/pub/ak/x86_64/quilt/ | ||
361 | |||
362 | 다른 커널 트리들은 http://kernel.org/git와 MAINTAINERS 파일에서 참조할 수 | ||
363 | 있다. | ||
364 | 326 | ||
365 | 버그 보고 | 327 | 버그 보고 |
366 | --------- | 328 | --------- |
@@ -597,7 +559,7 @@ Pat이라는 이름을 가진 여자가 있을 수도 있는 것이다. 리눅 | |||
597 | 559 | ||
598 | 이것이 무엇인지 더 자세한 것을 알고 싶다면 다음 문서의 ChageLog 항을 봐라. | 560 | 이것이 무엇인지 더 자세한 것을 알고 싶다면 다음 문서의 ChageLog 항을 봐라. |
599 | "The Perfect Patch" | 561 | "The Perfect Patch" |
600 | http://userweb.kernel.org/~akpm/stuff/tpp.txt | 562 | http://www.ozlabs.org/~akpm/stuff/tpp.txt |
601 | 563 | ||
602 | 564 | ||
603 | 565 | ||
diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt index c5182bb2c16c..f87241dfed87 100644 --- a/Documentation/kobject.txt +++ b/Documentation/kobject.txt | |||
@@ -342,7 +342,10 @@ kset use: | |||
342 | 342 | ||
343 | When you are finished with the kset, call: | 343 | When you are finished with the kset, call: |
344 | void kset_unregister(struct kset *kset); | 344 | void kset_unregister(struct kset *kset); |
345 | to destroy it. | 345 | to destroy it. This removes the kset from sysfs and decrements its reference |
346 | count. When the reference count goes to zero, the kset will be released. | ||
347 | Because other references to the kset may still exist, the release may happen | ||
348 | after kset_unregister() returns. | ||
346 | 349 | ||
347 | An example of using a kset can be seen in the | 350 | An example of using a kset can be seen in the |
348 | samples/kobject/kset-example.c file in the kernel tree. | 351 | samples/kobject/kset-example.c file in the kernel tree. |
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index c8c42e64e953..102dc19c4119 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt | |||
@@ -194,18 +194,22 @@ There are some minimal guarantees that may be expected of a CPU: | |||
194 | (*) On any given CPU, dependent memory accesses will be issued in order, with | 194 | (*) On any given CPU, dependent memory accesses will be issued in order, with |
195 | respect to itself. This means that for: | 195 | respect to itself. This means that for: |
196 | 196 | ||
197 | Q = P; D = *Q; | 197 | ACCESS_ONCE(Q) = P; smp_read_barrier_depends(); D = ACCESS_ONCE(*Q); |
198 | 198 | ||
199 | the CPU will issue the following memory operations: | 199 | the CPU will issue the following memory operations: |
200 | 200 | ||
201 | Q = LOAD P, D = LOAD *Q | 201 | Q = LOAD P, D = LOAD *Q |
202 | 202 | ||
203 | and always in that order. | 203 | and always in that order. On most systems, smp_read_barrier_depends() |
204 | does nothing, but it is required for DEC Alpha. The ACCESS_ONCE() | ||
205 | is required to prevent compiler mischief. Please note that you | ||
206 | should normally use something like rcu_dereference() instead of | ||
207 | open-coding smp_read_barrier_depends(). | ||
204 | 208 | ||
205 | (*) Overlapping loads and stores within a particular CPU will appear to be | 209 | (*) Overlapping loads and stores within a particular CPU will appear to be |
206 | ordered within that CPU. This means that for: | 210 | ordered within that CPU. This means that for: |
207 | 211 | ||
208 | a = *X; *X = b; | 212 | a = ACCESS_ONCE(*X); ACCESS_ONCE(*X) = b; |
209 | 213 | ||
210 | the CPU will only issue the following sequence of memory operations: | 214 | the CPU will only issue the following sequence of memory operations: |
211 | 215 | ||
@@ -213,7 +217,7 @@ There are some minimal guarantees that may be expected of a CPU: | |||
213 | 217 | ||
214 | And for: | 218 | And for: |
215 | 219 | ||
216 | *X = c; d = *X; | 220 | ACCESS_ONCE(*X) = c; d = ACCESS_ONCE(*X); |
217 | 221 | ||
218 | the CPU will only issue: | 222 | the CPU will only issue: |
219 | 223 | ||
@@ -224,6 +228,12 @@ There are some minimal guarantees that may be expected of a CPU: | |||
224 | 228 | ||
225 | And there are a number of things that _must_ or _must_not_ be assumed: | 229 | And there are a number of things that _must_ or _must_not_ be assumed: |
226 | 230 | ||
231 | (*) It _must_not_ be assumed that the compiler will do what you want with | ||
232 | memory references that are not protected by ACCESS_ONCE(). Without | ||
233 | ACCESS_ONCE(), the compiler is within its rights to do all sorts | ||
234 | of "creative" transformations, which are covered in the Compiler | ||
235 | Barrier section. | ||
236 | |||
227 | (*) It _must_not_ be assumed that independent loads and stores will be issued | 237 | (*) It _must_not_ be assumed that independent loads and stores will be issued |
228 | in the order given. This means that for: | 238 | in the order given. This means that for: |
229 | 239 | ||
@@ -371,33 +381,44 @@ Memory barriers come in four basic varieties: | |||
371 | 381 | ||
372 | And a couple of implicit varieties: | 382 | And a couple of implicit varieties: |
373 | 383 | ||
374 | (5) LOCK operations. | 384 | (5) ACQUIRE operations. |
375 | 385 | ||
376 | This acts as a one-way permeable barrier. It guarantees that all memory | 386 | This acts as a one-way permeable barrier. It guarantees that all memory |
377 | operations after the LOCK operation will appear to happen after the LOCK | 387 | operations after the ACQUIRE operation will appear to happen after the |
378 | operation with respect to the other components of the system. | 388 | ACQUIRE operation with respect to the other components of the system. |
389 | ACQUIRE operations include LOCK operations and smp_load_acquire() | ||
390 | operations. | ||
379 | 391 | ||
380 | Memory operations that occur before a LOCK operation may appear to happen | 392 | Memory operations that occur before an ACQUIRE operation may appear to |
381 | after it completes. | 393 | happen after it completes. |
382 | 394 | ||
383 | A LOCK operation should almost always be paired with an UNLOCK operation. | 395 | An ACQUIRE operation should almost always be paired with a RELEASE |
396 | operation. | ||
384 | 397 | ||
385 | 398 | ||
386 | (6) UNLOCK operations. | 399 | (6) RELEASE operations. |
387 | 400 | ||
388 | This also acts as a one-way permeable barrier. It guarantees that all | 401 | This also acts as a one-way permeable barrier. It guarantees that all |
389 | memory operations before the UNLOCK operation will appear to happen before | 402 | memory operations before the RELEASE operation will appear to happen |
390 | the UNLOCK operation with respect to the other components of the system. | 403 | before the RELEASE operation with respect to the other components of the |
404 | system. RELEASE operations include UNLOCK operations and | ||
405 | smp_store_release() operations. | ||
391 | 406 | ||
392 | Memory operations that occur after an UNLOCK operation may appear to | 407 | Memory operations that occur after a RELEASE operation may appear to |
393 | happen before it completes. | 408 | happen before it completes. |
394 | 409 | ||
395 | LOCK and UNLOCK operations are guaranteed to appear with respect to each | 410 | The use of ACQUIRE and RELEASE operations generally precludes the need |
396 | other strictly in the order specified. | 411 | for other sorts of memory barrier (but note the exceptions mentioned in |
412 | the subsection "MMIO write barrier"). In addition, a RELEASE+ACQUIRE | ||
413 | pair is -not- guaranteed to act as a full memory barrier. However, after | ||
414 | an ACQUIRE on a given variable, all memory accesses preceding any prior | ||
415 | RELEASE on that same variable are guaranteed to be visible. In other | ||
416 | words, within a given variable's critical section, all accesses of all | ||
417 | previous critical sections for that variable are guaranteed to have | ||
418 | completed. | ||
397 | 419 | ||
398 | The use of LOCK and UNLOCK operations generally precludes the need for | 420 | This means that ACQUIRE acts as a minimal "acquire" operation and |
399 | other sorts of memory barrier (but note the exceptions mentioned in the | 421 | RELEASE acts as a minimal "release" operation. |
400 | subsection "MMIO write barrier"). | ||
401 | 422 | ||
402 | 423 | ||
403 | Memory barriers are only required where there's a possibility of interaction | 424 | Memory barriers are only required where there's a possibility of interaction |
@@ -450,14 +471,14 @@ The usage requirements of data dependency barriers are a little subtle, and | |||
450 | it's not always obvious that they're needed. To illustrate, consider the | 471 | it's not always obvious that they're needed. To illustrate, consider the |
451 | following sequence of events: | 472 | following sequence of events: |
452 | 473 | ||
453 | CPU 1 CPU 2 | 474 | CPU 1 CPU 2 |
454 | =============== =============== | 475 | =============== =============== |
455 | { A == 1, B == 2, C = 3, P == &A, Q == &C } | 476 | { A == 1, B == 2, C = 3, P == &A, Q == &C } |
456 | B = 4; | 477 | B = 4; |
457 | <write barrier> | 478 | <write barrier> |
458 | P = &B | 479 | ACCESS_ONCE(P) = &B |
459 | Q = P; | 480 | Q = ACCESS_ONCE(P); |
460 | D = *Q; | 481 | D = *Q; |
461 | 482 | ||
462 | There's a clear data dependency here, and it would seem that by the end of the | 483 | There's a clear data dependency here, and it would seem that by the end of the |
463 | sequence, Q must be either &A or &B, and that: | 484 | sequence, Q must be either &A or &B, and that: |
@@ -477,15 +498,15 @@ Alpha). | |||
477 | To deal with this, a data dependency barrier or better must be inserted | 498 | To deal with this, a data dependency barrier or better must be inserted |
478 | between the address load and the data load: | 499 | between the address load and the data load: |
479 | 500 | ||
480 | CPU 1 CPU 2 | 501 | CPU 1 CPU 2 |
481 | =============== =============== | 502 | =============== =============== |
482 | { A == 1, B == 2, C = 3, P == &A, Q == &C } | 503 | { A == 1, B == 2, C = 3, P == &A, Q == &C } |
483 | B = 4; | 504 | B = 4; |
484 | <write barrier> | 505 | <write barrier> |
485 | P = &B | 506 | ACCESS_ONCE(P) = &B |
486 | Q = P; | 507 | Q = ACCESS_ONCE(P); |
487 | <data dependency barrier> | 508 | <data dependency barrier> |
488 | D = *Q; | 509 | D = *Q; |
489 | 510 | ||
490 | This enforces the occurrence of one of the two implications, and prevents the | 511 | This enforces the occurrence of one of the two implications, and prevents the |
491 | third possibility from arising. | 512 | third possibility from arising. |
@@ -500,25 +521,26 @@ odd-numbered bank is idle, one can see the new value of the pointer P (&B), | |||
500 | but the old value of the variable B (2). | 521 | but the old value of the variable B (2). |
501 | 522 | ||
502 | 523 | ||
503 | Another example of where data dependency barriers might by required is where a | 524 | Another example of where data dependency barriers might be required is where a |
504 | number is read from memory and then used to calculate the index for an array | 525 | number is read from memory and then used to calculate the index for an array |
505 | access: | 526 | access: |
506 | 527 | ||
507 | CPU 1 CPU 2 | 528 | CPU 1 CPU 2 |
508 | =============== =============== | 529 | =============== =============== |
509 | { M[0] == 1, M[1] == 2, M[3] = 3, P == 0, Q == 3 } | 530 | { M[0] == 1, M[1] == 2, M[3] = 3, P == 0, Q == 3 } |
510 | M[1] = 4; | 531 | M[1] = 4; |
511 | <write barrier> | 532 | <write barrier> |
512 | P = 1 | 533 | ACCESS_ONCE(P) = 1 |
513 | Q = P; | 534 | Q = ACCESS_ONCE(P); |
514 | <data dependency barrier> | 535 | <data dependency barrier> |
515 | D = M[Q]; | 536 | D = M[Q]; |
516 | 537 | ||
517 | 538 | ||
518 | The data dependency barrier is very important to the RCU system, for example. | 539 | The data dependency barrier is very important to the RCU system, |
519 | See rcu_dereference() in include/linux/rcupdate.h. This permits the current | 540 | for example. See rcu_assign_pointer() and rcu_dereference() in |
520 | target of an RCU'd pointer to be replaced with a new modified target, without | 541 | include/linux/rcupdate.h. This permits the current target of an RCU'd |
521 | the replacement target appearing to be incompletely initialised. | 542 | pointer to be replaced with a new modified target, without the replacement |
543 | target appearing to be incompletely initialised. | ||
522 | 544 | ||
523 | See also the subsection on "Cache Coherency" for a more thorough example. | 545 | See also the subsection on "Cache Coherency" for a more thorough example. |
524 | 546 | ||
@@ -530,24 +552,190 @@ A control dependency requires a full read memory barrier, not simply a data | |||
530 | dependency barrier to make it work correctly. Consider the following bit of | 552 | dependency barrier to make it work correctly. Consider the following bit of |
531 | code: | 553 | code: |
532 | 554 | ||
533 | q = &a; | 555 | q = ACCESS_ONCE(a); |
534 | if (p) { | 556 | if (q) { |
535 | <data dependency barrier> | 557 | <data dependency barrier> /* BUG: No data dependency!!! */ |
536 | q = &b; | 558 | p = ACCESS_ONCE(b); |
537 | } | 559 | } |
538 | x = *q; | ||
539 | 560 | ||
540 | This will not have the desired effect because there is no actual data | 561 | This will not have the desired effect because there is no actual data |
541 | dependency, but rather a control dependency that the CPU may short-circuit by | 562 | dependency, but rather a control dependency that the CPU may short-circuit |
542 | attempting to predict the outcome in advance. In such a case what's actually | 563 | by attempting to predict the outcome in advance, so that other CPUs see |
543 | required is: | 564 | the load from b as having happened before the load from a. In such a |
565 | case what's actually required is: | ||
544 | 566 | ||
545 | q = &a; | 567 | q = ACCESS_ONCE(a); |
546 | if (p) { | 568 | if (q) { |
547 | <read barrier> | 569 | <read barrier> |
548 | q = &b; | 570 | p = ACCESS_ONCE(b); |
571 | } | ||
572 | |||
573 | However, stores are not speculated. This means that ordering -is- provided | ||
574 | in the following example: | ||
575 | |||
576 | q = ACCESS_ONCE(a); | ||
577 | if (ACCESS_ONCE(q)) { | ||
578 | ACCESS_ONCE(b) = p; | ||
579 | } | ||
580 | |||
581 | Please note that ACCESS_ONCE() is not optional! Without the ACCESS_ONCE(), | ||
582 | the compiler is within its rights to transform this example: | ||
583 | |||
584 | q = a; | ||
585 | if (q) { | ||
586 | b = p; /* BUG: Compiler can reorder!!! */ | ||
587 | do_something(); | ||
588 | } else { | ||
589 | b = p; /* BUG: Compiler can reorder!!! */ | ||
590 | do_something_else(); | ||
591 | } | ||
592 | |||
593 | into this, which of course defeats the ordering: | ||
594 | |||
595 | b = p; | ||
596 | q = a; | ||
597 | if (q) | ||
598 | do_something(); | ||
599 | else | ||
600 | do_something_else(); | ||
601 | |||
602 | Worse yet, if the compiler is able to prove (say) that the value of | ||
603 | variable 'a' is always non-zero, it would be well within its rights | ||
604 | to optimize the original example by eliminating the "if" statement | ||
605 | as follows: | ||
606 | |||
607 | q = a; | ||
608 | b = p; /* BUG: Compiler can reorder!!! */ | ||
609 | do_something(); | ||
610 | |||
611 | The solution is again ACCESS_ONCE(), which preserves the ordering between | ||
612 | the load from variable 'a' and the store to variable 'b': | ||
613 | |||
614 | q = ACCESS_ONCE(a); | ||
615 | if (q) { | ||
616 | ACCESS_ONCE(b) = p; | ||
617 | do_something(); | ||
618 | } else { | ||
619 | ACCESS_ONCE(b) = p; | ||
620 | do_something_else(); | ||
621 | } | ||
622 | |||
623 | You could also use barrier() to prevent the compiler from moving | ||
624 | the stores to variable 'b', but barrier() would not prevent the | ||
625 | compiler from proving to itself that a==1 always, so ACCESS_ONCE() | ||
626 | is also needed. | ||
627 | |||
628 | It is important to note that control dependencies absolutely require a | ||
629 | a conditional. For example, the following "optimized" version of | ||
630 | the above example breaks ordering: | ||
631 | |||
632 | q = ACCESS_ONCE(a); | ||
633 | ACCESS_ONCE(b) = p; /* BUG: No ordering vs. load from a!!! */ | ||
634 | if (q) { | ||
635 | /* ACCESS_ONCE(b) = p; -- moved up, BUG!!! */ | ||
636 | do_something(); | ||
637 | } else { | ||
638 | /* ACCESS_ONCE(b) = p; -- moved up, BUG!!! */ | ||
639 | do_something_else(); | ||
549 | } | 640 | } |
550 | x = *q; | 641 | |
642 | It is of course legal for the prior load to be part of the conditional, | ||
643 | for example, as follows: | ||
644 | |||
645 | if (ACCESS_ONCE(a) > 0) { | ||
646 | ACCESS_ONCE(b) = q / 2; | ||
647 | do_something(); | ||
648 | } else { | ||
649 | ACCESS_ONCE(b) = q / 3; | ||
650 | do_something_else(); | ||
651 | } | ||
652 | |||
653 | This will again ensure that the load from variable 'a' is ordered before the | ||
654 | stores to variable 'b'. | ||
655 | |||
656 | In addition, you need to be careful what you do with the local variable 'q', | ||
657 | otherwise the compiler might be able to guess the value and again remove | ||
658 | the needed conditional. For example: | ||
659 | |||
660 | q = ACCESS_ONCE(a); | ||
661 | if (q % MAX) { | ||
662 | ACCESS_ONCE(b) = p; | ||
663 | do_something(); | ||
664 | } else { | ||
665 | ACCESS_ONCE(b) = p; | ||
666 | do_something_else(); | ||
667 | } | ||
668 | |||
669 | If MAX is defined to be 1, then the compiler knows that (q % MAX) is | ||
670 | equal to zero, in which case the compiler is within its rights to | ||
671 | transform the above code into the following: | ||
672 | |||
673 | q = ACCESS_ONCE(a); | ||
674 | ACCESS_ONCE(b) = p; | ||
675 | do_something_else(); | ||
676 | |||
677 | This transformation loses the ordering between the load from variable 'a' | ||
678 | and the store to variable 'b'. If you are relying on this ordering, you | ||
679 | should do something like the following: | ||
680 | |||
681 | q = ACCESS_ONCE(a); | ||
682 | BUILD_BUG_ON(MAX <= 1); /* Order load from a with store to b. */ | ||
683 | if (q % MAX) { | ||
684 | ACCESS_ONCE(b) = p; | ||
685 | do_something(); | ||
686 | } else { | ||
687 | ACCESS_ONCE(b) = p; | ||
688 | do_something_else(); | ||
689 | } | ||
690 | |||
691 | Finally, control dependencies do -not- provide transitivity. This is | ||
692 | demonstrated by two related examples: | ||
693 | |||
694 | CPU 0 CPU 1 | ||
695 | ===================== ===================== | ||
696 | r1 = ACCESS_ONCE(x); r2 = ACCESS_ONCE(y); | ||
697 | if (r1 >= 0) if (r2 >= 0) | ||
698 | ACCESS_ONCE(y) = 1; ACCESS_ONCE(x) = 1; | ||
699 | |||
700 | assert(!(r1 == 1 && r2 == 1)); | ||
701 | |||
702 | The above two-CPU example will never trigger the assert(). However, | ||
703 | if control dependencies guaranteed transitivity (which they do not), | ||
704 | then adding the following two CPUs would guarantee a related assertion: | ||
705 | |||
706 | CPU 2 CPU 3 | ||
707 | ===================== ===================== | ||
708 | ACCESS_ONCE(x) = 2; ACCESS_ONCE(y) = 2; | ||
709 | |||
710 | assert(!(r1 == 2 && r2 == 2 && x == 1 && y == 1)); /* FAILS!!! */ | ||
711 | |||
712 | But because control dependencies do -not- provide transitivity, the | ||
713 | above assertion can fail after the combined four-CPU example completes. | ||
714 | If you need the four-CPU example to provide ordering, you will need | ||
715 | smp_mb() between the loads and stores in the CPU 0 and CPU 1 code fragments. | ||
716 | |||
717 | In summary: | ||
718 | |||
719 | (*) Control dependencies can order prior loads against later stores. | ||
720 | However, they do -not- guarantee any other sort of ordering: | ||
721 | Not prior loads against later loads, nor prior stores against | ||
722 | later anything. If you need these other forms of ordering, | ||
723 | use smb_rmb(), smp_wmb(), or, in the case of prior stores and | ||
724 | later loads, smp_mb(). | ||
725 | |||
726 | (*) Control dependencies require at least one run-time conditional | ||
727 | between the prior load and the subsequent store. If the compiler | ||
728 | is able to optimize the conditional away, it will have also | ||
729 | optimized away the ordering. Careful use of ACCESS_ONCE() can | ||
730 | help to preserve the needed conditional. | ||
731 | |||
732 | (*) Control dependencies require that the compiler avoid reordering the | ||
733 | dependency into nonexistence. Careful use of ACCESS_ONCE() or | ||
734 | barrier() can help to preserve your control dependency. Please | ||
735 | see the Compiler Barrier section for more information. | ||
736 | |||
737 | (*) Control dependencies do -not- provide transitivity. If you | ||
738 | need transitivity, use smp_mb(). | ||
551 | 739 | ||
552 | 740 | ||
553 | SMP BARRIER PAIRING | 741 | SMP BARRIER PAIRING |
@@ -561,23 +749,23 @@ barrier, though a general barrier would also be viable. Similarly a read | |||
561 | barrier or a data dependency barrier should always be paired with at least an | 749 | barrier or a data dependency barrier should always be paired with at least an |
562 | write barrier, though, again, a general barrier is viable: | 750 | write barrier, though, again, a general barrier is viable: |
563 | 751 | ||
564 | CPU 1 CPU 2 | 752 | CPU 1 CPU 2 |
565 | =============== =============== | 753 | =============== =============== |
566 | a = 1; | 754 | ACCESS_ONCE(a) = 1; |
567 | <write barrier> | 755 | <write barrier> |
568 | b = 2; x = b; | 756 | ACCESS_ONCE(b) = 2; x = ACCESS_ONCE(b); |
569 | <read barrier> | 757 | <read barrier> |
570 | y = a; | 758 | y = ACCESS_ONCE(a); |
571 | 759 | ||
572 | Or: | 760 | Or: |
573 | 761 | ||
574 | CPU 1 CPU 2 | 762 | CPU 1 CPU 2 |
575 | =============== =============================== | 763 | =============== =============================== |
576 | a = 1; | 764 | a = 1; |
577 | <write barrier> | 765 | <write barrier> |
578 | b = &a; x = b; | 766 | ACCESS_ONCE(b) = &a; x = ACCESS_ONCE(b); |
579 | <data dependency barrier> | 767 | <data dependency barrier> |
580 | y = *x; | 768 | y = *x; |
581 | 769 | ||
582 | Basically, the read barrier always has to be there, even though it can be of | 770 | Basically, the read barrier always has to be there, even though it can be of |
583 | the "weaker" type. | 771 | the "weaker" type. |
@@ -586,13 +774,13 @@ the "weaker" type. | |||
586 | match the loads after the read barrier or the data dependency barrier, and vice | 774 | match the loads after the read barrier or the data dependency barrier, and vice |
587 | versa: | 775 | versa: |
588 | 776 | ||
589 | CPU 1 CPU 2 | 777 | CPU 1 CPU 2 |
590 | =============== =============== | 778 | =================== =================== |
591 | a = 1; }---- --->{ v = c | 779 | ACCESS_ONCE(a) = 1; }---- --->{ v = ACCESS_ONCE(c); |
592 | b = 2; } \ / { w = d | 780 | ACCESS_ONCE(b) = 2; } \ / { w = ACCESS_ONCE(d); |
593 | <write barrier> \ <read barrier> | 781 | <write barrier> \ <read barrier> |
594 | c = 3; } / \ { x = a; | 782 | ACCESS_ONCE(c) = 3; } / \ { x = ACCESS_ONCE(a); |
595 | d = 4; }---- --->{ y = b; | 783 | ACCESS_ONCE(d) = 4; }---- --->{ y = ACCESS_ONCE(b); |
596 | 784 | ||
597 | 785 | ||
598 | EXAMPLES OF MEMORY BARRIER SEQUENCES | 786 | EXAMPLES OF MEMORY BARRIER SEQUENCES |
@@ -882,12 +1070,12 @@ cache it for later use. | |||
882 | 1070 | ||
883 | Consider: | 1071 | Consider: |
884 | 1072 | ||
885 | CPU 1 CPU 2 | 1073 | CPU 1 CPU 2 |
886 | ======================= ======================= | 1074 | ======================= ======================= |
887 | LOAD B | 1075 | LOAD B |
888 | DIVIDE } Divide instructions generally | 1076 | DIVIDE } Divide instructions generally |
889 | DIVIDE } take a long time to perform | 1077 | DIVIDE } take a long time to perform |
890 | LOAD A | 1078 | LOAD A |
891 | 1079 | ||
892 | Which might appear as this: | 1080 | Which might appear as this: |
893 | 1081 | ||
@@ -910,13 +1098,13 @@ Which might appear as this: | |||
910 | Placing a read barrier or a data dependency barrier just before the second | 1098 | Placing a read barrier or a data dependency barrier just before the second |
911 | load: | 1099 | load: |
912 | 1100 | ||
913 | CPU 1 CPU 2 | 1101 | CPU 1 CPU 2 |
914 | ======================= ======================= | 1102 | ======================= ======================= |
915 | LOAD B | 1103 | LOAD B |
916 | DIVIDE | 1104 | DIVIDE |
917 | DIVIDE | 1105 | DIVIDE |
918 | <read barrier> | 1106 | <read barrier> |
919 | LOAD A | 1107 | LOAD A |
920 | 1108 | ||
921 | will force any value speculatively obtained to be reconsidered to an extent | 1109 | will force any value speculatively obtained to be reconsidered to an extent |
922 | dependent on the type of barrier used. If there was no change made to the | 1110 | dependent on the type of barrier used. If there was no change made to the |
@@ -1042,10 +1230,277 @@ compiler from moving the memory accesses either side of it to the other side: | |||
1042 | 1230 | ||
1043 | barrier(); | 1231 | barrier(); |
1044 | 1232 | ||
1045 | This is a general barrier - lesser varieties of compiler barrier do not exist. | 1233 | This is a general barrier -- there are no read-read or write-write variants |
1234 | of barrier(). However, ACCESS_ONCE() can be thought of as a weak form | ||
1235 | for barrier() that affects only the specific accesses flagged by the | ||
1236 | ACCESS_ONCE(). | ||
1237 | |||
1238 | The barrier() function has the following effects: | ||
1239 | |||
1240 | (*) Prevents the compiler from reordering accesses following the | ||
1241 | barrier() to precede any accesses preceding the barrier(). | ||
1242 | One example use for this property is to ease communication between | ||
1243 | interrupt-handler code and the code that was interrupted. | ||
1244 | |||
1245 | (*) Within a loop, forces the compiler to load the variables used | ||
1246 | in that loop's conditional on each pass through that loop. | ||
1247 | |||
1248 | The ACCESS_ONCE() function can prevent any number of optimizations that, | ||
1249 | while perfectly safe in single-threaded code, can be fatal in concurrent | ||
1250 | code. Here are some examples of these sorts of optimizations: | ||
1251 | |||
1252 | (*) The compiler is within its rights to merge successive loads from | ||
1253 | the same variable. Such merging can cause the compiler to "optimize" | ||
1254 | the following code: | ||
1255 | |||
1256 | while (tmp = a) | ||
1257 | do_something_with(tmp); | ||
1258 | |||
1259 | into the following code, which, although in some sense legitimate | ||
1260 | for single-threaded code, is almost certainly not what the developer | ||
1261 | intended: | ||
1262 | |||
1263 | if (tmp = a) | ||
1264 | for (;;) | ||
1265 | do_something_with(tmp); | ||
1266 | |||
1267 | Use ACCESS_ONCE() to prevent the compiler from doing this to you: | ||
1268 | |||
1269 | while (tmp = ACCESS_ONCE(a)) | ||
1270 | do_something_with(tmp); | ||
1271 | |||
1272 | (*) The compiler is within its rights to reload a variable, for example, | ||
1273 | in cases where high register pressure prevents the compiler from | ||
1274 | keeping all data of interest in registers. The compiler might | ||
1275 | therefore optimize the variable 'tmp' out of our previous example: | ||
1276 | |||
1277 | while (tmp = a) | ||
1278 | do_something_with(tmp); | ||
1279 | |||
1280 | This could result in the following code, which is perfectly safe in | ||
1281 | single-threaded code, but can be fatal in concurrent code: | ||
1282 | |||
1283 | while (a) | ||
1284 | do_something_with(a); | ||
1285 | |||
1286 | For example, the optimized version of this code could result in | ||
1287 | passing a zero to do_something_with() in the case where the variable | ||
1288 | a was modified by some other CPU between the "while" statement and | ||
1289 | the call to do_something_with(). | ||
1290 | |||
1291 | Again, use ACCESS_ONCE() to prevent the compiler from doing this: | ||
1292 | |||
1293 | while (tmp = ACCESS_ONCE(a)) | ||
1294 | do_something_with(tmp); | ||
1295 | |||
1296 | Note that if the compiler runs short of registers, it might save | ||
1297 | tmp onto the stack. The overhead of this saving and later restoring | ||
1298 | is why compilers reload variables. Doing so is perfectly safe for | ||
1299 | single-threaded code, so you need to tell the compiler about cases | ||
1300 | where it is not safe. | ||
1301 | |||
1302 | (*) The compiler is within its rights to omit a load entirely if it knows | ||
1303 | what the value will be. For example, if the compiler can prove that | ||
1304 | the value of variable 'a' is always zero, it can optimize this code: | ||
1305 | |||
1306 | while (tmp = a) | ||
1307 | do_something_with(tmp); | ||
1046 | 1308 | ||
1047 | The compiler barrier has no direct effect on the CPU, which may then reorder | 1309 | Into this: |
1048 | things however it wishes. | 1310 | |
1311 | do { } while (0); | ||
1312 | |||
1313 | This transformation is a win for single-threaded code because it gets | ||
1314 | rid of a load and a branch. The problem is that the compiler will | ||
1315 | carry out its proof assuming that the current CPU is the only one | ||
1316 | updating variable 'a'. If variable 'a' is shared, then the compiler's | ||
1317 | proof will be erroneous. Use ACCESS_ONCE() to tell the compiler | ||
1318 | that it doesn't know as much as it thinks it does: | ||
1319 | |||
1320 | while (tmp = ACCESS_ONCE(a)) | ||
1321 | do_something_with(tmp); | ||
1322 | |||
1323 | But please note that the compiler is also closely watching what you | ||
1324 | do with the value after the ACCESS_ONCE(). For example, suppose you | ||
1325 | do the following and MAX is a preprocessor macro with the value 1: | ||
1326 | |||
1327 | while ((tmp = ACCESS_ONCE(a)) % MAX) | ||
1328 | do_something_with(tmp); | ||
1329 | |||
1330 | Then the compiler knows that the result of the "%" operator applied | ||
1331 | to MAX will always be zero, again allowing the compiler to optimize | ||
1332 | the code into near-nonexistence. (It will still load from the | ||
1333 | variable 'a'.) | ||
1334 | |||
1335 | (*) Similarly, the compiler is within its rights to omit a store entirely | ||
1336 | if it knows that the variable already has the value being stored. | ||
1337 | Again, the compiler assumes that the current CPU is the only one | ||
1338 | storing into the variable, which can cause the compiler to do the | ||
1339 | wrong thing for shared variables. For example, suppose you have | ||
1340 | the following: | ||
1341 | |||
1342 | a = 0; | ||
1343 | /* Code that does not store to variable a. */ | ||
1344 | a = 0; | ||
1345 | |||
1346 | The compiler sees that the value of variable 'a' is already zero, so | ||
1347 | it might well omit the second store. This would come as a fatal | ||
1348 | surprise if some other CPU might have stored to variable 'a' in the | ||
1349 | meantime. | ||
1350 | |||
1351 | Use ACCESS_ONCE() to prevent the compiler from making this sort of | ||
1352 | wrong guess: | ||
1353 | |||
1354 | ACCESS_ONCE(a) = 0; | ||
1355 | /* Code that does not store to variable a. */ | ||
1356 | ACCESS_ONCE(a) = 0; | ||
1357 | |||
1358 | (*) The compiler is within its rights to reorder memory accesses unless | ||
1359 | you tell it not to. For example, consider the following interaction | ||
1360 | between process-level code and an interrupt handler: | ||
1361 | |||
1362 | void process_level(void) | ||
1363 | { | ||
1364 | msg = get_message(); | ||
1365 | flag = true; | ||
1366 | } | ||
1367 | |||
1368 | void interrupt_handler(void) | ||
1369 | { | ||
1370 | if (flag) | ||
1371 | process_message(msg); | ||
1372 | } | ||
1373 | |||
1374 | There is nothing to prevent the the compiler from transforming | ||
1375 | process_level() to the following, in fact, this might well be a | ||
1376 | win for single-threaded code: | ||
1377 | |||
1378 | void process_level(void) | ||
1379 | { | ||
1380 | flag = true; | ||
1381 | msg = get_message(); | ||
1382 | } | ||
1383 | |||
1384 | If the interrupt occurs between these two statement, then | ||
1385 | interrupt_handler() might be passed a garbled msg. Use ACCESS_ONCE() | ||
1386 | to prevent this as follows: | ||
1387 | |||
1388 | void process_level(void) | ||
1389 | { | ||
1390 | ACCESS_ONCE(msg) = get_message(); | ||
1391 | ACCESS_ONCE(flag) = true; | ||
1392 | } | ||
1393 | |||
1394 | void interrupt_handler(void) | ||
1395 | { | ||
1396 | if (ACCESS_ONCE(flag)) | ||
1397 | process_message(ACCESS_ONCE(msg)); | ||
1398 | } | ||
1399 | |||
1400 | Note that the ACCESS_ONCE() wrappers in interrupt_handler() | ||
1401 | are needed if this interrupt handler can itself be interrupted | ||
1402 | by something that also accesses 'flag' and 'msg', for example, | ||
1403 | a nested interrupt or an NMI. Otherwise, ACCESS_ONCE() is not | ||
1404 | needed in interrupt_handler() other than for documentation purposes. | ||
1405 | (Note also that nested interrupts do not typically occur in modern | ||
1406 | Linux kernels, in fact, if an interrupt handler returns with | ||
1407 | interrupts enabled, you will get a WARN_ONCE() splat.) | ||
1408 | |||
1409 | You should assume that the compiler can move ACCESS_ONCE() past | ||
1410 | code not containing ACCESS_ONCE(), barrier(), or similar primitives. | ||
1411 | |||
1412 | This effect could also be achieved using barrier(), but ACCESS_ONCE() | ||
1413 | is more selective: With ACCESS_ONCE(), the compiler need only forget | ||
1414 | the contents of the indicated memory locations, while with barrier() | ||
1415 | the compiler must discard the value of all memory locations that | ||
1416 | it has currented cached in any machine registers. Of course, | ||
1417 | the compiler must also respect the order in which the ACCESS_ONCE()s | ||
1418 | occur, though the CPU of course need not do so. | ||
1419 | |||
1420 | (*) The compiler is within its rights to invent stores to a variable, | ||
1421 | as in the following example: | ||
1422 | |||
1423 | if (a) | ||
1424 | b = a; | ||
1425 | else | ||
1426 | b = 42; | ||
1427 | |||
1428 | The compiler might save a branch by optimizing this as follows: | ||
1429 | |||
1430 | b = 42; | ||
1431 | if (a) | ||
1432 | b = a; | ||
1433 | |||
1434 | In single-threaded code, this is not only safe, but also saves | ||
1435 | a branch. Unfortunately, in concurrent code, this optimization | ||
1436 | could cause some other CPU to see a spurious value of 42 -- even | ||
1437 | if variable 'a' was never zero -- when loading variable 'b'. | ||
1438 | Use ACCESS_ONCE() to prevent this as follows: | ||
1439 | |||
1440 | if (a) | ||
1441 | ACCESS_ONCE(b) = a; | ||
1442 | else | ||
1443 | ACCESS_ONCE(b) = 42; | ||
1444 | |||
1445 | The compiler can also invent loads. These are usually less | ||
1446 | damaging, but they can result in cache-line bouncing and thus in | ||
1447 | poor performance and scalability. Use ACCESS_ONCE() to prevent | ||
1448 | invented loads. | ||
1449 | |||
1450 | (*) For aligned memory locations whose size allows them to be accessed | ||
1451 | with a single memory-reference instruction, prevents "load tearing" | ||
1452 | and "store tearing," in which a single large access is replaced by | ||
1453 | multiple smaller accesses. For example, given an architecture having | ||
1454 | 16-bit store instructions with 7-bit immediate fields, the compiler | ||
1455 | might be tempted to use two 16-bit store-immediate instructions to | ||
1456 | implement the following 32-bit store: | ||
1457 | |||
1458 | p = 0x00010002; | ||
1459 | |||
1460 | Please note that GCC really does use this sort of optimization, | ||
1461 | which is not surprising given that it would likely take more | ||
1462 | than two instructions to build the constant and then store it. | ||
1463 | This optimization can therefore be a win in single-threaded code. | ||
1464 | In fact, a recent bug (since fixed) caused GCC to incorrectly use | ||
1465 | this optimization in a volatile store. In the absence of such bugs, | ||
1466 | use of ACCESS_ONCE() prevents store tearing in the following example: | ||
1467 | |||
1468 | ACCESS_ONCE(p) = 0x00010002; | ||
1469 | |||
1470 | Use of packed structures can also result in load and store tearing, | ||
1471 | as in this example: | ||
1472 | |||
1473 | struct __attribute__((__packed__)) foo { | ||
1474 | short a; | ||
1475 | int b; | ||
1476 | short c; | ||
1477 | }; | ||
1478 | struct foo foo1, foo2; | ||
1479 | ... | ||
1480 | |||
1481 | foo2.a = foo1.a; | ||
1482 | foo2.b = foo1.b; | ||
1483 | foo2.c = foo1.c; | ||
1484 | |||
1485 | Because there are no ACCESS_ONCE() wrappers and no volatile markings, | ||
1486 | the compiler would be well within its rights to implement these three | ||
1487 | assignment statements as a pair of 32-bit loads followed by a pair | ||
1488 | of 32-bit stores. This would result in load tearing on 'foo1.b' | ||
1489 | and store tearing on 'foo2.b'. ACCESS_ONCE() again prevents tearing | ||
1490 | in this example: | ||
1491 | |||
1492 | foo2.a = foo1.a; | ||
1493 | ACCESS_ONCE(foo2.b) = ACCESS_ONCE(foo1.b); | ||
1494 | foo2.c = foo1.c; | ||
1495 | |||
1496 | All that aside, it is never necessary to use ACCESS_ONCE() on a variable | ||
1497 | that has been marked volatile. For example, because 'jiffies' is marked | ||
1498 | volatile, it is never necessary to say ACCESS_ONCE(jiffies). The reason | ||
1499 | for this is that ACCESS_ONCE() is implemented as a volatile cast, which | ||
1500 | has no effect when its argument is already marked volatile. | ||
1501 | |||
1502 | Please note that these compiler barriers have no direct effect on the CPU, | ||
1503 | which may then reorder things however it wishes. | ||
1049 | 1504 | ||
1050 | 1505 | ||
1051 | CPU MEMORY BARRIERS | 1506 | CPU MEMORY BARRIERS |
@@ -1135,7 +1590,7 @@ There are some more advanced barrier functions: | |||
1135 | clear_bit( ... ); | 1590 | clear_bit( ... ); |
1136 | 1591 | ||
1137 | This prevents memory operations before the clear leaking to after it. See | 1592 | This prevents memory operations before the clear leaking to after it. See |
1138 | the subsection on "Locking Functions" with reference to UNLOCK operation | 1593 | the subsection on "Locking Functions" with reference to RELEASE operation |
1139 | implications. | 1594 | implications. |
1140 | 1595 | ||
1141 | See Documentation/atomic_ops.txt for more information. See the "Atomic | 1596 | See Documentation/atomic_ops.txt for more information. See the "Atomic |
@@ -1169,8 +1624,8 @@ provide more substantial guarantees, but these may not be relied upon outside | |||
1169 | of arch specific code. | 1624 | of arch specific code. |
1170 | 1625 | ||
1171 | 1626 | ||
1172 | LOCKING FUNCTIONS | 1627 | ACQUIRING FUNCTIONS |
1173 | ----------------- | 1628 | ------------------- |
1174 | 1629 | ||
1175 | The Linux kernel has a number of locking constructs: | 1630 | The Linux kernel has a number of locking constructs: |
1176 | 1631 | ||
@@ -1181,65 +1636,107 @@ The Linux kernel has a number of locking constructs: | |||
1181 | (*) R/W semaphores | 1636 | (*) R/W semaphores |
1182 | (*) RCU | 1637 | (*) RCU |
1183 | 1638 | ||
1184 | In all cases there are variants on "LOCK" operations and "UNLOCK" operations | 1639 | In all cases there are variants on "ACQUIRE" operations and "RELEASE" operations |
1185 | for each construct. These operations all imply certain barriers: | 1640 | for each construct. These operations all imply certain barriers: |
1186 | 1641 | ||
1187 | (1) LOCK operation implication: | 1642 | (1) ACQUIRE operation implication: |
1188 | 1643 | ||
1189 | Memory operations issued after the LOCK will be completed after the LOCK | 1644 | Memory operations issued after the ACQUIRE will be completed after the |
1190 | operation has completed. | 1645 | ACQUIRE operation has completed. |
1191 | 1646 | ||
1192 | Memory operations issued before the LOCK may be completed after the LOCK | 1647 | Memory operations issued before the ACQUIRE may be completed after the |
1193 | operation has completed. | 1648 | ACQUIRE operation has completed. An smp_mb__before_spinlock(), combined |
1649 | with a following ACQUIRE, orders prior loads against subsequent stores and | ||
1650 | stores and prior stores against subsequent stores. Note that this is | ||
1651 | weaker than smp_mb()! The smp_mb__before_spinlock() primitive is free on | ||
1652 | many architectures. | ||
1194 | 1653 | ||
1195 | (2) UNLOCK operation implication: | 1654 | (2) RELEASE operation implication: |
1196 | 1655 | ||
1197 | Memory operations issued before the UNLOCK will be completed before the | 1656 | Memory operations issued before the RELEASE will be completed before the |
1198 | UNLOCK operation has completed. | 1657 | RELEASE operation has completed. |
1199 | 1658 | ||
1200 | Memory operations issued after the UNLOCK may be completed before the | 1659 | Memory operations issued after the RELEASE may be completed before the |
1201 | UNLOCK operation has completed. | 1660 | RELEASE operation has completed. |
1202 | 1661 | ||
1203 | (3) LOCK vs LOCK implication: | 1662 | (3) ACQUIRE vs ACQUIRE implication: |
1204 | 1663 | ||
1205 | All LOCK operations issued before another LOCK operation will be completed | 1664 | All ACQUIRE operations issued before another ACQUIRE operation will be |
1206 | before that LOCK operation. | 1665 | completed before that ACQUIRE operation. |
1207 | 1666 | ||
1208 | (4) LOCK vs UNLOCK implication: | 1667 | (4) ACQUIRE vs RELEASE implication: |
1209 | 1668 | ||
1210 | All LOCK operations issued before an UNLOCK operation will be completed | 1669 | All ACQUIRE operations issued before a RELEASE operation will be |
1211 | before the UNLOCK operation. | 1670 | completed before the RELEASE operation. |
1212 | 1671 | ||
1213 | All UNLOCK operations issued before a LOCK operation will be completed | 1672 | (5) Failed conditional ACQUIRE implication: |
1214 | before the LOCK operation. | ||
1215 | 1673 | ||
1216 | (5) Failed conditional LOCK implication: | 1674 | Certain locking variants of the ACQUIRE operation may fail, either due to |
1217 | 1675 | being unable to get the lock immediately, or due to receiving an unblocked | |
1218 | Certain variants of the LOCK operation may fail, either due to being | ||
1219 | unable to get the lock immediately, or due to receiving an unblocked | ||
1220 | signal whilst asleep waiting for the lock to become available. Failed | 1676 | signal whilst asleep waiting for the lock to become available. Failed |
1221 | locks do not imply any sort of barrier. | 1677 | locks do not imply any sort of barrier. |
1222 | 1678 | ||
1223 | Therefore, from (1), (2) and (4) an UNLOCK followed by an unconditional LOCK is | 1679 | [!] Note: one of the consequences of lock ACQUIREs and RELEASEs being only |
1224 | equivalent to a full barrier, but a LOCK followed by an UNLOCK is not. | 1680 | one-way barriers is that the effects of instructions outside of a critical |
1225 | 1681 | section may seep into the inside of the critical section. | |
1226 | [!] Note: one of the consequences of LOCKs and UNLOCKs being only one-way | ||
1227 | barriers is that the effects of instructions outside of a critical section | ||
1228 | may seep into the inside of the critical section. | ||
1229 | 1682 | ||
1230 | A LOCK followed by an UNLOCK may not be assumed to be full memory barrier | 1683 | An ACQUIRE followed by a RELEASE may not be assumed to be full memory barrier |
1231 | because it is possible for an access preceding the LOCK to happen after the | 1684 | because it is possible for an access preceding the ACQUIRE to happen after the |
1232 | LOCK, and an access following the UNLOCK to happen before the UNLOCK, and the | 1685 | ACQUIRE, and an access following the RELEASE to happen before the RELEASE, and |
1233 | two accesses can themselves then cross: | 1686 | the two accesses can themselves then cross: |
1234 | 1687 | ||
1235 | *A = a; | 1688 | *A = a; |
1236 | LOCK | 1689 | ACQUIRE M |
1237 | UNLOCK | 1690 | RELEASE M |
1238 | *B = b; | 1691 | *B = b; |
1239 | 1692 | ||
1240 | may occur as: | 1693 | may occur as: |
1241 | 1694 | ||
1242 | LOCK, STORE *B, STORE *A, UNLOCK | 1695 | ACQUIRE M, STORE *B, STORE *A, RELEASE M |
1696 | |||
1697 | This same reordering can of course occur if the lock's ACQUIRE and RELEASE are | ||
1698 | to the same lock variable, but only from the perspective of another CPU not | ||
1699 | holding that lock. | ||
1700 | |||
1701 | In short, a RELEASE followed by an ACQUIRE may -not- be assumed to be a full | ||
1702 | memory barrier because it is possible for a preceding RELEASE to pass a | ||
1703 | later ACQUIRE from the viewpoint of the CPU, but not from the viewpoint | ||
1704 | of the compiler. Note that deadlocks cannot be introduced by this | ||
1705 | interchange because if such a deadlock threatened, the RELEASE would | ||
1706 | simply complete. | ||
1707 | |||
1708 | If it is necessary for a RELEASE-ACQUIRE pair to produce a full barrier, the | ||
1709 | ACQUIRE can be followed by an smp_mb__after_unlock_lock() invocation. This | ||
1710 | will produce a full barrier if either (a) the RELEASE and the ACQUIRE are | ||
1711 | executed by the same CPU or task, or (b) the RELEASE and ACQUIRE act on the | ||
1712 | same variable. The smp_mb__after_unlock_lock() primitive is free on many | ||
1713 | architectures. Without smp_mb__after_unlock_lock(), the critical sections | ||
1714 | corresponding to the RELEASE and the ACQUIRE can cross: | ||
1715 | |||
1716 | *A = a; | ||
1717 | RELEASE M | ||
1718 | ACQUIRE N | ||
1719 | *B = b; | ||
1720 | |||
1721 | could occur as: | ||
1722 | |||
1723 | ACQUIRE N, STORE *B, STORE *A, RELEASE M | ||
1724 | |||
1725 | With smp_mb__after_unlock_lock(), they cannot, so that: | ||
1726 | |||
1727 | *A = a; | ||
1728 | RELEASE M | ||
1729 | ACQUIRE N | ||
1730 | smp_mb__after_unlock_lock(); | ||
1731 | *B = b; | ||
1732 | |||
1733 | will always occur as either of the following: | ||
1734 | |||
1735 | STORE *A, RELEASE, ACQUIRE, STORE *B | ||
1736 | STORE *A, ACQUIRE, RELEASE, STORE *B | ||
1737 | |||
1738 | If the RELEASE and ACQUIRE were instead both operating on the same lock | ||
1739 | variable, only the first of these two alternatives can occur. | ||
1243 | 1740 | ||
1244 | Locks and semaphores may not provide any guarantee of ordering on UP compiled | 1741 | Locks and semaphores may not provide any guarantee of ordering on UP compiled |
1245 | systems, and so cannot be counted on in such a situation to actually achieve | 1742 | systems, and so cannot be counted on in such a situation to actually achieve |
@@ -1253,33 +1750,33 @@ As an example, consider the following: | |||
1253 | 1750 | ||
1254 | *A = a; | 1751 | *A = a; |
1255 | *B = b; | 1752 | *B = b; |
1256 | LOCK | 1753 | ACQUIRE |
1257 | *C = c; | 1754 | *C = c; |
1258 | *D = d; | 1755 | *D = d; |
1259 | UNLOCK | 1756 | RELEASE |
1260 | *E = e; | 1757 | *E = e; |
1261 | *F = f; | 1758 | *F = f; |
1262 | 1759 | ||
1263 | The following sequence of events is acceptable: | 1760 | The following sequence of events is acceptable: |
1264 | 1761 | ||
1265 | LOCK, {*F,*A}, *E, {*C,*D}, *B, UNLOCK | 1762 | ACQUIRE, {*F,*A}, *E, {*C,*D}, *B, RELEASE |
1266 | 1763 | ||
1267 | [+] Note that {*F,*A} indicates a combined access. | 1764 | [+] Note that {*F,*A} indicates a combined access. |
1268 | 1765 | ||
1269 | But none of the following are: | 1766 | But none of the following are: |
1270 | 1767 | ||
1271 | {*F,*A}, *B, LOCK, *C, *D, UNLOCK, *E | 1768 | {*F,*A}, *B, ACQUIRE, *C, *D, RELEASE, *E |
1272 | *A, *B, *C, LOCK, *D, UNLOCK, *E, *F | 1769 | *A, *B, *C, ACQUIRE, *D, RELEASE, *E, *F |
1273 | *A, *B, LOCK, *C, UNLOCK, *D, *E, *F | 1770 | *A, *B, ACQUIRE, *C, RELEASE, *D, *E, *F |
1274 | *B, LOCK, *C, *D, UNLOCK, {*F,*A}, *E | 1771 | *B, ACQUIRE, *C, *D, RELEASE, {*F,*A}, *E |
1275 | 1772 | ||
1276 | 1773 | ||
1277 | 1774 | ||
1278 | INTERRUPT DISABLING FUNCTIONS | 1775 | INTERRUPT DISABLING FUNCTIONS |
1279 | ----------------------------- | 1776 | ----------------------------- |
1280 | 1777 | ||
1281 | Functions that disable interrupts (LOCK equivalent) and enable interrupts | 1778 | Functions that disable interrupts (ACQUIRE equivalent) and enable interrupts |
1282 | (UNLOCK equivalent) will act as compiler barriers only. So if memory or I/O | 1779 | (RELEASE equivalent) will act as compiler barriers only. So if memory or I/O |
1283 | barriers are required in such a situation, they must be provided from some | 1780 | barriers are required in such a situation, they must be provided from some |
1284 | other means. | 1781 | other means. |
1285 | 1782 | ||
@@ -1418,75 +1915,81 @@ Other functions that imply barriers: | |||
1418 | (*) schedule() and similar imply full memory barriers. | 1915 | (*) schedule() and similar imply full memory barriers. |
1419 | 1916 | ||
1420 | 1917 | ||
1421 | ================================= | 1918 | =================================== |
1422 | INTER-CPU LOCKING BARRIER EFFECTS | 1919 | INTER-CPU ACQUIRING BARRIER EFFECTS |
1423 | ================================= | 1920 | =================================== |
1424 | 1921 | ||
1425 | On SMP systems locking primitives give a more substantial form of barrier: one | 1922 | On SMP systems locking primitives give a more substantial form of barrier: one |
1426 | that does affect memory access ordering on other CPUs, within the context of | 1923 | that does affect memory access ordering on other CPUs, within the context of |
1427 | conflict on any particular lock. | 1924 | conflict on any particular lock. |
1428 | 1925 | ||
1429 | 1926 | ||
1430 | LOCKS VS MEMORY ACCESSES | 1927 | ACQUIRES VS MEMORY ACCESSES |
1431 | ------------------------ | 1928 | --------------------------- |
1432 | 1929 | ||
1433 | Consider the following: the system has a pair of spinlocks (M) and (Q), and | 1930 | Consider the following: the system has a pair of spinlocks (M) and (Q), and |
1434 | three CPUs; then should the following sequence of events occur: | 1931 | three CPUs; then should the following sequence of events occur: |
1435 | 1932 | ||
1436 | CPU 1 CPU 2 | 1933 | CPU 1 CPU 2 |
1437 | =============================== =============================== | 1934 | =============================== =============================== |
1438 | *A = a; *E = e; | 1935 | ACCESS_ONCE(*A) = a; ACCESS_ONCE(*E) = e; |
1439 | LOCK M LOCK Q | 1936 | ACQUIRE M ACQUIRE Q |
1440 | *B = b; *F = f; | 1937 | ACCESS_ONCE(*B) = b; ACCESS_ONCE(*F) = f; |
1441 | *C = c; *G = g; | 1938 | ACCESS_ONCE(*C) = c; ACCESS_ONCE(*G) = g; |
1442 | UNLOCK M UNLOCK Q | 1939 | RELEASE M RELEASE Q |
1443 | *D = d; *H = h; | 1940 | ACCESS_ONCE(*D) = d; ACCESS_ONCE(*H) = h; |
1444 | 1941 | ||
1445 | Then there is no guarantee as to what order CPU 3 will see the accesses to *A | 1942 | Then there is no guarantee as to what order CPU 3 will see the accesses to *A |
1446 | through *H occur in, other than the constraints imposed by the separate locks | 1943 | through *H occur in, other than the constraints imposed by the separate locks |
1447 | on the separate CPUs. It might, for example, see: | 1944 | on the separate CPUs. It might, for example, see: |
1448 | 1945 | ||
1449 | *E, LOCK M, LOCK Q, *G, *C, *F, *A, *B, UNLOCK Q, *D, *H, UNLOCK M | 1946 | *E, ACQUIRE M, ACQUIRE Q, *G, *C, *F, *A, *B, RELEASE Q, *D, *H, RELEASE M |
1450 | 1947 | ||
1451 | But it won't see any of: | 1948 | But it won't see any of: |
1452 | 1949 | ||
1453 | *B, *C or *D preceding LOCK M | 1950 | *B, *C or *D preceding ACQUIRE M |
1454 | *A, *B or *C following UNLOCK M | 1951 | *A, *B or *C following RELEASE M |
1455 | *F, *G or *H preceding LOCK Q | 1952 | *F, *G or *H preceding ACQUIRE Q |
1456 | *E, *F or *G following UNLOCK Q | 1953 | *E, *F or *G following RELEASE Q |
1457 | 1954 | ||
1458 | 1955 | ||
1459 | However, if the following occurs: | 1956 | However, if the following occurs: |
1460 | 1957 | ||
1461 | CPU 1 CPU 2 | 1958 | CPU 1 CPU 2 |
1462 | =============================== =============================== | 1959 | =============================== =============================== |
1463 | *A = a; | 1960 | ACCESS_ONCE(*A) = a; |
1464 | LOCK M [1] | 1961 | ACQUIRE M [1] |
1465 | *B = b; | 1962 | ACCESS_ONCE(*B) = b; |
1466 | *C = c; | 1963 | ACCESS_ONCE(*C) = c; |
1467 | UNLOCK M [1] | 1964 | RELEASE M [1] |
1468 | *D = d; *E = e; | 1965 | ACCESS_ONCE(*D) = d; ACCESS_ONCE(*E) = e; |
1469 | LOCK M [2] | 1966 | ACQUIRE M [2] |
1470 | *F = f; | 1967 | smp_mb__after_unlock_lock(); |
1471 | *G = g; | 1968 | ACCESS_ONCE(*F) = f; |
1472 | UNLOCK M [2] | 1969 | ACCESS_ONCE(*G) = g; |
1473 | *H = h; | 1970 | RELEASE M [2] |
1971 | ACCESS_ONCE(*H) = h; | ||
1474 | 1972 | ||
1475 | CPU 3 might see: | 1973 | CPU 3 might see: |
1476 | 1974 | ||
1477 | *E, LOCK M [1], *C, *B, *A, UNLOCK M [1], | 1975 | *E, ACQUIRE M [1], *C, *B, *A, RELEASE M [1], |
1478 | LOCK M [2], *H, *F, *G, UNLOCK M [2], *D | 1976 | ACQUIRE M [2], *H, *F, *G, RELEASE M [2], *D |
1479 | 1977 | ||
1480 | But assuming CPU 1 gets the lock first, CPU 3 won't see any of: | 1978 | But assuming CPU 1 gets the lock first, CPU 3 won't see any of: |
1481 | 1979 | ||
1482 | *B, *C, *D, *F, *G or *H preceding LOCK M [1] | 1980 | *B, *C, *D, *F, *G or *H preceding ACQUIRE M [1] |
1483 | *A, *B or *C following UNLOCK M [1] | 1981 | *A, *B or *C following RELEASE M [1] |
1484 | *F, *G or *H preceding LOCK M [2] | 1982 | *F, *G or *H preceding ACQUIRE M [2] |
1485 | *A, *B, *C, *E, *F or *G following UNLOCK M [2] | 1983 | *A, *B, *C, *E, *F or *G following RELEASE M [2] |
1486 | 1984 | ||
1985 | Note that the smp_mb__after_unlock_lock() is critically important | ||
1986 | here: Without it CPU 3 might see some of the above orderings. | ||
1987 | Without smp_mb__after_unlock_lock(), the accesses are not guaranteed | ||
1988 | to be seen in order unless CPU 3 holds lock M. | ||
1487 | 1989 | ||
1488 | LOCKS VS I/O ACCESSES | 1990 | |
1489 | --------------------- | 1991 | ACQUIRES VS I/O ACCESSES |
1992 | ------------------------ | ||
1490 | 1993 | ||
1491 | Under certain circumstances (especially involving NUMA), I/O accesses within | 1994 | Under certain circumstances (especially involving NUMA), I/O accesses within |
1492 | two spinlocked sections on two different CPUs may be seen as interleaved by the | 1995 | two spinlocked sections on two different CPUs may be seen as interleaved by the |
@@ -1687,28 +2190,30 @@ explicit lock operations, described later). These include: | |||
1687 | 2190 | ||
1688 | xchg(); | 2191 | xchg(); |
1689 | cmpxchg(); | 2192 | cmpxchg(); |
1690 | atomic_xchg(); | 2193 | atomic_xchg(); atomic_long_xchg(); |
1691 | atomic_cmpxchg(); | 2194 | atomic_cmpxchg(); atomic_long_cmpxchg(); |
1692 | atomic_inc_return(); | 2195 | atomic_inc_return(); atomic_long_inc_return(); |
1693 | atomic_dec_return(); | 2196 | atomic_dec_return(); atomic_long_dec_return(); |
1694 | atomic_add_return(); | 2197 | atomic_add_return(); atomic_long_add_return(); |
1695 | atomic_sub_return(); | 2198 | atomic_sub_return(); atomic_long_sub_return(); |
1696 | atomic_inc_and_test(); | 2199 | atomic_inc_and_test(); atomic_long_inc_and_test(); |
1697 | atomic_dec_and_test(); | 2200 | atomic_dec_and_test(); atomic_long_dec_and_test(); |
1698 | atomic_sub_and_test(); | 2201 | atomic_sub_and_test(); atomic_long_sub_and_test(); |
1699 | atomic_add_negative(); | 2202 | atomic_add_negative(); atomic_long_add_negative(); |
1700 | atomic_add_unless(); /* when succeeds (returns 1) */ | ||
1701 | test_and_set_bit(); | 2203 | test_and_set_bit(); |
1702 | test_and_clear_bit(); | 2204 | test_and_clear_bit(); |
1703 | test_and_change_bit(); | 2205 | test_and_change_bit(); |
1704 | 2206 | ||
1705 | These are used for such things as implementing LOCK-class and UNLOCK-class | 2207 | /* when succeeds (returns 1) */ |
2208 | atomic_add_unless(); atomic_long_add_unless(); | ||
2209 | |||
2210 | These are used for such things as implementing ACQUIRE-class and RELEASE-class | ||
1706 | operations and adjusting reference counters towards object destruction, and as | 2211 | operations and adjusting reference counters towards object destruction, and as |
1707 | such the implicit memory barrier effects are necessary. | 2212 | such the implicit memory barrier effects are necessary. |
1708 | 2213 | ||
1709 | 2214 | ||
1710 | The following operations are potential problems as they do _not_ imply memory | 2215 | The following operations are potential problems as they do _not_ imply memory |
1711 | barriers, but might be used for implementing such things as UNLOCK-class | 2216 | barriers, but might be used for implementing such things as RELEASE-class |
1712 | operations: | 2217 | operations: |
1713 | 2218 | ||
1714 | atomic_set(); | 2219 | atomic_set(); |
@@ -1750,7 +2255,7 @@ The following operations are special locking primitives: | |||
1750 | clear_bit_unlock(); | 2255 | clear_bit_unlock(); |
1751 | __clear_bit_unlock(); | 2256 | __clear_bit_unlock(); |
1752 | 2257 | ||
1753 | These implement LOCK-class and UNLOCK-class operations. These should be used in | 2258 | These implement ACQUIRE-class and RELEASE-class operations. These should be used in |
1754 | preference to other operations when implementing locking primitives, because | 2259 | preference to other operations when implementing locking primitives, because |
1755 | their implementations can be optimised on many architectures. | 2260 | their implementations can be optimised on many architectures. |
1756 | 2261 | ||
@@ -1887,8 +2392,8 @@ functions: | |||
1887 | space should suffice for PCI. | 2392 | space should suffice for PCI. |
1888 | 2393 | ||
1889 | [*] NOTE! attempting to load from the same location as was written to may | 2394 | [*] NOTE! attempting to load from the same location as was written to may |
1890 | cause a malfunction - consider the 16550 Rx/Tx serial registers for | 2395 | cause a malfunction - consider the 16550 Rx/Tx serial registers for |
1891 | example. | 2396 | example. |
1892 | 2397 | ||
1893 | Used with prefetchable I/O memory, an mmiowb() barrier may be required to | 2398 | Used with prefetchable I/O memory, an mmiowb() barrier may be required to |
1894 | force stores to be ordered. | 2399 | force stores to be ordered. |
@@ -1955,19 +2460,19 @@ barriers for the most part act at the interface between the CPU and its cache | |||
1955 | : | 2460 | : |
1956 | +--------+ +--------+ : +--------+ +-----------+ | 2461 | +--------+ +--------+ : +--------+ +-----------+ |
1957 | | | | | : | | | | +--------+ | 2462 | | | | | : | | | | +--------+ |
1958 | | CPU | | Memory | : | CPU | | | | | | 2463 | | CPU | | Memory | : | CPU | | | | | |
1959 | | Core |--->| Access |----->| Cache |<-->| | | | | 2464 | | Core |--->| Access |----->| Cache |<-->| | | | |
1960 | | | | Queue | : | | | |--->| Memory | | 2465 | | | | Queue | : | | | |--->| Memory | |
1961 | | | | | : | | | | | | | 2466 | | | | | : | | | | | | |
1962 | +--------+ +--------+ : +--------+ | | | | | 2467 | +--------+ +--------+ : +--------+ | | | | |
1963 | : | Cache | +--------+ | 2468 | : | Cache | +--------+ |
1964 | : | Coherency | | 2469 | : | Coherency | |
1965 | : | Mechanism | +--------+ | 2470 | : | Mechanism | +--------+ |
1966 | +--------+ +--------+ : +--------+ | | | | | 2471 | +--------+ +--------+ : +--------+ | | | | |
1967 | | | | | : | | | | | | | 2472 | | | | | : | | | | | | |
1968 | | CPU | | Memory | : | CPU | | |--->| Device | | 2473 | | CPU | | Memory | : | CPU | | |--->| Device | |
1969 | | Core |--->| Access |----->| Cache |<-->| | | | | 2474 | | Core |--->| Access |----->| Cache |<-->| | | | |
1970 | | | | Queue | : | | | | | | | 2475 | | | | Queue | : | | | | | | |
1971 | | | | | : | | | | +--------+ | 2476 | | | | | : | | | | +--------+ |
1972 | +--------+ +--------+ : +--------+ +-----------+ | 2477 | +--------+ +--------+ : +--------+ +-----------+ |
1973 | : | 2478 | : |
@@ -2090,7 +2595,7 @@ CPU's caches by some other cache event: | |||
2090 | p = &v; q = p; | 2595 | p = &v; q = p; |
2091 | <D:request p> | 2596 | <D:request p> |
2092 | <B:modify p=&v> <D:commit p=&v> | 2597 | <B:modify p=&v> <D:commit p=&v> |
2093 | <D:read p> | 2598 | <D:read p> |
2094 | x = *q; | 2599 | x = *q; |
2095 | <C:read *q> Reads from v before v updated in cache | 2600 | <C:read *q> Reads from v before v updated in cache |
2096 | <C:unbusy> | 2601 | <C:unbusy> |
@@ -2115,7 +2620,7 @@ queue before processing any further requests: | |||
2115 | p = &v; q = p; | 2620 | p = &v; q = p; |
2116 | <D:request p> | 2621 | <D:request p> |
2117 | <B:modify p=&v> <D:commit p=&v> | 2622 | <B:modify p=&v> <D:commit p=&v> |
2118 | <D:read p> | 2623 | <D:read p> |
2119 | smp_read_barrier_depends() | 2624 | smp_read_barrier_depends() |
2120 | <C:unbusy> | 2625 | <C:unbusy> |
2121 | <C:commit v=2> | 2626 | <C:commit v=2> |
@@ -2177,11 +2682,11 @@ A programmer might take it for granted that the CPU will perform memory | |||
2177 | operations in exactly the order specified, so that if the CPU is, for example, | 2682 | operations in exactly the order specified, so that if the CPU is, for example, |
2178 | given the following piece of code to execute: | 2683 | given the following piece of code to execute: |
2179 | 2684 | ||
2180 | a = *A; | 2685 | a = ACCESS_ONCE(*A); |
2181 | *B = b; | 2686 | ACCESS_ONCE(*B) = b; |
2182 | c = *C; | 2687 | c = ACCESS_ONCE(*C); |
2183 | d = *D; | 2688 | d = ACCESS_ONCE(*D); |
2184 | *E = e; | 2689 | ACCESS_ONCE(*E) = e; |
2185 | 2690 | ||
2186 | they would then expect that the CPU will complete the memory operation for each | 2691 | they would then expect that the CPU will complete the memory operation for each |
2187 | instruction before moving on to the next one, leading to a definite sequence of | 2692 | instruction before moving on to the next one, leading to a definite sequence of |
@@ -2228,12 +2733,12 @@ However, it is guaranteed that a CPU will be self-consistent: it will see its | |||
2228 | _own_ accesses appear to be correctly ordered, without the need for a memory | 2733 | _own_ accesses appear to be correctly ordered, without the need for a memory |
2229 | barrier. For instance with the following code: | 2734 | barrier. For instance with the following code: |
2230 | 2735 | ||
2231 | U = *A; | 2736 | U = ACCESS_ONCE(*A); |
2232 | *A = V; | 2737 | ACCESS_ONCE(*A) = V; |
2233 | *A = W; | 2738 | ACCESS_ONCE(*A) = W; |
2234 | X = *A; | 2739 | X = ACCESS_ONCE(*A); |
2235 | *A = Y; | 2740 | ACCESS_ONCE(*A) = Y; |
2236 | Z = *A; | 2741 | Z = ACCESS_ONCE(*A); |
2237 | 2742 | ||
2238 | and assuming no intervention by an external influence, it can be assumed that | 2743 | and assuming no intervention by an external influence, it can be assumed that |
2239 | the final result will appear to be: | 2744 | the final result will appear to be: |
@@ -2250,7 +2755,12 @@ accesses: | |||
2250 | 2755 | ||
2251 | in that order, but, without intervention, the sequence may have almost any | 2756 | in that order, but, without intervention, the sequence may have almost any |
2252 | combination of elements combined or discarded, provided the program's view of | 2757 | combination of elements combined or discarded, provided the program's view of |
2253 | the world remains consistent. | 2758 | the world remains consistent. Note that ACCESS_ONCE() is -not- optional |
2759 | in the above example, as there are architectures where a given CPU might | ||
2760 | interchange successive loads to the same location. On such architectures, | ||
2761 | ACCESS_ONCE() does whatever is necessary to prevent this, for example, on | ||
2762 | Itanium the volatile casts used by ACCESS_ONCE() cause GCC to emit the | ||
2763 | special ld.acq and st.rel instructions that prevent such reordering. | ||
2254 | 2764 | ||
2255 | The compiler may also combine, discard or defer elements of the sequence before | 2765 | The compiler may also combine, discard or defer elements of the sequence before |
2256 | the CPU even sees them. | 2766 | the CPU even sees them. |
@@ -2264,13 +2774,13 @@ may be reduced to: | |||
2264 | 2774 | ||
2265 | *A = W; | 2775 | *A = W; |
2266 | 2776 | ||
2267 | since, without a write barrier, it can be assumed that the effect of the | 2777 | since, without either a write barrier or an ACCESS_ONCE(), it can be |
2268 | storage of V to *A is lost. Similarly: | 2778 | assumed that the effect of the storage of V to *A is lost. Similarly: |
2269 | 2779 | ||
2270 | *A = Y; | 2780 | *A = Y; |
2271 | Z = *A; | 2781 | Z = *A; |
2272 | 2782 | ||
2273 | may, without a memory barrier, be reduced to: | 2783 | may, without a memory barrier or an ACCESS_ONCE(), be reduced to: |
2274 | 2784 | ||
2275 | *A = Y; | 2785 | *A = Y; |
2276 | Z = Y; | 2786 | Z = Y; |
diff --git a/Documentation/misc-devices/mei/mei-amt-version.c b/Documentation/misc-devices/mei/mei-amt-version.c index 49e4f770864a..57d0d871dcf7 100644 --- a/Documentation/misc-devices/mei/mei-amt-version.c +++ b/Documentation/misc-devices/mei/mei-amt-version.c | |||
@@ -115,8 +115,6 @@ static bool mei_init(struct mei *me, const uuid_le *guid, | |||
115 | struct mei_client *cl; | 115 | struct mei_client *cl; |
116 | struct mei_connect_client_data data; | 116 | struct mei_connect_client_data data; |
117 | 117 | ||
118 | mei_deinit(me); | ||
119 | |||
120 | me->verbose = verbose; | 118 | me->verbose = verbose; |
121 | 119 | ||
122 | me->fd = open("/dev/mei", O_RDWR); | 120 | me->fd = open("/dev/mei", O_RDWR); |
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt index a7929cb47e7c..23f1590f49fe 100644 --- a/Documentation/pinctrl.txt +++ b/Documentation/pinctrl.txt | |||
@@ -18,7 +18,7 @@ Definition of PIN CONTROLLER: | |||
18 | 18 | ||
19 | - A pin controller is a piece of hardware, usually a set of registers, that | 19 | - A pin controller is a piece of hardware, usually a set of registers, that |
20 | can control PINs. It may be able to multiplex, bias, set load capacitance, | 20 | can control PINs. It may be able to multiplex, bias, set load capacitance, |
21 | set drive strength etc for individual pins or groups of pins. | 21 | set drive strength, etc. for individual pins or groups of pins. |
22 | 22 | ||
23 | Definition of PIN: | 23 | Definition of PIN: |
24 | 24 | ||
@@ -90,7 +90,7 @@ selected drivers, you need to select them from your machine's Kconfig entry, | |||
90 | since these are so tightly integrated with the machines they are used on. | 90 | since these are so tightly integrated with the machines they are used on. |
91 | See for example arch/arm/mach-u300/Kconfig for an example. | 91 | See for example arch/arm/mach-u300/Kconfig for an example. |
92 | 92 | ||
93 | Pins usually have fancier names than this. You can find these in the dataheet | 93 | Pins usually have fancier names than this. You can find these in the datasheet |
94 | for your chip. Notice that the core pinctrl.h file provides a fancy macro | 94 | for your chip. Notice that the core pinctrl.h file provides a fancy macro |
95 | called PINCTRL_PIN() to create the struct entries. As you can see I enumerated | 95 | called PINCTRL_PIN() to create the struct entries. As you can see I enumerated |
96 | the pins from 0 in the upper left corner to 63 in the lower right corner. | 96 | the pins from 0 in the upper left corner to 63 in the lower right corner. |
@@ -185,7 +185,7 @@ static struct pinctrl_desc foo_desc = { | |||
185 | }; | 185 | }; |
186 | 186 | ||
187 | The pin control subsystem will call the .get_groups_count() function to | 187 | The pin control subsystem will call the .get_groups_count() function to |
188 | determine total number of legal selectors, then it will call the other functions | 188 | determine the total number of legal selectors, then it will call the other functions |
189 | to retrieve the name and pins of the group. Maintaining the data structure of | 189 | to retrieve the name and pins of the group. Maintaining the data structure of |
190 | the groups is up to the driver, this is just a simple example - in practice you | 190 | the groups is up to the driver, this is just a simple example - in practice you |
191 | may need more entries in your group structure, for example specific register | 191 | may need more entries in your group structure, for example specific register |
@@ -195,7 +195,7 @@ ranges associated with each group and so on. | |||
195 | Pin configuration | 195 | Pin configuration |
196 | ================= | 196 | ================= |
197 | 197 | ||
198 | Pins can sometimes be software-configured in an various ways, mostly related | 198 | Pins can sometimes be software-configured in various ways, mostly related |
199 | to their electronic properties when used as inputs or outputs. For example you | 199 | to their electronic properties when used as inputs or outputs. For example you |
200 | may be able to make an output pin high impedance, or "tristate" meaning it is | 200 | may be able to make an output pin high impedance, or "tristate" meaning it is |
201 | effectively disconnected. You may be able to connect an input pin to VDD or GND | 201 | effectively disconnected. You may be able to connect an input pin to VDD or GND |
@@ -291,7 +291,7 @@ Since the pin controller subsystem have its pinspace local to the pin | |||
291 | controller we need a mapping so that the pin control subsystem can figure out | 291 | controller we need a mapping so that the pin control subsystem can figure out |
292 | which pin controller handles control of a certain GPIO pin. Since a single | 292 | which pin controller handles control of a certain GPIO pin. Since a single |
293 | pin controller may be muxing several GPIO ranges (typically SoCs that have | 293 | pin controller may be muxing several GPIO ranges (typically SoCs that have |
294 | one set of pins but internally several GPIO silicon blocks, each modelled as | 294 | one set of pins, but internally several GPIO silicon blocks, each modelled as |
295 | a struct gpio_chip) any number of GPIO ranges can be added to a pin controller | 295 | a struct gpio_chip) any number of GPIO ranges can be added to a pin controller |
296 | instance like this: | 296 | instance like this: |
297 | 297 | ||
@@ -373,9 +373,9 @@ will be called on that specific pin controller. | |||
373 | 373 | ||
374 | For all functionalities dealing with pin biasing, pin muxing etc, the pin | 374 | For all functionalities dealing with pin biasing, pin muxing etc, the pin |
375 | controller subsystem will look up the corresponding pin number from the passed | 375 | controller subsystem will look up the corresponding pin number from the passed |
376 | in gpio number, and use the range's internals to retrive a pin number. After | 376 | in gpio number, and use the range's internals to retrieve a pin number. After |
377 | that, the subsystem passes it on to the pin control driver, so the driver | 377 | that, the subsystem passes it on to the pin control driver, so the driver |
378 | will get an pin number into its handled number range. Further it is also passed | 378 | will get a pin number into its handled number range. Further it is also passed |
379 | the range ID value, so that the pin controller knows which range it should | 379 | the range ID value, so that the pin controller knows which range it should |
380 | deal with. | 380 | deal with. |
381 | 381 | ||
@@ -430,8 +430,8 @@ pins you see some will be taken by things like a few VCC and GND to feed power | |||
430 | to the chip, and quite a few will be taken by large ports like an external | 430 | to the chip, and quite a few will be taken by large ports like an external |
431 | memory interface. The remaining pins will often be subject to pin multiplexing. | 431 | memory interface. The remaining pins will often be subject to pin multiplexing. |
432 | 432 | ||
433 | The example 8x8 PGA package above will have pin numbers 0 thru 63 assigned to | 433 | The example 8x8 PGA package above will have pin numbers 0 through 63 assigned |
434 | its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using | 434 | to its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using |
435 | pinctrl_register_pins() and a suitable data set as shown earlier. | 435 | pinctrl_register_pins() and a suitable data set as shown earlier. |
436 | 436 | ||
437 | In this 8x8 BGA package the pins { A8, A7, A6, A5 } can be used as an SPI port | 437 | In this 8x8 BGA package the pins { A8, A7, A6, A5 } can be used as an SPI port |
@@ -442,7 +442,7 @@ we cannot use the SPI port and I2C port at the same time. However in the inside | |||
442 | of the package the silicon performing the SPI logic can alternatively be routed | 442 | of the package the silicon performing the SPI logic can alternatively be routed |
443 | out on pins { G4, G3, G2, G1 }. | 443 | out on pins { G4, G3, G2, G1 }. |
444 | 444 | ||
445 | On the botton row at { A1, B1, C1, D1, E1, F1, G1, H1 } we have something | 445 | On the bottom row at { A1, B1, C1, D1, E1, F1, G1, H1 } we have something |
446 | special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will | 446 | special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will |
447 | consume 2, 4 or 8 pins respectively, so either { A1, B1 } are taken or | 447 | consume 2, 4 or 8 pins respectively, so either { A1, B1 } are taken or |
448 | { A1, B1, C1, D1 } or all of them. If we use all 8 bits, we cannot use the SPI | 448 | { A1, B1, C1, D1 } or all of them. If we use all 8 bits, we cannot use the SPI |
@@ -549,7 +549,7 @@ Assumptions: | |||
549 | 549 | ||
550 | We assume that the number of possible function maps to pin groups is limited by | 550 | We assume that the number of possible function maps to pin groups is limited by |
551 | the hardware. I.e. we assume that there is no system where any function can be | 551 | the hardware. I.e. we assume that there is no system where any function can be |
552 | mapped to any pin, like in a phone exchange. So the available pins groups for | 552 | mapped to any pin, like in a phone exchange. So the available pin groups for |
553 | a certain function will be limited to a few choices (say up to eight or so), | 553 | a certain function will be limited to a few choices (say up to eight or so), |
554 | not hundreds or any amount of choices. This is the characteristic we have found | 554 | not hundreds or any amount of choices. This is the characteristic we have found |
555 | by inspecting available pinmux hardware, and a necessary assumption since we | 555 | by inspecting available pinmux hardware, and a necessary assumption since we |
@@ -564,7 +564,7 @@ The pinmux core takes care of preventing conflicts on pins and calling | |||
564 | the pin controller driver to execute different settings. | 564 | the pin controller driver to execute different settings. |
565 | 565 | ||
566 | It is the responsibility of the pinmux driver to impose further restrictions | 566 | It is the responsibility of the pinmux driver to impose further restrictions |
567 | (say for example infer electronic limitations due to load etc) to determine | 567 | (say for example infer electronic limitations due to load, etc.) to determine |
568 | whether or not the requested function can actually be allowed, and in case it | 568 | whether or not the requested function can actually be allowed, and in case it |
569 | is possible to perform the requested mux setting, poke the hardware so that | 569 | is possible to perform the requested mux setting, poke the hardware so that |
570 | this happens. | 570 | this happens. |
@@ -755,7 +755,7 @@ Pin control interaction with the GPIO subsystem | |||
755 | Note that the following implies that the use case is to use a certain pin | 755 | Note that the following implies that the use case is to use a certain pin |
756 | from the Linux kernel using the API in <linux/gpio.h> with gpio_request() | 756 | from the Linux kernel using the API in <linux/gpio.h> with gpio_request() |
757 | and similar functions. There are cases where you may be using something | 757 | and similar functions. There are cases where you may be using something |
758 | that your datasheet calls "GPIO mode" but actually is just an electrical | 758 | that your datasheet calls "GPIO mode", but actually is just an electrical |
759 | configuration for a certain device. See the section below named | 759 | configuration for a certain device. See the section below named |
760 | "GPIO mode pitfalls" for more details on this scenario. | 760 | "GPIO mode pitfalls" for more details on this scenario. |
761 | 761 | ||
@@ -871,7 +871,7 @@ hardware and shall be put into different subsystems: | |||
871 | 871 | ||
872 | - Registers (or fields within registers) that control muxing of signals | 872 | - Registers (or fields within registers) that control muxing of signals |
873 | from various other HW blocks (e.g. I2C, MMC, or GPIO) onto pins should | 873 | from various other HW blocks (e.g. I2C, MMC, or GPIO) onto pins should |
874 | be exposed through the pinctrl subssytem, as mux functions. | 874 | be exposed through the pinctrl subsystem, as mux functions. |
875 | 875 | ||
876 | - Registers (or fields within registers) that control GPIO functionality | 876 | - Registers (or fields within registers) that control GPIO functionality |
877 | such as setting a GPIO's output value, reading a GPIO's input value, or | 877 | such as setting a GPIO's output value, reading a GPIO's input value, or |
@@ -895,7 +895,7 @@ Example: a pin is usually muxed in to be used as a UART TX line. But during | |||
895 | system sleep, we need to put this pin into "GPIO mode" and ground it. | 895 | system sleep, we need to put this pin into "GPIO mode" and ground it. |
896 | 896 | ||
897 | If you make a 1-to-1 map to the GPIO subsystem for this pin, you may start | 897 | If you make a 1-to-1 map to the GPIO subsystem for this pin, you may start |
898 | to think that you need to come up with something real complex, that the | 898 | to think that you need to come up with something really complex, that the |
899 | pin shall be used for UART TX and GPIO at the same time, that you will grab | 899 | pin shall be used for UART TX and GPIO at the same time, that you will grab |
900 | a pin control handle and set it to a certain state to enable UART TX to be | 900 | a pin control handle and set it to a certain state to enable UART TX to be |
901 | muxed in, then twist it over to GPIO mode and use gpio_direction_output() | 901 | muxed in, then twist it over to GPIO mode and use gpio_direction_output() |
@@ -964,12 +964,12 @@ GPIO mode. | |||
964 | This will give the desired effect without any bogus interaction with the | 964 | This will give the desired effect without any bogus interaction with the |
965 | GPIO subsystem. It is just an electrical configuration used by that device | 965 | GPIO subsystem. It is just an electrical configuration used by that device |
966 | when going to sleep, it might imply that the pin is set into something the | 966 | when going to sleep, it might imply that the pin is set into something the |
967 | datasheet calls "GPIO mode" but that is not the point: it is still used | 967 | datasheet calls "GPIO mode", but that is not the point: it is still used |
968 | by that UART device to control the pins that pertain to that very UART | 968 | by that UART device to control the pins that pertain to that very UART |
969 | driver, putting them into modes needed by the UART. GPIO in the Linux | 969 | driver, putting them into modes needed by the UART. GPIO in the Linux |
970 | kernel sense are just some 1-bit line, and is a different use case. | 970 | kernel sense are just some 1-bit line, and is a different use case. |
971 | 971 | ||
972 | How the registers are poked to attain the push/pull and output low | 972 | How the registers are poked to attain the push or pull, and output low |
973 | configuration and the muxing of the "u0" or "gpio-mode" group onto these | 973 | configuration and the muxing of the "u0" or "gpio-mode" group onto these |
974 | pins is a question for the driver. | 974 | pins is a question for the driver. |
975 | 975 | ||
@@ -977,7 +977,7 @@ Some datasheets will be more helpful and refer to the "GPIO mode" as | |||
977 | "low power mode" rather than anything to do with GPIO. This often means | 977 | "low power mode" rather than anything to do with GPIO. This often means |
978 | the same thing electrically speaking, but in this latter case the | 978 | the same thing electrically speaking, but in this latter case the |
979 | software engineers will usually quickly identify that this is some | 979 | software engineers will usually quickly identify that this is some |
980 | specific muxing/configuration rather than anything related to the GPIO | 980 | specific muxing or configuration rather than anything related to the GPIO |
981 | API. | 981 | API. |
982 | 982 | ||
983 | 983 | ||
@@ -1024,8 +1024,7 @@ up the device struct (just like with clockdev or regulators). The function name | |||
1024 | must match a function provided by the pinmux driver handling this pin range. | 1024 | must match a function provided by the pinmux driver handling this pin range. |
1025 | 1025 | ||
1026 | As you can see we may have several pin controllers on the system and thus | 1026 | As you can see we may have several pin controllers on the system and thus |
1027 | we need to specify which one of them that contain the functions we wish | 1027 | we need to specify which one of them contains the functions we wish to map. |
1028 | to map. | ||
1029 | 1028 | ||
1030 | You register this pinmux mapping to the pinmux subsystem by simply: | 1029 | You register this pinmux mapping to the pinmux subsystem by simply: |
1031 | 1030 | ||
@@ -1254,10 +1253,10 @@ The semantics of the pinctrl APIs are: | |||
1254 | pinctrl_get(). | 1253 | pinctrl_get(). |
1255 | 1254 | ||
1256 | - pinctrl_lookup_state() is called in process context to obtain a handle to a | 1255 | - pinctrl_lookup_state() is called in process context to obtain a handle to a |
1257 | specific state for a the client device. This operation may be slow too. | 1256 | specific state for a client device. This operation may be slow, too. |
1258 | 1257 | ||
1259 | - pinctrl_select_state() programs pin controller hardware according to the | 1258 | - pinctrl_select_state() programs pin controller hardware according to the |
1260 | definition of the state as given by the mapping table. In theory this is a | 1259 | definition of the state as given by the mapping table. In theory, this is a |
1261 | fast-path operation, since it only involved blasting some register settings | 1260 | fast-path operation, since it only involved blasting some register settings |
1262 | into hardware. However, note that some pin controllers may have their | 1261 | into hardware. However, note that some pin controllers may have their |
1263 | registers on a slow/IRQ-based bus, so client devices should not assume they | 1262 | registers on a slow/IRQ-based bus, so client devices should not assume they |
diff --git a/Documentation/robust-futex-ABI.txt b/Documentation/robust-futex-ABI.txt index fd1cd8aae4eb..16eb314f56cc 100644 --- a/Documentation/robust-futex-ABI.txt +++ b/Documentation/robust-futex-ABI.txt | |||
@@ -146,8 +146,8 @@ On removal: | |||
146 | 1) set the 'list_op_pending' word to the address of the 'lock entry' | 146 | 1) set the 'list_op_pending' word to the address of the 'lock entry' |
147 | to be removed, | 147 | to be removed, |
148 | 2) remove the lock entry for this lock from the 'head' list, | 148 | 2) remove the lock entry for this lock from the 'head' list, |
149 | 2) release the futex lock, and | 149 | 3) release the futex lock, and |
150 | 2) clear the 'lock_op_pending' word. | 150 | 4) clear the 'lock_op_pending' word. |
151 | 151 | ||
152 | On exit, the kernel will consider the address stored in | 152 | On exit, the kernel will consider the address stored in |
153 | 'list_op_pending' and the address of each 'lock word' found by walking | 153 | 'list_op_pending' and the address of each 'lock word' found by walking |
diff --git a/Documentation/security/IMA-templates.txt b/Documentation/security/IMA-templates.txt index a777e5f1df5b..a4e102dddfea 100644 --- a/Documentation/security/IMA-templates.txt +++ b/Documentation/security/IMA-templates.txt | |||
@@ -67,12 +67,14 @@ descriptors by adding their identifier to the format string | |||
67 | - 'd-ng': the digest of the event, calculated with an arbitrary hash | 67 | - 'd-ng': the digest of the event, calculated with an arbitrary hash |
68 | algorithm (field format: [<hash algo>:]digest, where the digest | 68 | algorithm (field format: [<hash algo>:]digest, where the digest |
69 | prefix is shown only if the hash algorithm is not SHA1 or MD5); | 69 | prefix is shown only if the hash algorithm is not SHA1 or MD5); |
70 | - 'n-ng': the name of the event, without size limitations. | 70 | - 'n-ng': the name of the event, without size limitations; |
71 | - 'sig': the file signature. | ||
71 | 72 | ||
72 | 73 | ||
73 | Below, there is the list of defined template descriptors: | 74 | Below, there is the list of defined template descriptors: |
74 | - "ima": its format is 'd|n'; | 75 | - "ima": its format is 'd|n'; |
75 | - "ima-ng" (default): its format is 'd-ng|n-ng'. | 76 | - "ima-ng" (default): its format is 'd-ng|n-ng'; |
77 | - "ima-sig": its format is 'd-ng|n-ng|sig'. | ||
76 | 78 | ||
77 | 79 | ||
78 | 80 | ||
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 26b7ee491df8..6d486404200e 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt | |||
@@ -428,11 +428,6 @@ rate for each task. | |||
428 | numa_balancing_scan_size_mb is how many megabytes worth of pages are | 428 | numa_balancing_scan_size_mb is how many megabytes worth of pages are |
429 | scanned for a given scan. | 429 | scanned for a given scan. |
430 | 430 | ||
431 | numa_balancing_settle_count is how many scan periods must complete before | ||
432 | the schedule balancer stops pushing the task towards a preferred node. This | ||
433 | gives the scheduler a chance to place the task on an alternative node if the | ||
434 | preferred node is overloaded. | ||
435 | |||
436 | numa_balancing_migrate_deferred is how many page migrations get skipped | 431 | numa_balancing_migrate_deferred is how many page migrations get skipped |
437 | unconditionally, after a page migration is skipped because a page is shared | 432 | unconditionally, after a page migration is skipped because a page is shared |
438 | with other tasks. This reduces page migration overhead, and determines | 433 | with other tasks. This reduces page migration overhead, and determines |
diff --git a/Documentation/vme_api.txt b/Documentation/vme_api.txt index 856efa35f6e3..ffe6e22a2ccd 100644 --- a/Documentation/vme_api.txt +++ b/Documentation/vme_api.txt | |||
@@ -393,4 +393,14 @@ Slot Detection | |||
393 | 393 | ||
394 | This function returns the slot ID of the provided bridge. | 394 | This function returns the slot ID of the provided bridge. |
395 | 395 | ||
396 | int vme_slot_get(struct vme_dev *dev); | 396 | int vme_slot_num(struct vme_dev *dev); |
397 | |||
398 | |||
399 | Bus Detection | ||
400 | ============= | ||
401 | |||
402 | This function returns the bus ID of the provided bridge. | ||
403 | |||
404 | int vme_bus_num(struct vme_dev *dev); | ||
405 | |||
406 | |||
diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt index f4f268c2b826..cb81741d3b0b 100644 --- a/Documentation/x86/boot.txt +++ b/Documentation/x86/boot.txt | |||
@@ -608,6 +608,9 @@ Protocol: 2.12+ | |||
608 | - If 1, the kernel supports the 64-bit EFI handoff entry point | 608 | - If 1, the kernel supports the 64-bit EFI handoff entry point |
609 | given at handover_offset + 0x200. | 609 | given at handover_offset + 0x200. |
610 | 610 | ||
611 | Bit 4 (read): XLF_EFI_KEXEC | ||
612 | - If 1, the kernel supports kexec EFI boot with EFI runtime support. | ||
613 | |||
611 | Field name: cmdline_size | 614 | Field name: cmdline_size |
612 | Type: read | 615 | Type: read |
613 | Offset/size: 0x238/4 | 616 | Offset/size: 0x238/4 |
diff --git a/Documentation/x86/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt index 881582f75c9c..c584a51add15 100644 --- a/Documentation/x86/x86_64/mm.txt +++ b/Documentation/x86/x86_64/mm.txt | |||
@@ -28,4 +28,11 @@ reference. | |||
28 | Current X86-64 implementations only support 40 bits of address space, | 28 | Current X86-64 implementations only support 40 bits of address space, |
29 | but we support up to 46 bits. This expands into MBZ space in the page tables. | 29 | but we support up to 46 bits. This expands into MBZ space in the page tables. |
30 | 30 | ||
31 | ->trampoline_pgd: | ||
32 | |||
33 | We map EFI runtime services in the aforementioned PGD in the virtual | ||
34 | range of 64Gb (arbitrarily set, can be raised if needed) | ||
35 | |||
36 | 0xffffffef00000000 - 0xffffffff00000000 | ||
37 | |||
31 | -Andi Kleen, Jul 2004 | 38 | -Andi Kleen, Jul 2004 |
diff --git a/Documentation/zh_CN/HOWTO b/Documentation/zh_CN/HOWTO index 7fba5aab9ef9..6c914aa87e71 100644 --- a/Documentation/zh_CN/HOWTO +++ b/Documentation/zh_CN/HOWTO | |||
@@ -112,7 +112,7 @@ Linux内核代码中包含有大量的文档。这些文档对于学习如何与 | |||
112 | 112 | ||
113 | 其他关于如何正确地生成补丁的优秀文档包括: | 113 | 其他关于如何正确地生成补丁的优秀文档包括: |
114 | "The Perfect Patch" | 114 | "The Perfect Patch" |
115 | http://userweb.kernel.org/~akpm/stuff/tpp.txt | 115 | http://www.ozlabs.org/~akpm/stuff/tpp.txt |
116 | "Linux kernel patch submission format" | 116 | "Linux kernel patch submission format" |
117 | http://linux.yyz.us/patch-format.html | 117 | http://linux.yyz.us/patch-format.html |
118 | 118 | ||
@@ -515,7 +515,7 @@ Linux内核社区并不喜欢一下接收大段的代码。修改需要被恰当 | |||
515 | 515 | ||
516 | 想了解它具体应该看起来像什么,请查阅以下文档中的“ChangeLog”章节: | 516 | 想了解它具体应该看起来像什么,请查阅以下文档中的“ChangeLog”章节: |
517 | “The Perfect Patch” | 517 | “The Perfect Patch” |
518 | http://userweb.kernel.org/~akpm/stuff/tpp.txt | 518 | http://www.ozlabs.org/~akpm/stuff/tpp.txt |
519 | 519 | ||
520 | 520 | ||
521 | 这些事情有时候做起来很难。要在任何方面都做到完美可能需要好几年时间。这是 | 521 | 这些事情有时候做起来很难。要在任何方面都做到完美可能需要好几年时间。这是 |
diff --git a/Documentation/zorro.txt b/Documentation/zorro.txt index d5829d14774a..90a64d52bea2 100644 --- a/Documentation/zorro.txt +++ b/Documentation/zorro.txt | |||
@@ -95,8 +95,9 @@ The treatment of these regions depends on the type of Zorro space: | |||
95 | ------------- | 95 | ------------- |
96 | 96 | ||
97 | linux/include/linux/zorro.h | 97 | linux/include/linux/zorro.h |
98 | linux/include/asm-{m68k,ppc}/zorro.h | 98 | linux/include/uapi/linux/zorro.h |
99 | linux/include/linux/zorro_ids.h | 99 | linux/include/uapi/linux/zorro_ids.h |
100 | linux/arch/m68k/include/asm/zorro.h | ||
100 | linux/drivers/zorro | 101 | linux/drivers/zorro |
101 | /proc/bus/zorro | 102 | /proc/bus/zorro |
102 | 103 | ||