aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-04-12 13:49:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-12 13:49:28 -0400
commit8065248069097dddf9945acfb2081025e9618c16 (patch)
treeeddf3fb0372ba0f65c01382d386942ea8d18932d /Documentation
parente66a8ddff72e85605f2212a0ebc666c7e9116641 (diff)
parentb4838d12e1f3cb48c2489a0b08733b5dbf848297 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/stable/sysfs-driver-usb-usbtmc2
-rw-r--r--Documentation/ABI/testing/debugfs-olpc16
-rw-r--r--Documentation/ABI/testing/sysfs-block-dm25
-rw-r--r--Documentation/ABI/testing/sysfs-bus-event_source-devices-format14
-rw-r--r--Documentation/ABI/testing/sysfs-driver-samsung-laptop18
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-acpi20
-rw-r--r--Documentation/CodingStyle29
-rw-r--r--Documentation/DMA-attributes.txt18
-rw-r--r--Documentation/DocBook/device-drivers.tmpl17
-rw-r--r--Documentation/Makefile2
-rw-r--r--Documentation/acpi/apei/einj.txt8
-rw-r--r--Documentation/aoe/aoe.txt2
-rw-r--r--Documentation/aoe/autoload.sh4
-rw-r--r--Documentation/blockdev/floppy.txt2
-rw-r--r--Documentation/cgroups/cpusets.txt2
-rw-r--r--Documentation/clk.txt233
-rw-r--r--Documentation/cpu-hotplug.txt22
-rw-r--r--Documentation/cpuidle/sysfs.txt5
-rw-r--r--Documentation/device-mapper/thin-provisioning.txt65
-rw-r--r--Documentation/device-mapper/verity.txt194
-rw-r--r--Documentation/devicetree/bindings/arm/atmel-at91.txt60
-rw-r--r--Documentation/devicetree/bindings/arm/atmel-pmc.txt11
-rw-r--r--Documentation/devicetree/bindings/arm/spear.txt8
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-omap.txt36
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-twl4030.txt23
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio_i2c.txt32
-rw-r--r--Documentation/devicetree/bindings/gpio/sodaville.txt48
-rw-r--r--Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt33
-rw-r--r--Documentation/devicetree/bindings/mtd/arm-versatile.txt4
-rw-r--r--Documentation/devicetree/bindings/mtd/atmel-dataflash.txt3
-rw-r--r--Documentation/devicetree/bindings/mtd/atmel-nand.txt41
-rw-r--r--Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt4
-rw-r--r--Documentation/devicetree/bindings/mtd/fsmc-nand.txt33
-rw-r--r--Documentation/devicetree/bindings/mtd/gpio-control-nand.txt3
-rw-r--r--Documentation/devicetree/bindings/mtd/mtd-physmap.txt23
-rw-r--r--Documentation/devicetree/bindings/mtd/nand.txt7
-rw-r--r--Documentation/devicetree/bindings/mtd/partition.txt38
-rw-r--r--Documentation/devicetree/bindings/mtd/spear_smi.txt31
-rw-r--r--Documentation/devicetree/bindings/power_supply/max17042_battery.txt18
-rw-r--r--Documentation/devicetree/bindings/regulator/anatop-regulator.txt29
-rw-r--r--Documentation/devicetree/bindings/usb/atmel-usb.txt49
-rw-r--r--Documentation/devicetree/bindings/usb/tegra-usb.txt13
-rw-r--r--Documentation/devicetree/usage-model.txt412
-rw-r--r--Documentation/dma-buf-sharing.txt120
-rw-r--r--Documentation/dontdiff1
-rw-r--r--Documentation/fb/intel810.txt2
-rw-r--r--Documentation/fb/intelfb.txt2
-rw-r--r--Documentation/feature-removal-schedule.txt18
-rw-r--r--Documentation/filesystems/ext4.txt8
-rw-r--r--Documentation/filesystems/files.txt4
-rw-r--r--Documentation/gpio.txt40
-rw-r--r--Documentation/hwmon/k10temp2
-rw-r--r--Documentation/i2c/busses/i2c-i8011
-rw-r--r--Documentation/i2c/busses/scx200_acb2
-rw-r--r--Documentation/ide/ide.txt2
-rw-r--r--Documentation/input/input.txt4
-rw-r--r--Documentation/ioctl/ioctl-number.txt1
-rw-r--r--Documentation/isdn/README.gigaset16
-rw-r--r--Documentation/kbuild/kconfig.txt8
-rw-r--r--Documentation/kernel-parameters.txt8
-rw-r--r--Documentation/laptops/asus-laptop.txt2
-rw-r--r--Documentation/laptops/sony-laptop.txt5
-rw-r--r--Documentation/laptops/sonypi.txt2
-rw-r--r--Documentation/mono.txt8
-rw-r--r--Documentation/networking/baycom.txt2
-rw-r--r--Documentation/networking/bonding.txt46
-rw-r--r--Documentation/networking/dl2k.txt11
-rw-r--r--Documentation/networking/driver.txt31
-rw-r--r--Documentation/networking/e100.txt6
-rw-r--r--Documentation/networking/ip-sysctl.txt11
-rw-r--r--Documentation/networking/ipv6.txt6
-rw-r--r--Documentation/networking/ixgb.txt6
-rw-r--r--Documentation/networking/ltpc.txt2
-rw-r--r--Documentation/networking/netdevices.txt25
-rw-r--r--Documentation/networking/vortex.txt6
-rw-r--r--Documentation/parport.txt13
-rw-r--r--Documentation/s390/3270.txt21
-rw-r--r--Documentation/scsi/00-INDEX2
-rw-r--r--Documentation/scsi/aic79xx.txt2
-rw-r--r--Documentation/scsi/aic7xxx.txt2
-rw-r--r--Documentation/scsi/osst.txt2
-rw-r--r--Documentation/scsi/st.txt4
-rw-r--r--Documentation/scsi/ufs.txt133
-rw-r--r--Documentation/serial/computone.txt8
-rw-r--r--Documentation/serial/rocket.txt2
-rw-r--r--Documentation/serial/stallion.txt4
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt10
-rw-r--r--Documentation/sound/alsa/Audiophile-Usb.txt4
-rw-r--r--Documentation/sound/alsa/MIXART.txt6
-rw-r--r--Documentation/sound/alsa/OSS-Emulation.txt2
-rw-r--r--Documentation/sound/oss/AudioExcelDSP1610
-rw-r--r--Documentation/sound/oss/CMI83305
-rw-r--r--Documentation/sound/oss/Introduction10
-rw-r--r--Documentation/sound/oss/Opti8
-rw-r--r--Documentation/sound/oss/PAS164
-rw-r--r--Documentation/sound/oss/README.modules10
-rw-r--r--Documentation/sysrq.txt5
-rw-r--r--Documentation/usb/power-management.txt3
-rw-r--r--Documentation/video4linux/CQcam.txt14
-rw-r--r--Documentation/video4linux/Zoran2
-rw-r--r--Documentation/video4linux/bttv/Modules.conf2
-rw-r--r--Documentation/video4linux/meye.txt2
-rw-r--r--Documentation/virtual/kvm/api.txt259
-rw-r--r--Documentation/virtual/kvm/ppc-pv.txt24
-rw-r--r--Documentation/vm/Makefile8
-rw-r--r--Documentation/vm/hugepage-mmap.c91
-rw-r--r--Documentation/vm/hugepage-shm.c98
-rw-r--r--Documentation/vm/map_hugetlb.c77
-rw-r--r--Documentation/vm/page-types.c1102
-rw-r--r--Documentation/watchdog/00-INDEX19
-rw-r--r--Documentation/watchdog/convert_drivers_to_kernel_api.txt4
-rw-r--r--Documentation/watchdog/watchdog-kernel-api.txt11
112 files changed, 2348 insertions, 1700 deletions
diff --git a/Documentation/ABI/stable/sysfs-driver-usb-usbtmc b/Documentation/ABI/stable/sysfs-driver-usb-usbtmc
index 23a43b8207e6..2a7f9a00cb0a 100644
--- a/Documentation/ABI/stable/sysfs-driver-usb-usbtmc
+++ b/Documentation/ABI/stable/sysfs-driver-usb-usbtmc
@@ -55,7 +55,7 @@ What: /sys/bus/usb/drivers/usbtmc/devices/*/auto_abort
55Date: August 2008 55Date: August 2008
56Contact: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 56Contact: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
57Description: 57Description:
58 This file determines if the the transaction of the USB TMC 58 This file determines if the transaction of the USB TMC
59 device is to be automatically aborted if there is any error. 59 device is to be automatically aborted if there is any error.
60 For more details about this, please see the document, 60 For more details about this, please see the document,
61 "Universal Serial Bus Test and Measurement Class Specification 61 "Universal Serial Bus Test and Measurement Class Specification
diff --git a/Documentation/ABI/testing/debugfs-olpc b/Documentation/ABI/testing/debugfs-olpc
new file mode 100644
index 000000000000..bd76cc6d55f9
--- /dev/null
+++ b/Documentation/ABI/testing/debugfs-olpc
@@ -0,0 +1,16 @@
1What: /sys/kernel/debug/olpc-ec/cmd
2Date: Dec 2011
3KernelVersion: 3.4
4Contact: devel@lists.laptop.org
5Description:
6
7A generic interface for executing OLPC Embedded Controller commands and
8reading their responses.
9
10To execute a command, write data with the format: CC:N A A A A
11CC is the (hex) command, N is the count of expected reply bytes, and A A A A
12are optional (hex) arguments.
13
14To read the response (if any), read from the generic node after executing
15a command. Hex reply bytes will be returned, *whether or not* they came from
16the immediately previous command.
diff --git a/Documentation/ABI/testing/sysfs-block-dm b/Documentation/ABI/testing/sysfs-block-dm
new file mode 100644
index 000000000000..87ca5691e29b
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-block-dm
@@ -0,0 +1,25 @@
1What: /sys/block/dm-<num>/dm/name
2Date: January 2009
3KernelVersion: 2.6.29
4Contact: dm-devel@redhat.com
5Description: Device-mapper device name.
6 Read-only string containing mapped device name.
7Users: util-linux, device-mapper udev rules
8
9What: /sys/block/dm-<num>/dm/uuid
10Date: January 2009
11KernelVersion: 2.6.29
12Contact: dm-devel@redhat.com
13Description: Device-mapper device UUID.
14 Read-only string containing DM-UUID or empty string
15 if DM-UUID is not set.
16Users: util-linux, device-mapper udev rules
17
18What: /sys/block/dm-<num>/dm/suspended
19Date: June 2009
20KernelVersion: 2.6.31
21Contact: dm-devel@redhat.com
22Description: Device-mapper device suspend state.
23 Contains the value 1 while the device is suspended.
24 Otherwise it contains 0. Read-only attribute.
25Users: util-linux, device-mapper udev rules
diff --git a/Documentation/ABI/testing/sysfs-bus-event_source-devices-format b/Documentation/ABI/testing/sysfs-bus-event_source-devices-format
new file mode 100644
index 000000000000..079afc71363d
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-event_source-devices-format
@@ -0,0 +1,14 @@
1Where: /sys/bus/event_source/devices/<dev>/format
2Date: January 2012
3Kernel Version: 3.3
4Contact: Jiri Olsa <jolsa@redhat.com>
5Description:
6 Attribute group to describe the magic bits that go into
7 perf_event_attr::config[012] for a particular pmu.
8 Each attribute of this group defines the 'hardware' bitmask
9 we want to export, so that userspace can deal with sane
10 name/value pairs.
11
12 Example: 'config1:1,6-10,44'
13 Defines contents of attribute that occupies bits 1,6-10,44 of
14 perf_event_attr::config1.
diff --git a/Documentation/ABI/testing/sysfs-driver-samsung-laptop b/Documentation/ABI/testing/sysfs-driver-samsung-laptop
index e82e7c2b8f80..678819a3f8bf 100644
--- a/Documentation/ABI/testing/sysfs-driver-samsung-laptop
+++ b/Documentation/ABI/testing/sysfs-driver-samsung-laptop
@@ -17,3 +17,21 @@ Description: Some Samsung laptops have different "performance levels"
17 Specifically, not all support the "overclock" option, 17 Specifically, not all support the "overclock" option,
18 and it's still unknown if this value even changes 18 and it's still unknown if this value even changes
19 anything, other than making the user feel a bit better. 19 anything, other than making the user feel a bit better.
20
21What: /sys/devices/platform/samsung/battery_life_extender
22Date: December 1, 2011
23KernelVersion: 3.3
24Contact: Corentin Chary <corentin.chary@gmail.com>
25Description: Max battery charge level can be modified, battery cycle
26 life can be extended by reducing the max battery charge
27 level.
28 0 means normal battery mode (100% charge)
29 1 means battery life extender mode (80% charge)
30
31What: /sys/devices/platform/samsung/usb_charge
32Date: December 1, 2011
33KernelVersion: 3.3
34Contact: Corentin Chary <corentin.chary@gmail.com>
35Description: Use your USB ports to charge devices, even
36 when your laptop is powered off.
37 1 means enabled, 0 means disabled.
diff --git a/Documentation/ABI/testing/sysfs-firmware-acpi b/Documentation/ABI/testing/sysfs-firmware-acpi
index 4f9ba3c2fca7..dd930c8db41f 100644
--- a/Documentation/ABI/testing/sysfs-firmware-acpi
+++ b/Documentation/ABI/testing/sysfs-firmware-acpi
@@ -1,3 +1,23 @@
1What: /sys/firmware/acpi/bgrt/
2Date: January 2012
3Contact: Matthew Garrett <mjg@redhat.com>
4Description:
5 The BGRT is an ACPI 5.0 feature that allows the OS
6 to obtain a copy of the firmware boot splash and
7 some associated metadata. This is intended to be used
8 by boot splash applications in order to interact with
9 the firmware boot splash in order to avoid jarring
10 transitions.
11
12 image: The image bitmap. Currently a 32-bit BMP.
13 status: 1 if the image is valid, 0 if firmware invalidated it.
14 type: 0 indicates image is in BMP format.
15 version: The version of the BGRT. Currently 1.
16 xoffset: The number of pixels between the left of the screen
17 and the left edge of the image.
18 yoffset: The number of pixels between the top of the screen
19 and the top edge of the image.
20
1What: /sys/firmware/acpi/interrupts/ 21What: /sys/firmware/acpi/interrupts/
2Date: February 2008 22Date: February 2008
3Contact: Len Brown <lenb@kernel.org> 23Contact: Len Brown <lenb@kernel.org>
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 2b90d328b3ba..c58b236bbe04 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -793,6 +793,35 @@ own custom mode, or may have some other magic method for making indentation
793work correctly. 793work correctly.
794 794
795 795
796 Chapter 19: Inline assembly
797
798In architecture-specific code, you may need to use inline assembly to interface
799with CPU or platform functionality. Don't hesitate to do so when necessary.
800However, don't use inline assembly gratuitously when C can do the job. You can
801and should poke hardware from C when possible.
802
803Consider writing simple helper functions that wrap common bits of inline
804assembly, rather than repeatedly writing them with slight variations. Remember
805that inline assembly can use C parameters.
806
807Large, non-trivial assembly functions should go in .S files, with corresponding
808C prototypes defined in C header files. The C prototypes for assembly
809functions should use "asmlinkage".
810
811You may need to mark your asm statement as volatile, to prevent GCC from
812removing it if GCC doesn't notice any side effects. You don't always need to
813do so, though, and doing so unnecessarily can limit optimization.
814
815When writing a single inline assembly statement containing multiple
816instructions, put each instruction on a separate line in a separate quoted
817string, and end each string except the last with \n\t to properly indent the
818next instruction in the assembly output:
819
820 asm ("magic %reg1, #42\n\t"
821 "more_magic %reg2, %reg3"
822 : /* outputs */ : /* inputs */ : /* clobbers */);
823
824
796 825
797 Appendix I: References 826 Appendix I: References
798 827
diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt
index b768cc0e402b..5c72eed89563 100644
--- a/Documentation/DMA-attributes.txt
+++ b/Documentation/DMA-attributes.txt
@@ -31,3 +31,21 @@ may be weakly ordered, that is that reads and writes may pass each other.
31Since it is optional for platforms to implement DMA_ATTR_WEAK_ORDERING, 31Since it is optional for platforms to implement DMA_ATTR_WEAK_ORDERING,
32those that do not will simply ignore the attribute and exhibit default 32those that do not will simply ignore the attribute and exhibit default
33behavior. 33behavior.
34
35DMA_ATTR_WRITE_COMBINE
36----------------------
37
38DMA_ATTR_WRITE_COMBINE specifies that writes to the mapping may be
39buffered to improve performance.
40
41Since it is optional for platforms to implement DMA_ATTR_WRITE_COMBINE,
42those that do not will simply ignore the attribute and exhibit default
43behavior.
44
45DMA_ATTR_NON_CONSISTENT
46-----------------------
47
48DMA_ATTR_NON_CONSISTENT lets the platform to choose to return either
49consistent or non-consistent memory as it sees fit. By using this API,
50you are guaranteeing to the platform that you have all the correct and
51necessary sync points for this memory in the driver.
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl
index 9c27e5125dd2..7514dbf0a679 100644
--- a/Documentation/DocBook/device-drivers.tmpl
+++ b/Documentation/DocBook/device-drivers.tmpl
@@ -446,4 +446,21 @@ X!Idrivers/video/console/fonts.c
446!Edrivers/i2c/i2c-core.c 446!Edrivers/i2c/i2c-core.c
447 </chapter> 447 </chapter>
448 448
449 <chapter id="hsi">
450 <title>High Speed Synchronous Serial Interface (HSI)</title>
451
452 <para>
453 High Speed Synchronous Serial Interface (HSI) is a
454 serial interface mainly used for connecting application
455 engines (APE) with cellular modem engines (CMT) in cellular
456 handsets.
457
458 HSI provides multiplexing for up to 16 logical channels,
459 low-latency and full duplex communication.
460 </para>
461
462!Iinclude/linux/hsi/hsi.h
463!Edrivers/hsi/hsi.c
464 </chapter>
465
449</book> 466</book>
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 9b4bc5c76f33..30b656ece7aa 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,3 +1,3 @@
1obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ 1obj-m := DocBook/ accounting/ auxdisplay/ connector/ \
2 filesystems/ filesystems/configfs/ ia64/ laptops/ networking/ \ 2 filesystems/ filesystems/configfs/ ia64/ laptops/ networking/ \
3 pcmcia/ spi/ timers/ vm/ watchdog/src/ 3 pcmcia/ spi/ timers/ watchdog/src/
diff --git a/Documentation/acpi/apei/einj.txt b/Documentation/acpi/apei/einj.txt
index e7cc36397217..e20b6daaced4 100644
--- a/Documentation/acpi/apei/einj.txt
+++ b/Documentation/acpi/apei/einj.txt
@@ -53,6 +53,14 @@ directory apei/einj. The following files are provided.
53 This file is used to set the second error parameter value. Effect of 53 This file is used to set the second error parameter value. Effect of
54 parameter depends on error_type specified. 54 parameter depends on error_type specified.
55 55
56- notrigger
57 The EINJ mechanism is a two step process. First inject the error, then
58 perform some actions to trigger it. Setting "notrigger" to 1 skips the
59 trigger phase, which *may* allow the user to cause the error in some other
60 context by a simple access to the cpu, memory location, or device that is
61 the target of the error injection. Whether this actually works depends
62 on what operations the BIOS actually includes in the trigger phase.
63
56BIOS versions based in the ACPI 4.0 specification have limited options 64BIOS versions based in the ACPI 4.0 specification have limited options
57to control where the errors are injected. Your BIOS may support an 65to control where the errors are injected. Your BIOS may support an
58extension (enabled with the param_extension=1 module parameter, or 66extension (enabled with the param_extension=1 module parameter, or
diff --git a/Documentation/aoe/aoe.txt b/Documentation/aoe/aoe.txt
index b5aada9f20cc..5f5aa16047ff 100644
--- a/Documentation/aoe/aoe.txt
+++ b/Documentation/aoe/aoe.txt
@@ -35,7 +35,7 @@ CREATING DEVICE NODES
35 sh Documentation/aoe/mkshelf.sh /dev/etherd 0 35 sh Documentation/aoe/mkshelf.sh /dev/etherd 0
36 36
37 There is also an autoload script that shows how to edit 37 There is also an autoload script that shows how to edit
38 /etc/modprobe.conf to ensure that the aoe module is loaded when 38 /etc/modprobe.d/aoe.conf to ensure that the aoe module is loaded when
39 necessary. 39 necessary.
40 40
41USING DEVICE NODES 41USING DEVICE NODES
diff --git a/Documentation/aoe/autoload.sh b/Documentation/aoe/autoload.sh
index 78dad1334c6f..815dff4691c9 100644
--- a/Documentation/aoe/autoload.sh
+++ b/Documentation/aoe/autoload.sh
@@ -1,8 +1,8 @@
1#!/bin/sh 1#!/bin/sh
2# set aoe to autoload by installing the 2# set aoe to autoload by installing the
3# aliases in /etc/modprobe.conf 3# aliases in /etc/modprobe.d/
4 4
5f=/etc/modprobe.conf 5f=/etc/modprobe.d/aoe.conf
6 6
7if test ! -r $f || test ! -w $f; then 7if test ! -r $f || test ! -w $f; then
8 echo "cannot configure $f for module autoloading" 1>&2 8 echo "cannot configure $f for module autoloading" 1>&2
diff --git a/Documentation/blockdev/floppy.txt b/Documentation/blockdev/floppy.txt
index 6ccab88705cb..470fe4b5e379 100644
--- a/Documentation/blockdev/floppy.txt
+++ b/Documentation/blockdev/floppy.txt
@@ -49,7 +49,7 @@ you can put:
49 49
50 options floppy omnibook messages 50 options floppy omnibook messages
51 51
52in /etc/modprobe.conf. 52in a configuration file in /etc/modprobe.d/.
53 53
54 54
55 The floppy driver related options are: 55 The floppy driver related options are:
diff --git a/Documentation/cgroups/cpusets.txt b/Documentation/cgroups/cpusets.txt
index 5c51ed406d1d..cefd3d8bbd11 100644
--- a/Documentation/cgroups/cpusets.txt
+++ b/Documentation/cgroups/cpusets.txt
@@ -217,7 +217,7 @@ and name space for cpusets, with a minimum of additional kernel code.
217 217
218The cpus and mems files in the root (top_cpuset) cpuset are 218The cpus and mems files in the root (top_cpuset) cpuset are
219read-only. The cpus file automatically tracks the value of 219read-only. The cpus file automatically tracks the value of
220cpu_online_map using a CPU hotplug notifier, and the mems file 220cpu_online_mask using a CPU hotplug notifier, and the mems file
221automatically tracks the value of node_states[N_HIGH_MEMORY]--i.e., 221automatically tracks the value of node_states[N_HIGH_MEMORY]--i.e.,
222nodes with memory--using the cpuset_track_online_nodes() hook. 222nodes with memory--using the cpuset_track_online_nodes() hook.
223 223
diff --git a/Documentation/clk.txt b/Documentation/clk.txt
new file mode 100644
index 000000000000..1943fae014fd
--- /dev/null
+++ b/Documentation/clk.txt
@@ -0,0 +1,233 @@
1 The Common Clk Framework
2 Mike Turquette <mturquette@ti.com>
3
4This document endeavours to explain the common clk framework details,
5and how to port a platform over to this framework. It is not yet a
6detailed explanation of the clock api in include/linux/clk.h, but
7perhaps someday it will include that information.
8
9 Part 1 - introduction and interface split
10
11The common clk framework is an interface to control the clock nodes
12available on various devices today. This may come in the form of clock
13gating, rate adjustment, muxing or other operations. This framework is
14enabled with the CONFIG_COMMON_CLK option.
15
16The interface itself is divided into two halves, each shielded from the
17details of its counterpart. First is the common definition of struct
18clk which unifies the framework-level accounting and infrastructure that
19has traditionally been duplicated across a variety of platforms. Second
20is a common implementation of the clk.h api, defined in
21drivers/clk/clk.c. Finally there is struct clk_ops, whose operations
22are invoked by the clk api implementation.
23
24The second half of the interface is comprised of the hardware-specific
25callbacks registered with struct clk_ops and the corresponding
26hardware-specific structures needed to model a particular clock. For
27the remainder of this document any reference to a callback in struct
28clk_ops, such as .enable or .set_rate, implies the hardware-specific
29implementation of that code. Likewise, references to struct clk_foo
30serve as a convenient shorthand for the implementation of the
31hardware-specific bits for the hypothetical "foo" hardware.
32
33Tying the two halves of this interface together is struct clk_hw, which
34is defined in struct clk_foo and pointed to within struct clk. This
35allows easy for navigation between the two discrete halves of the common
36clock interface.
37
38 Part 2 - common data structures and api
39
40Below is the common struct clk definition from
41include/linux/clk-private.h, modified for brevity:
42
43 struct clk {
44 const char *name;
45 const struct clk_ops *ops;
46 struct clk_hw *hw;
47 char **parent_names;
48 struct clk **parents;
49 struct clk *parent;
50 struct hlist_head children;
51 struct hlist_node child_node;
52 ...
53 };
54
55The members above make up the core of the clk tree topology. The clk
56api itself defines several driver-facing functions which operate on
57struct clk. That api is documented in include/linux/clk.h.
58
59Platforms and devices utilizing the common struct clk use the struct
60clk_ops pointer in struct clk to perform the hardware-specific parts of
61the operations defined in clk.h:
62
63 struct clk_ops {
64 int (*prepare)(struct clk_hw *hw);
65 void (*unprepare)(struct clk_hw *hw);
66 int (*enable)(struct clk_hw *hw);
67 void (*disable)(struct clk_hw *hw);
68 int (*is_enabled)(struct clk_hw *hw);
69 unsigned long (*recalc_rate)(struct clk_hw *hw,
70 unsigned long parent_rate);
71 long (*round_rate)(struct clk_hw *hw, unsigned long,
72 unsigned long *);
73 int (*set_parent)(struct clk_hw *hw, u8 index);
74 u8 (*get_parent)(struct clk_hw *hw);
75 int (*set_rate)(struct clk_hw *hw, unsigned long);
76 void (*init)(struct clk_hw *hw);
77 };
78
79 Part 3 - hardware clk implementations
80
81The strength of the common struct clk comes from its .ops and .hw pointers
82which abstract the details of struct clk from the hardware-specific bits, and
83vice versa. To illustrate consider the simple gateable clk implementation in
84drivers/clk/clk-gate.c:
85
86struct clk_gate {
87 struct clk_hw hw;
88 void __iomem *reg;
89 u8 bit_idx;
90 ...
91};
92
93struct clk_gate contains struct clk_hw hw as well as hardware-specific
94knowledge about which register and bit controls this clk's gating.
95Nothing about clock topology or accounting, such as enable_count or
96notifier_count, is needed here. That is all handled by the common
97framework code and struct clk.
98
99Let's walk through enabling this clk from driver code:
100
101 struct clk *clk;
102 clk = clk_get(NULL, "my_gateable_clk");
103
104 clk_prepare(clk);
105 clk_enable(clk);
106
107The call graph for clk_enable is very simple:
108
109clk_enable(clk);
110 clk->ops->enable(clk->hw);
111 [resolves to...]
112 clk_gate_enable(hw);
113 [resolves struct clk gate with to_clk_gate(hw)]
114 clk_gate_set_bit(gate);
115
116And the definition of clk_gate_set_bit:
117
118static void clk_gate_set_bit(struct clk_gate *gate)
119{
120 u32 reg;
121
122 reg = __raw_readl(gate->reg);
123 reg |= BIT(gate->bit_idx);
124 writel(reg, gate->reg);
125}
126
127Note that to_clk_gate is defined as:
128
129#define to_clk_gate(_hw) container_of(_hw, struct clk_gate, clk)
130
131This pattern of abstraction is used for every clock hardware
132representation.
133
134 Part 4 - supporting your own clk hardware
135
136When implementing support for a new type of clock it only necessary to
137include the following header:
138
139#include <linux/clk-provider.h>
140
141include/linux/clk.h is included within that header and clk-private.h
142must never be included from the code which implements the operations for
143a clock. More on that below in Part 5.
144
145To construct a clk hardware structure for your platform you must define
146the following:
147
148struct clk_foo {
149 struct clk_hw hw;
150 ... hardware specific data goes here ...
151};
152
153To take advantage of your data you'll need to support valid operations
154for your clk:
155
156struct clk_ops clk_foo_ops {
157 .enable = &clk_foo_enable;
158 .disable = &clk_foo_disable;
159};
160
161Implement the above functions using container_of:
162
163#define to_clk_foo(_hw) container_of(_hw, struct clk_foo, hw)
164
165int clk_foo_enable(struct clk_hw *hw)
166{
167 struct clk_foo *foo;
168
169 foo = to_clk_foo(hw);
170
171 ... perform magic on foo ...
172
173 return 0;
174};
175
176Below is a matrix detailing which clk_ops are mandatory based upon the
177hardware capbilities of that clock. A cell marked as "y" means
178mandatory, a cell marked as "n" implies that either including that
179callback is invalid or otherwise uneccesary. Empty cells are either
180optional or must be evaluated on a case-by-case basis.
181
182 clock hardware characteristics
183 -----------------------------------------------------------
184 | gate | change rate | single parent | multiplexer | root |
185 |------|-------------|---------------|-------------|------|
186.prepare | | | | | |
187.unprepare | | | | | |
188 | | | | | |
189.enable | y | | | | |
190.disable | y | | | | |
191.is_enabled | y | | | | |
192 | | | | | |
193.recalc_rate | | y | | | |
194.round_rate | | y | | | |
195.set_rate | | y | | | |
196 | | | | | |
197.set_parent | | | n | y | n |
198.get_parent | | | n | y | n |
199 | | | | | |
200.init | | | | | |
201 -----------------------------------------------------------
202
203Finally, register your clock at run-time with a hardware-specific
204registration function. This function simply populates struct clk_foo's
205data and then passes the common struct clk parameters to the framework
206with a call to:
207
208clk_register(...)
209
210See the basic clock types in drivers/clk/clk-*.c for examples.
211
212 Part 5 - static initialization of clock data
213
214For platforms with many clocks (often numbering into the hundreds) it
215may be desirable to statically initialize some clock data. This
216presents a problem since the definition of struct clk should be hidden
217from everyone except for the clock core in drivers/clk/clk.c.
218
219To get around this problem struct clk's definition is exposed in
220include/linux/clk-private.h along with some macros for more easily
221initializing instances of the basic clock types. These clocks must
222still be initialized with the common clock framework via a call to
223__clk_init.
224
225clk-private.h must NEVER be included by code which implements struct
226clk_ops callbacks, nor must it be included by any logic which pokes
227around inside of struct clk at run-time. To do so is a layering
228violation.
229
230To better enforce this policy, always follow this simple rule: any
231statically initialized clock data MUST be defined in a separate file
232from the logic that implements its ops. Basically separate the logic
233from the data and all is well.
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt
index a20bfd415e41..66ef8f35613d 100644
--- a/Documentation/cpu-hotplug.txt
+++ b/Documentation/cpu-hotplug.txt
@@ -47,7 +47,7 @@ maxcpus=n Restrict boot time cpus to n. Say if you have 4 cpus, using
47 other cpus later online, read FAQ's for more info. 47 other cpus later online, read FAQ's for more info.
48 48
49additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets 49additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets
50 cpu_possible_map = cpu_present_map + additional_cpus 50 cpu_possible_mask = cpu_present_mask + additional_cpus
51 51
52cede_offline={"off","on"} Use this option to disable/enable putting offlined 52cede_offline={"off","on"} Use this option to disable/enable putting offlined
53 processors to an extended H_CEDE state on 53 processors to an extended H_CEDE state on
@@ -64,11 +64,11 @@ should only rely on this to count the # of cpus, but *MUST* not rely
64on the apicid values in those tables for disabled apics. In the event 64on the apicid values in those tables for disabled apics. In the event
65BIOS doesn't mark such hot-pluggable cpus as disabled entries, one could 65BIOS doesn't mark such hot-pluggable cpus as disabled entries, one could
66use this parameter "additional_cpus=x" to represent those cpus in the 66use this parameter "additional_cpus=x" to represent those cpus in the
67cpu_possible_map. 67cpu_possible_mask.
68 68
69possible_cpus=n [s390,x86_64] use this to set hotpluggable cpus. 69possible_cpus=n [s390,x86_64] use this to set hotpluggable cpus.
70 This option sets possible_cpus bits in 70 This option sets possible_cpus bits in
71 cpu_possible_map. Thus keeping the numbers of bits set 71 cpu_possible_mask. Thus keeping the numbers of bits set
72 constant even if the machine gets rebooted. 72 constant even if the machine gets rebooted.
73 73
74CPU maps and such 74CPU maps and such
@@ -76,7 +76,7 @@ CPU maps and such
76[More on cpumaps and primitive to manipulate, please check 76[More on cpumaps and primitive to manipulate, please check
77include/linux/cpumask.h that has more descriptive text.] 77include/linux/cpumask.h that has more descriptive text.]
78 78
79cpu_possible_map: Bitmap of possible CPUs that can ever be available in the 79cpu_possible_mask: Bitmap of possible CPUs that can ever be available in the
80system. This is used to allocate some boot time memory for per_cpu variables 80system. This is used to allocate some boot time memory for per_cpu variables
81that aren't designed to grow/shrink as CPUs are made available or removed. 81that aren't designed to grow/shrink as CPUs are made available or removed.
82Once set during boot time discovery phase, the map is static, i.e no bits 82Once set during boot time discovery phase, the map is static, i.e no bits
@@ -84,13 +84,13 @@ are added or removed anytime. Trimming it accurately for your system needs
84upfront can save some boot time memory. See below for how we use heuristics 84upfront can save some boot time memory. See below for how we use heuristics
85in x86_64 case to keep this under check. 85in x86_64 case to keep this under check.
86 86
87cpu_online_map: Bitmap of all CPUs currently online. Its set in __cpu_up() 87cpu_online_mask: Bitmap of all CPUs currently online. Its set in __cpu_up()
88after a cpu is available for kernel scheduling and ready to receive 88after a cpu is available for kernel scheduling and ready to receive
89interrupts from devices. Its cleared when a cpu is brought down using 89interrupts from devices. Its cleared when a cpu is brought down using
90__cpu_disable(), before which all OS services including interrupts are 90__cpu_disable(), before which all OS services including interrupts are
91migrated to another target CPU. 91migrated to another target CPU.
92 92
93cpu_present_map: Bitmap of CPUs currently present in the system. Not all 93cpu_present_mask: Bitmap of CPUs currently present in the system. Not all
94of them may be online. When physical hotplug is processed by the relevant 94of them may be online. When physical hotplug is processed by the relevant
95subsystem (e.g ACPI) can change and new bit either be added or removed 95subsystem (e.g ACPI) can change and new bit either be added or removed
96from the map depending on the event is hot-add/hot-remove. There are currently 96from the map depending on the event is hot-add/hot-remove. There are currently
@@ -99,22 +99,22 @@ at which time hotplug is disabled.
99 99
100You really dont need to manipulate any of the system cpu maps. They should 100You really dont need to manipulate any of the system cpu maps. They should
101be read-only for most use. When setting up per-cpu resources almost always use 101be read-only for most use. When setting up per-cpu resources almost always use
102cpu_possible_map/for_each_possible_cpu() to iterate. 102cpu_possible_mask/for_each_possible_cpu() to iterate.
103 103
104Never use anything other than cpumask_t to represent bitmap of CPUs. 104Never use anything other than cpumask_t to represent bitmap of CPUs.
105 105
106 #include <linux/cpumask.h> 106 #include <linux/cpumask.h>
107 107
108 for_each_possible_cpu - Iterate over cpu_possible_map 108 for_each_possible_cpu - Iterate over cpu_possible_mask
109 for_each_online_cpu - Iterate over cpu_online_map 109 for_each_online_cpu - Iterate over cpu_online_mask
110 for_each_present_cpu - Iterate over cpu_present_map 110 for_each_present_cpu - Iterate over cpu_present_mask
111 for_each_cpu_mask(x,mask) - Iterate over some random collection of cpu mask. 111 for_each_cpu_mask(x,mask) - Iterate over some random collection of cpu mask.
112 112
113 #include <linux/cpu.h> 113 #include <linux/cpu.h>
114 get_online_cpus() and put_online_cpus(): 114 get_online_cpus() and put_online_cpus():
115 115
116The above calls are used to inhibit cpu hotplug operations. While the 116The above calls are used to inhibit cpu hotplug operations. While the
117cpu_hotplug.refcount is non zero, the cpu_online_map will not change. 117cpu_hotplug.refcount is non zero, the cpu_online_mask will not change.
118If you merely need to avoid cpus going away, you could also use 118If you merely need to avoid cpus going away, you could also use
119preempt_disable() and preempt_enable() for those sections. 119preempt_disable() and preempt_enable() for those sections.
120Just remember the critical section cannot call any 120Just remember the critical section cannot call any
diff --git a/Documentation/cpuidle/sysfs.txt b/Documentation/cpuidle/sysfs.txt
index 50d7b1642759..9d28a3406e74 100644
--- a/Documentation/cpuidle/sysfs.txt
+++ b/Documentation/cpuidle/sysfs.txt
@@ -36,6 +36,7 @@ drwxr-xr-x 2 root root 0 Feb 8 10:42 state3
36/sys/devices/system/cpu/cpu0/cpuidle/state0: 36/sys/devices/system/cpu/cpu0/cpuidle/state0:
37total 0 37total 0
38-r--r--r-- 1 root root 4096 Feb 8 10:42 desc 38-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
39-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
39-r--r--r-- 1 root root 4096 Feb 8 10:42 latency 40-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
40-r--r--r-- 1 root root 4096 Feb 8 10:42 name 41-r--r--r-- 1 root root 4096 Feb 8 10:42 name
41-r--r--r-- 1 root root 4096 Feb 8 10:42 power 42-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -45,6 +46,7 @@ total 0
45/sys/devices/system/cpu/cpu0/cpuidle/state1: 46/sys/devices/system/cpu/cpu0/cpuidle/state1:
46total 0 47total 0
47-r--r--r-- 1 root root 4096 Feb 8 10:42 desc 48-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
49-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
48-r--r--r-- 1 root root 4096 Feb 8 10:42 latency 50-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
49-r--r--r-- 1 root root 4096 Feb 8 10:42 name 51-r--r--r-- 1 root root 4096 Feb 8 10:42 name
50-r--r--r-- 1 root root 4096 Feb 8 10:42 power 52-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -54,6 +56,7 @@ total 0
54/sys/devices/system/cpu/cpu0/cpuidle/state2: 56/sys/devices/system/cpu/cpu0/cpuidle/state2:
55total 0 57total 0
56-r--r--r-- 1 root root 4096 Feb 8 10:42 desc 58-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
59-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
57-r--r--r-- 1 root root 4096 Feb 8 10:42 latency 60-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
58-r--r--r-- 1 root root 4096 Feb 8 10:42 name 61-r--r--r-- 1 root root 4096 Feb 8 10:42 name
59-r--r--r-- 1 root root 4096 Feb 8 10:42 power 62-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -63,6 +66,7 @@ total 0
63/sys/devices/system/cpu/cpu0/cpuidle/state3: 66/sys/devices/system/cpu/cpu0/cpuidle/state3:
64total 0 67total 0
65-r--r--r-- 1 root root 4096 Feb 8 10:42 desc 68-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
69-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
66-r--r--r-- 1 root root 4096 Feb 8 10:42 latency 70-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
67-r--r--r-- 1 root root 4096 Feb 8 10:42 name 71-r--r--r-- 1 root root 4096 Feb 8 10:42 name
68-r--r--r-- 1 root root 4096 Feb 8 10:42 power 72-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -72,6 +76,7 @@ total 0
72 76
73 77
74* desc : Small description about the idle state (string) 78* desc : Small description about the idle state (string)
79* disable : Option to disable this idle state (bool)
75* latency : Latency to exit out of this idle state (in microseconds) 80* latency : Latency to exit out of this idle state (in microseconds)
76* name : Name of the idle state (string) 81* name : Name of the idle state (string)
77* power : Power consumed while in this idle state (in milliwatts) 82* power : Power consumed while in this idle state (in milliwatts)
diff --git a/Documentation/device-mapper/thin-provisioning.txt b/Documentation/device-mapper/thin-provisioning.txt
index 1ff044d87ca4..3370bc4d7b98 100644
--- a/Documentation/device-mapper/thin-provisioning.txt
+++ b/Documentation/device-mapper/thin-provisioning.txt
@@ -75,10 +75,12 @@ less sharing than average you'll need a larger-than-average metadata device.
75 75
76As a guide, we suggest you calculate the number of bytes to use in the 76As a guide, we suggest you calculate the number of bytes to use in the
77metadata device as 48 * $data_dev_size / $data_block_size but round it up 77metadata device as 48 * $data_dev_size / $data_block_size but round it up
78to 2MB if the answer is smaller. The largest size supported is 16GB. 78to 2MB if the answer is smaller. If you're creating large numbers of
79snapshots which are recording large amounts of change, you may find you
80need to increase this.
79 81
80If you're creating large numbers of snapshots which are recording large 82The largest size supported is 16GB: If the device is larger,
81amounts of change, you may need find you need to increase this. 83a warning will be issued and the excess space will not be used.
82 84
83Reloading a pool table 85Reloading a pool table
84---------------------- 86----------------------
@@ -167,6 +169,38 @@ ii) Using an internal snapshot.
167 169
168 dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1" 170 dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1"
169 171
172External snapshots
173------------------
174
175You can use an external _read only_ device as an origin for a
176thinly-provisioned volume. Any read to an unprovisioned area of the
177thin device will be passed through to the origin. Writes trigger
178the allocation of new blocks as usual.
179
180One use case for this is VM hosts that want to run guests on
181thinly-provisioned volumes but have the base image on another device
182(possibly shared between many VMs).
183
184You must not write to the origin device if you use this technique!
185Of course, you may write to the thin device and take internal snapshots
186of the thin volume.
187
188i) Creating a snapshot of an external device
189
190 This is the same as creating a thin device.
191 You don't mention the origin at this stage.
192
193 dmsetup message /dev/mapper/pool 0 "create_thin 0"
194
195ii) Using a snapshot of an external device.
196
197 Append an extra parameter to the thin target specifying the origin:
198
199 dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 0 /dev/image"
200
201 N.B. All descendants (internal snapshots) of this snapshot require the
202 same extra origin parameter.
203
170Deactivation 204Deactivation
171------------ 205------------
172 206
@@ -189,7 +223,13 @@ i) Constructor
189 <low water mark (blocks)> [<number of feature args> [<arg>]*] 223 <low water mark (blocks)> [<number of feature args> [<arg>]*]
190 224
191 Optional feature arguments: 225 Optional feature arguments:
192 - 'skip_block_zeroing': skips the zeroing of newly-provisioned blocks. 226
227 skip_block_zeroing: Skip the zeroing of newly-provisioned blocks.
228
229 ignore_discard: Disable discard support.
230
231 no_discard_passdown: Don't pass discards down to the underlying
232 data device, but just remove the mapping.
193 233
194 Data block size must be between 64KB (128 sectors) and 1GB 234 Data block size must be between 64KB (128 sectors) and 1GB
195 (2097152 sectors) inclusive. 235 (2097152 sectors) inclusive.
@@ -237,16 +277,6 @@ iii) Messages
237 277
238 Deletes a thin device. Irreversible. 278 Deletes a thin device. Irreversible.
239 279
240 trim <dev id> <new size in sectors>
241
242 Delete mappings from the end of a thin device. Irreversible.
243 You might want to use this if you're reducing the size of
244 your thinly-provisioned device. In many cases, due to the
245 sharing of blocks between devices, it is not possible to
246 determine in advance how much space 'trim' will release. (In
247 future a userspace tool might be able to perform this
248 calculation.)
249
250 set_transaction_id <current id> <new id> 280 set_transaction_id <current id> <new id>
251 281
252 Userland volume managers, such as LVM, need a way to 282 Userland volume managers, such as LVM, need a way to
@@ -262,7 +292,7 @@ iii) Messages
262 292
263i) Constructor 293i) Constructor
264 294
265 thin <pool dev> <dev id> 295 thin <pool dev> <dev id> [<external origin dev>]
266 296
267 pool dev: 297 pool dev:
268 the thin-pool device, e.g. /dev/mapper/my_pool or 253:0 298 the thin-pool device, e.g. /dev/mapper/my_pool or 253:0
@@ -271,6 +301,11 @@ i) Constructor
271 the internal device identifier of the device to be 301 the internal device identifier of the device to be
272 activated. 302 activated.
273 303
304 external origin dev:
305 an optional block device outside the pool to be treated as a
306 read-only snapshot origin: reads to unprovisioned areas of the
307 thin target will be mapped to this device.
308
274The pool doesn't store any size against the thin devices. If you 309The pool doesn't store any size against the thin devices. If you
275load a thin target that is smaller than you've been using previously, 310load a thin target that is smaller than you've been using previously,
276then you'll have no access to blocks mapped beyond the end. If you 311then you'll have no access to blocks mapped beyond the end. If you
diff --git a/Documentation/device-mapper/verity.txt b/Documentation/device-mapper/verity.txt
new file mode 100644
index 000000000000..32e48797a14f
--- /dev/null
+++ b/Documentation/device-mapper/verity.txt
@@ -0,0 +1,194 @@
1dm-verity
2==========
3
4Device-Mapper's "verity" target provides transparent integrity checking of
5block devices using a cryptographic digest provided by the kernel crypto API.
6This target is read-only.
7
8Construction Parameters
9=======================
10 <version> <dev> <hash_dev> <hash_start>
11 <data_block_size> <hash_block_size>
12 <num_data_blocks> <hash_start_block>
13 <algorithm> <digest> <salt>
14
15<version>
16 This is the version number of the on-disk format.
17
18 0 is the original format used in the Chromium OS.
19 The salt is appended when hashing, digests are stored continuously and
20 the rest of the block is padded with zeros.
21
22 1 is the current format that should be used for new devices.
23 The salt is prepended when hashing and each digest is
24 padded with zeros to the power of two.
25
26<dev>
27 This is the device containing the data the integrity of which needs to be
28 checked. It may be specified as a path, like /dev/sdaX, or a device number,
29 <major>:<minor>.
30
31<hash_dev>
32 This is the device that that supplies the hash tree data. It may be
33 specified similarly to the device path and may be the same device. If the
34 same device is used, the hash_start should be outside of the dm-verity
35 configured device size.
36
37<data_block_size>
38 The block size on a data device. Each block corresponds to one digest on
39 the hash device.
40
41<hash_block_size>
42 The size of a hash block.
43
44<num_data_blocks>
45 The number of data blocks on the data device. Additional blocks are
46 inaccessible. You can place hashes to the same partition as data, in this
47 case hashes are placed after <num_data_blocks>.
48
49<hash_start_block>
50 This is the offset, in <hash_block_size>-blocks, from the start of hash_dev
51 to the root block of the hash tree.
52
53<algorithm>
54 The cryptographic hash algorithm used for this device. This should
55 be the name of the algorithm, like "sha1".
56
57<digest>
58 The hexadecimal encoding of the cryptographic hash of the root hash block
59 and the salt. This hash should be trusted as there is no other authenticity
60 beyond this point.
61
62<salt>
63 The hexadecimal encoding of the salt value.
64
65Theory of operation
66===================
67
68dm-verity is meant to be setup as part of a verified boot path. This
69may be anything ranging from a boot using tboot or trustedgrub to just
70booting from a known-good device (like a USB drive or CD).
71
72When a dm-verity device is configured, it is expected that the caller
73has been authenticated in some way (cryptographic signatures, etc).
74After instantiation, all hashes will be verified on-demand during
75disk access. If they cannot be verified up to the root node of the
76tree, the root hash, then the I/O will fail. This should identify
77tampering with any data on the device and the hash data.
78
79Cryptographic hashes are used to assert the integrity of the device on a
80per-block basis. This allows for a lightweight hash computation on first read
81into the page cache. Block hashes are stored linearly-aligned to the nearest
82block the size of a page.
83
84Hash Tree
85---------
86
87Each node in the tree is a cryptographic hash. If it is a leaf node, the hash
88is of some block data on disk. If it is an intermediary node, then the hash is
89of a number of child nodes.
90
91Each entry in the tree is a collection of neighboring nodes that fit in one
92block. The number is determined based on block_size and the size of the
93selected cryptographic digest algorithm. The hashes are linearly-ordered in
94this entry and any unaligned trailing space is ignored but included when
95calculating the parent node.
96
97The tree looks something like:
98
99alg = sha256, num_blocks = 32768, block_size = 4096
100
101 [ root ]
102 / . . . \
103 [entry_0] [entry_1]
104 / . . . \ . . . \
105 [entry_0_0] . . . [entry_0_127] . . . . [entry_1_127]
106 / ... \ / . . . \ / \
107 blk_0 ... blk_127 blk_16256 blk_16383 blk_32640 . . . blk_32767
108
109
110On-disk format
111==============
112
113Below is the recommended on-disk format. The verity kernel code does not
114read the on-disk header. It only reads the hash blocks which directly
115follow the header. It is expected that a user-space tool will verify the
116integrity of the verity_header and then call dmsetup with the correct
117parameters. Alternatively, the header can be omitted and the dmsetup
118parameters can be passed via the kernel command-line in a rooted chain
119of trust where the command-line is verified.
120
121The on-disk format is especially useful in cases where the hash blocks
122are on a separate partition. The magic number allows easy identification
123of the partition contents. Alternatively, the hash blocks can be stored
124in the same partition as the data to be verified. In such a configuration
125the filesystem on the partition would be sized a little smaller than
126the full-partition, leaving room for the hash blocks.
127
128struct superblock {
129 uint8_t signature[8]
130 "verity\0\0";
131
132 uint8_t version;
133 1 - current format
134
135 uint8_t data_block_bits;
136 log2(data block size)
137
138 uint8_t hash_block_bits;
139 log2(hash block size)
140
141 uint8_t pad1[1];
142 zero padding
143
144 uint16_t salt_size;
145 big-endian salt size
146
147 uint8_t pad2[2];
148 zero padding
149
150 uint32_t data_blocks_hi;
151 big-endian high 32 bits of the 64-bit number of data blocks
152
153 uint32_t data_blocks_lo;
154 big-endian low 32 bits of the 64-bit number of data blocks
155
156 uint8_t algorithm[16];
157 cryptographic algorithm
158
159 uint8_t salt[384];
160 salt (the salt size is specified above)
161
162 uint8_t pad3[88];
163 zero padding to 512-byte boundary
164}
165
166Directly following the header (and with sector number padded to the next hash
167block boundary) are the hash blocks which are stored a depth at a time
168(starting from the root), sorted in order of increasing index.
169
170Status
171======
172V (for Valid) is returned if every check performed so far was valid.
173If any check failed, C (for Corruption) is returned.
174
175Example
176=======
177
178Setup a device:
179 dmsetup create vroot --table \
180 "0 2097152 "\
181 "verity 1 /dev/sda1 /dev/sda2 4096 4096 2097152 1 "\
182 "4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076 "\
183 "1234000000000000000000000000000000000000000000000000000000000000"
184
185A command line tool veritysetup is available to compute or verify
186the hash tree or activate the kernel driver. This is available from
187the LVM2 upstream repository and may be supplied as a package called
188device-mapper-verity-tools:
189 git://sources.redhat.com/git/lvm2
190 http://sourceware.org/git/?p=lvm2.git
191 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/verity?cvsroot=lvm2
192
193veritysetup -a vroot /dev/sda1 /dev/sda2 \
194 4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076
diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt
index 1aeaf6f2a1ba..ecc81e368715 100644
--- a/Documentation/devicetree/bindings/arm/atmel-at91.txt
+++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt
@@ -30,3 +30,63 @@ One interrupt per TC channel in a TC block:
30 reg = <0xfffdc000 0x100>; 30 reg = <0xfffdc000 0x100>;
31 interrupts = <26 4 27 4 28 4>; 31 interrupts = <26 4 27 4 28 4>;
32 }; 32 };
33
34RSTC Reset Controller required properties:
35- compatible: Should be "atmel,<chip>-rstc".
36 <chip> can be "at91sam9260" or "at91sam9g45"
37- reg: Should contain registers location and length
38
39Example:
40
41 rstc@fffffd00 {
42 compatible = "atmel,at91sam9260-rstc";
43 reg = <0xfffffd00 0x10>;
44 };
45
46RAMC SDRAM/DDR Controller required properties:
47- compatible: Should be "atmel,at91sam9260-sdramc",
48 "atmel,at91sam9g45-ddramc",
49- reg: Should contain registers location and length
50 For at91sam9263 and at91sam9g45 you must specify 2 entries.
51
52Examples:
53
54 ramc0: ramc@ffffe800 {
55 compatible = "atmel,at91sam9g45-ddramc";
56 reg = <0xffffe800 0x200>;
57 };
58
59 ramc0: ramc@ffffe400 {
60 compatible = "atmel,at91sam9g45-ddramc";
61 reg = <0xffffe400 0x200
62 0xffffe600 0x200>;
63 };
64
65SHDWC Shutdown Controller
66
67required properties:
68- compatible: Should be "atmel,<chip>-shdwc".
69 <chip> can be "at91sam9260", "at91sam9rl" or "at91sam9x5".
70- reg: Should contain registers location and length
71
72optional properties:
73- atmel,wakeup-mode: String, operation mode of the wakeup mode.
74 Supported values are: "none", "high", "low", "any".
75- atmel,wakeup-counter: Counter on Wake-up 0 (between 0x0 and 0xf).
76
77optional at91sam9260 properties:
78- atmel,wakeup-rtt-timer: boolean to enable Real-time Timer Wake-up.
79
80optional at91sam9rl properties:
81- atmel,wakeup-rtc-timer: boolean to enable Real-time Clock Wake-up.
82- atmel,wakeup-rtt-timer: boolean to enable Real-time Timer Wake-up.
83
84optional at91sam9x5 properties:
85- atmel,wakeup-rtc-timer: boolean to enable Real-time Clock Wake-up.
86
87Example:
88
89 rstc@fffffd00 {
90 compatible = "atmel,at91sam9260-rstc";
91 reg = <0xfffffd00 0x10>;
92 };
diff --git a/Documentation/devicetree/bindings/arm/atmel-pmc.txt b/Documentation/devicetree/bindings/arm/atmel-pmc.txt
new file mode 100644
index 000000000000..389bed5056e8
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/atmel-pmc.txt
@@ -0,0 +1,11 @@
1* Power Management Controller (PMC)
2
3Required properties:
4- compatible: Should be "atmel,at91rm9200-pmc"
5- reg: Should contain PMC registers location and length
6
7Examples:
8 pmc: pmc@fffffc00 {
9 compatible = "atmel,at91rm9200-pmc";
10 reg = <0xfffffc00 0x100>;
11 };
diff --git a/Documentation/devicetree/bindings/arm/spear.txt b/Documentation/devicetree/bindings/arm/spear.txt
new file mode 100644
index 000000000000..f8e54f092328
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/spear.txt
@@ -0,0 +1,8 @@
1ST SPEAr Platforms Device Tree Bindings
2---------------------------------------
3
4Boards with the ST SPEAr600 SoC shall have the following properties:
5
6Required root node property:
7
8compatible = "st,spear600";
diff --git a/Documentation/devicetree/bindings/gpio/gpio-omap.txt b/Documentation/devicetree/bindings/gpio/gpio-omap.txt
new file mode 100644
index 000000000000..bff51a2fee1e
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-omap.txt
@@ -0,0 +1,36 @@
1OMAP GPIO controller bindings
2
3Required properties:
4- compatible:
5 - "ti,omap2-gpio" for OMAP2 controllers
6 - "ti,omap3-gpio" for OMAP3 controllers
7 - "ti,omap4-gpio" for OMAP4 controllers
8- #gpio-cells : Should be two.
9 - first cell is the pin number
10 - second cell is used to specify optional parameters (unused)
11- gpio-controller : Marks the device node as a GPIO controller.
12- #interrupt-cells : Should be 2.
13- interrupt-controller: Mark the device node as an interrupt controller
14 The first cell is the GPIO number.
15 The second cell is used to specify flags:
16 bits[3:0] trigger type and level flags:
17 1 = low-to-high edge triggered.
18 2 = high-to-low edge triggered.
19 4 = active high level-sensitive.
20 8 = active low level-sensitive.
21
22OMAP specific properties:
23- ti,hwmods: Name of the hwmod associated to the GPIO:
24 "gpio<X>", <X> being the 1-based instance number from the HW spec
25
26
27Example:
28
29gpio4: gpio4 {
30 compatible = "ti,omap4-gpio";
31 ti,hwmods = "gpio4";
32 #gpio-cells = <2>;
33 gpio-controller;
34 #interrupt-cells = <2>;
35 interrupt-controller;
36};
diff --git a/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt b/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt
new file mode 100644
index 000000000000..16695d9cf1e8
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt
@@ -0,0 +1,23 @@
1twl4030 GPIO controller bindings
2
3Required properties:
4- compatible:
5 - "ti,twl4030-gpio" for twl4030 GPIO controller
6- #gpio-cells : Should be two.
7 - first cell is the pin number
8 - second cell is used to specify optional parameters (unused)
9- gpio-controller : Marks the device node as a GPIO controller.
10- #interrupt-cells : Should be 2.
11- interrupt-controller: Mark the device node as an interrupt controller
12 The first cell is the GPIO number.
13 The second cell is not used.
14
15Example:
16
17twl_gpio: gpio {
18 compatible = "ti,twl4030-gpio";
19 #gpio-cells = <2>;
20 gpio-controller;
21 #interrupt-cells = <2>;
22 interrupt-controller;
23};
diff --git a/Documentation/devicetree/bindings/gpio/gpio_i2c.txt b/Documentation/devicetree/bindings/gpio/gpio_i2c.txt
new file mode 100644
index 000000000000..4f8ec947c6bd
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio_i2c.txt
@@ -0,0 +1,32 @@
1Device-Tree bindings for i2c gpio driver
2
3Required properties:
4 - compatible = "i2c-gpio";
5 - gpios: sda and scl gpio
6
7
8Optional properties:
9 - i2c-gpio,sda-open-drain: sda as open drain
10 - i2c-gpio,scl-open-drain: scl as open drain
11 - i2c-gpio,scl-output-only: scl as output only
12 - i2c-gpio,delay-us: delay between GPIO operations (may depend on each platform)
13 - i2c-gpio,timeout-ms: timeout to get data
14
15Example nodes:
16
17i2c@0 {
18 compatible = "i2c-gpio";
19 gpios = <&pioA 23 0 /* sda */
20 &pioA 24 0 /* scl */
21 >;
22 i2c-gpio,sda-open-drain;
23 i2c-gpio,scl-open-drain;
24 i2c-gpio,delay-us = <2>; /* ~100 kHz */
25 #address-cells = <1>;
26 #size-cells = <0>;
27
28 rv3029c2@56 {
29 compatible = "rv3029c2";
30 reg = <0x56>;
31 };
32};
diff --git a/Documentation/devicetree/bindings/gpio/sodaville.txt b/Documentation/devicetree/bindings/gpio/sodaville.txt
new file mode 100644
index 000000000000..563eff22b975
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/sodaville.txt
@@ -0,0 +1,48 @@
1GPIO controller on CE4100 / Sodaville SoCs
2==========================================
3
4The bindings for CE4100's GPIO controller match the generic description
5which is covered by the gpio.txt file in this folder.
6
7The only additional property is the intel,muxctl property which holds the
8value which is written into the MUXCNTL register.
9
10There is no compatible property for now because the driver is probed via
11PCI id (vendor 0x8086 device 0x2e67).
12
13The interrupt specifier consists of two cells encoded as follows:
14 - <1st cell>: The interrupt-number that identifies the interrupt source.
15 - <2nd cell>: The level-sense information, encoded as follows:
16 4 - active high level-sensitive
17 8 - active low level-sensitive
18
19Example of the GPIO device and one user:
20
21 pcigpio: gpio@b,1 {
22 /* two cells for GPIO and interrupt */
23 #gpio-cells = <2>;
24 #interrupt-cells = <2>;
25 compatible = "pci8086,2e67.2",
26 "pci8086,2e67",
27 "pciclassff0000",
28 "pciclassff00";
29
30 reg = <0x15900 0x0 0x0 0x0 0x0>;
31 /* Interrupt line of the gpio device */
32 interrupts = <15 1>;
33 /* It is an interrupt and GPIO controller itself */
34 interrupt-controller;
35 gpio-controller;
36 intel,muxctl = <0>;
37 };
38
39 testuser@20 {
40 compatible = "example,testuser";
41 /* User the 11th GPIO line as an active high triggered
42 * level interrupt
43 */
44 interrupts = <11 8>;
45 interrupt-parent = <&pcigpio>;
46 /* Use this GPIO also with the gpio functions */
47 gpios = <&pcigpio 11 0>;
48 };
diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
new file mode 100644
index 000000000000..dbd4368ab8cc
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
@@ -0,0 +1,33 @@
1* TI Highspeed MMC host controller for OMAP
2
3The Highspeed MMC Host Controller on TI OMAP family
4provides an interface for MMC, SD, and SDIO types of memory cards.
5
6Required properties:
7- compatible:
8 Should be "ti,omap2-hsmmc", for OMAP2 controllers
9 Should be "ti,omap3-hsmmc", for OMAP3 controllers
10 Should be "ti,omap4-hsmmc", for OMAP4 controllers
11- ti,hwmods: Must be "mmc<n>", n is controller instance starting 1
12- reg : should contain hsmmc registers location and length
13
14Optional properties:
15ti,dual-volt: boolean, supports dual voltage cards
16<supply-name>-supply: phandle to the regulator device tree node
17"supply-name" examples are "vmmc", "vmmc_aux" etc
18ti,bus-width: Number of data lines, default assumed is 1 if the property is missing.
19cd-gpios: GPIOs for card detection
20wp-gpios: GPIOs for write protection
21ti,non-removable: non-removable slot (like eMMC)
22ti,needs-special-reset: Requires a special softreset sequence
23
24Example:
25 mmc1: mmc@0x4809c000 {
26 compatible = "ti,omap4-hsmmc";
27 reg = <0x4809c000 0x400>;
28 ti,hwmods = "mmc1";
29 ti,dual-volt;
30 ti,bus-width = <4>;
31 vmmc-supply = <&vmmc>; /* phandle to regulator node */
32 ti,non-removable;
33 };
diff --git a/Documentation/devicetree/bindings/mtd/arm-versatile.txt b/Documentation/devicetree/bindings/mtd/arm-versatile.txt
index 476845db94d0..beace4b89daa 100644
--- a/Documentation/devicetree/bindings/mtd/arm-versatile.txt
+++ b/Documentation/devicetree/bindings/mtd/arm-versatile.txt
@@ -4,5 +4,5 @@ Required properties:
4- compatible : must be "arm,versatile-flash"; 4- compatible : must be "arm,versatile-flash";
5- bank-width : width in bytes of flash interface. 5- bank-width : width in bytes of flash interface.
6 6
7Optional properties: 7The device tree may optionally contain sub-nodes describing partitions of the
8- Subnode partition map from mtd flash binding 8address space. See partition.txt for more detail.
diff --git a/Documentation/devicetree/bindings/mtd/atmel-dataflash.txt b/Documentation/devicetree/bindings/mtd/atmel-dataflash.txt
index ef66ddd01da0..1889a4db5b7c 100644
--- a/Documentation/devicetree/bindings/mtd/atmel-dataflash.txt
+++ b/Documentation/devicetree/bindings/mtd/atmel-dataflash.txt
@@ -3,6 +3,9 @@
3Required properties: 3Required properties:
4- compatible : "atmel,<model>", "atmel,<series>", "atmel,dataflash". 4- compatible : "atmel,<model>", "atmel,<series>", "atmel,dataflash".
5 5
6The device tree may optionally contain sub-nodes describing partitions of the
7address space. See partition.txt for more detail.
8
6Example: 9Example:
7 10
8flash@1 { 11flash@1 {
diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
new file mode 100644
index 000000000000..a20069502f5a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
@@ -0,0 +1,41 @@
1Atmel NAND flash
2
3Required properties:
4- compatible : "atmel,at91rm9200-nand".
5- reg : should specify localbus address and size used for the chip,
6 and if availlable the ECC.
7- atmel,nand-addr-offset : offset for the address latch.
8- atmel,nand-cmd-offset : offset for the command latch.
9- #address-cells, #size-cells : Must be present if the device has sub-nodes
10 representing partitions.
11
12- gpios : specifies the gpio pins to control the NAND device. detect is an
13 optional gpio and may be set to 0 if not present.
14
15Optional properties:
16- nand-ecc-mode : String, operation mode of the NAND ecc mode, soft by default.
17 Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first",
18 "soft_bch".
19- nand-bus-width : 8 or 16 bus width if not present 8
20- nand-on-flash-bbt: boolean to enable on flash bbt option if not present false
21
22Examples:
23nand0: nand@40000000,0 {
24 compatible = "atmel,at91rm9200-nand";
25 #address-cells = <1>;
26 #size-cells = <1>;
27 reg = <0x40000000 0x10000000
28 0xffffe800 0x200
29 >;
30 atmel,nand-addr-offset = <21>; /* ale */
31 atmel,nand-cmd-offset = <22>; /* cle */
32 nand-on-flash-bbt;
33 nand-ecc-mode = "soft";
34 gpios = <&pioC 13 0 /* rdy */
35 &pioC 14 0 /* nce */
36 0 /* cd */
37 >;
38 partition@0 {
39 ...
40 };
41};
diff --git a/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
index 00f1f546b32e..fce4894f5a98 100644
--- a/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
@@ -19,6 +19,10 @@ Optional properties:
19 read registers (tR). Required if property "gpios" is not used 19 read registers (tR). Required if property "gpios" is not used
20 (R/B# pins not connected). 20 (R/B# pins not connected).
21 21
22Each flash chip described may optionally contain additional sub-nodes
23describing partitions of the address space. See partition.txt for more
24detail.
25
22Examples: 26Examples:
23 27
24upm@1,0 { 28upm@1,0 {
diff --git a/Documentation/devicetree/bindings/mtd/fsmc-nand.txt b/Documentation/devicetree/bindings/mtd/fsmc-nand.txt
new file mode 100644
index 000000000000..e2c663b354d2
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/fsmc-nand.txt
@@ -0,0 +1,33 @@
1* FSMC NAND
2
3Required properties:
4- compatible : "st,spear600-fsmc-nand"
5- reg : Address range of the mtd chip
6- reg-names: Should contain the reg names "fsmc_regs" and "nand_data"
7- st,ale-off : Chip specific offset to ALE
8- st,cle-off : Chip specific offset to CLE
9
10Optional properties:
11- bank-width : Width (in bytes) of the device. If not present, the width
12 defaults to 1 byte
13- nand-skip-bbtscan: Indicates the the BBT scanning should be skipped
14
15Example:
16
17 fsmc: flash@d1800000 {
18 compatible = "st,spear600-fsmc-nand";
19 #address-cells = <1>;
20 #size-cells = <1>;
21 reg = <0xd1800000 0x1000 /* FSMC Register */
22 0xd2000000 0x4000>; /* NAND Base */
23 reg-names = "fsmc_regs", "nand_data";
24 st,ale-off = <0x20000>;
25 st,cle-off = <0x10000>;
26
27 bank-width = <1>;
28 nand-skip-bbtscan;
29
30 partition@0 {
31 ...
32 };
33 };
diff --git a/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt b/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt
index 719f4dc58df7..36ef07d3c90f 100644
--- a/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt
@@ -25,6 +25,9 @@ Optional properties:
25 GPIO state and before and after command byte writes, this register will be 25 GPIO state and before and after command byte writes, this register will be
26 read to ensure that the GPIO accesses have completed. 26 read to ensure that the GPIO accesses have completed.
27 27
28The device tree may optionally contain sub-nodes describing partitions of the
29address space. See partition.txt for more detail.
30
28Examples: 31Examples:
29 32
30gpio-nand@1,0 { 33gpio-nand@1,0 {
diff --git a/Documentation/devicetree/bindings/mtd/mtd-physmap.txt b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt
index 80152cb567d9..a63c2bd7de2b 100644
--- a/Documentation/devicetree/bindings/mtd/mtd-physmap.txt
+++ b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt
@@ -23,27 +23,8 @@ are defined:
23 - vendor-id : Contains the flash chip's vendor id (1 byte). 23 - vendor-id : Contains the flash chip's vendor id (1 byte).
24 - device-id : Contains the flash chip's device id (1 byte). 24 - device-id : Contains the flash chip's device id (1 byte).
25 25
26In addition to the information on the mtd bank itself, the 26The device tree may optionally contain sub-nodes describing partitions of the
27device tree may optionally contain additional information 27address space. See partition.txt for more detail.
28describing partitions of the address space. This can be
29used on platforms which have strong conventions about which
30portions of a flash are used for what purposes, but which don't
31use an on-flash partition table such as RedBoot.
32
33Each partition is represented as a sub-node of the mtd device.
34Each node's name represents the name of the corresponding
35partition of the mtd device.
36
37Flash partitions
38 - reg : The partition's offset and size within the mtd bank.
39 - label : (optional) The label / name for this partition.
40 If omitted, the label is taken from the node name (excluding
41 the unit address).
42 - read-only : (optional) This parameter, if present, is a hint to
43 Linux that this partition should only be mounted
44 read-only. This is usually used for flash partitions
45 containing early-boot firmware images or data which should not
46 be clobbered.
47 28
48Example: 29Example:
49 30
diff --git a/Documentation/devicetree/bindings/mtd/nand.txt b/Documentation/devicetree/bindings/mtd/nand.txt
new file mode 100644
index 000000000000..03855c8c492a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/nand.txt
@@ -0,0 +1,7 @@
1* MTD generic binding
2
3- nand-ecc-mode : String, operation mode of the NAND ecc mode.
4 Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first",
5 "soft_bch".
6- nand-bus-width : 8 or 16 bus width if not present 8
7- nand-on-flash-bbt: boolean to enable on flash bbt option if not present false
diff --git a/Documentation/devicetree/bindings/mtd/partition.txt b/Documentation/devicetree/bindings/mtd/partition.txt
new file mode 100644
index 000000000000..f114ce1657c2
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/partition.txt
@@ -0,0 +1,38 @@
1Representing flash partitions in devicetree
2
3Partitions can be represented by sub-nodes of an mtd device. This can be used
4on platforms which have strong conventions about which portions of a flash are
5used for what purposes, but which don't use an on-flash partition table such
6as RedBoot.
7
8#address-cells & #size-cells must both be present in the mtd device and be
9equal to 1.
10
11Required properties:
12- reg : The partition's offset and size within the mtd bank.
13
14Optional properties:
15- label : The label / name for this partition. If omitted, the label is taken
16 from the node name (excluding the unit address).
17- read-only : This parameter, if present, is a hint to Linux that this
18 partition should only be mounted read-only. This is usually used for flash
19 partitions containing early-boot firmware images or data which should not be
20 clobbered.
21
22Examples:
23
24
25flash@0 {
26 #address-cells = <1>;
27 #size-cells = <1>;
28
29 partition@0 {
30 label = "u-boot";
31 reg = <0x0000000 0x100000>;
32 read-only;
33 };
34
35 uimage@100000 {
36 reg = <0x0100000 0x200000>;
37 };
38];
diff --git a/Documentation/devicetree/bindings/mtd/spear_smi.txt b/Documentation/devicetree/bindings/mtd/spear_smi.txt
new file mode 100644
index 000000000000..7248aadd89e4
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/spear_smi.txt
@@ -0,0 +1,31 @@
1* SPEAr SMI
2
3Required properties:
4- compatible : "st,spear600-smi"
5- reg : Address range of the mtd chip
6- #address-cells, #size-cells : Must be present if the device has sub-nodes
7 representing partitions.
8- interrupt-parent: Should be the phandle for the interrupt controller
9 that services interrupts for this device
10- interrupts: Should contain the STMMAC interrupts
11- clock-rate : Functional clock rate of SMI in Hz
12
13Optional properties:
14- st,smi-fast-mode : Flash supports read in fast mode
15
16Example:
17
18 smi: flash@fc000000 {
19 compatible = "st,spear600-smi";
20 #address-cells = <1>;
21 #size-cells = <1>;
22 reg = <0xfc000000 0x1000>;
23 interrupt-parent = <&vic1>;
24 interrupts = <12>;
25 clock-rate = <50000000>; /* 50MHz */
26
27 flash@f8000000 {
28 st,smi-fast-mode;
29 ...
30 };
31 };
diff --git a/Documentation/devicetree/bindings/power_supply/max17042_battery.txt b/Documentation/devicetree/bindings/power_supply/max17042_battery.txt
new file mode 100644
index 000000000000..5bc9b685cf8a
--- /dev/null
+++ b/Documentation/devicetree/bindings/power_supply/max17042_battery.txt
@@ -0,0 +1,18 @@
1max17042_battery
2~~~~~~~~~~~~~~~~
3
4Required properties :
5 - compatible : "maxim,max17042"
6
7Optional properties :
8 - maxim,rsns-microohm : Resistance of rsns resistor in micro Ohms
9 (datasheet-recommended value is 10000).
10 Defining this property enables current-sense functionality.
11
12Example:
13
14 battery-charger@36 {
15 compatible = "maxim,max17042";
16 reg = <0x36>;
17 maxim,rsns-microohm = <10000>;
18 };
diff --git a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
new file mode 100644
index 000000000000..357758cb6e92
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
@@ -0,0 +1,29 @@
1Anatop Voltage regulators
2
3Required properties:
4- compatible: Must be "fsl,anatop-regulator"
5- anatop-reg-offset: Anatop MFD register offset
6- anatop-vol-bit-shift: Bit shift for the register
7- anatop-vol-bit-width: Number of bits used in the register
8- anatop-min-bit-val: Minimum value of this register
9- anatop-min-voltage: Minimum voltage of this regulator
10- anatop-max-voltage: Maximum voltage of this regulator
11
12Any property defined as part of the core regulator
13binding, defined in regulator.txt, can also be used.
14
15Example:
16
17 regulator-vddpu {
18 compatible = "fsl,anatop-regulator";
19 regulator-name = "vddpu";
20 regulator-min-microvolt = <725000>;
21 regulator-max-microvolt = <1300000>;
22 regulator-always-on;
23 anatop-reg-offset = <0x140>;
24 anatop-vol-bit-shift = <9>;
25 anatop-vol-bit-width = <5>;
26 anatop-min-bit-val = <1>;
27 anatop-min-voltage = <725000>;
28 anatop-max-voltage = <1300000>;
29 };
diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.txt b/Documentation/devicetree/bindings/usb/atmel-usb.txt
new file mode 100644
index 000000000000..60bd2150a3e6
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/atmel-usb.txt
@@ -0,0 +1,49 @@
1Atmel SOC USB controllers
2
3OHCI
4
5Required properties:
6 - compatible: Should be "atmel,at91rm9200-ohci" for USB controllers
7 used in host mode.
8 - num-ports: Number of ports.
9 - atmel,vbus-gpio: If present, specifies a gpio that needs to be
10 activated for the bus to be powered.
11 - atmel,oc-gpio: If present, specifies a gpio that needs to be
12 activated for the overcurrent detection.
13
14usb0: ohci@00500000 {
15 compatible = "atmel,at91rm9200-ohci", "usb-ohci";
16 reg = <0x00500000 0x100000>;
17 interrupts = <20 4>;
18 num-ports = <2>;
19};
20
21EHCI
22
23Required properties:
24 - compatible: Should be "atmel,at91sam9g45-ehci" for USB controllers
25 used in host mode.
26
27usb1: ehci@00800000 {
28 compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
29 reg = <0x00800000 0x100000>;
30 interrupts = <22 4>;
31};
32
33AT91 USB device controller
34
35Required properties:
36 - compatible: Should be "atmel,at91rm9200-udc"
37 - reg: Address and length of the register set for the device
38 - interrupts: Should contain macb interrupt
39
40Optional properties:
41 - atmel,vbus-gpio: If present, specifies a gpio that needs to be
42 activated for the bus to be powered.
43
44usb1: gadget@fffa4000 {
45 compatible = "atmel,at91rm9200-udc";
46 reg = <0xfffa4000 0x4000>;
47 interrupts = <10 4>;
48 atmel,vbus-gpio = <&pioC 5 0>;
49};
diff --git a/Documentation/devicetree/bindings/usb/tegra-usb.txt b/Documentation/devicetree/bindings/usb/tegra-usb.txt
index 035d63d5646d..007005ddbe12 100644
--- a/Documentation/devicetree/bindings/usb/tegra-usb.txt
+++ b/Documentation/devicetree/bindings/usb/tegra-usb.txt
@@ -11,3 +11,16 @@ Required properties :
11 - phy_type : Should be one of "ulpi" or "utmi". 11 - phy_type : Should be one of "ulpi" or "utmi".
12 - nvidia,vbus-gpio : If present, specifies a gpio that needs to be 12 - nvidia,vbus-gpio : If present, specifies a gpio that needs to be
13 activated for the bus to be powered. 13 activated for the bus to be powered.
14
15Optional properties:
16 - dr_mode : dual role mode. Indicates the working mode for
17 nvidia,tegra20-ehci compatible controllers. Can be "host", "peripheral",
18 or "otg". Default to "host" if not defined for backward compatibility.
19 host means this is a host controller
20 peripheral means it is device controller
21 otg means it can operate as either ("on the go")
22 - nvidia,has-legacy-mode : boolean indicates whether this controller can
23 operate in legacy mode (as APX 2500 / 2600). In legacy mode some
24 registers are accessed through the APB_MISC base address instead of
25 the USB controller. Since this is a legacy issue it probably does not
26 warrant a compatible string of its own.
diff --git a/Documentation/devicetree/usage-model.txt b/Documentation/devicetree/usage-model.txt
new file mode 100644
index 000000000000..c5a80099b71c
--- /dev/null
+++ b/Documentation/devicetree/usage-model.txt
@@ -0,0 +1,412 @@
1Linux and the Device Tree
2-------------------------
3The Linux usage model for device tree data
4
5Author: Grant Likely <grant.likely@secretlab.ca>
6
7This article describes how Linux uses the device tree. An overview of
8the device tree data format can be found on the device tree usage page
9at devicetree.org[1].
10
11[1] http://devicetree.org/Device_Tree_Usage
12
13The "Open Firmware Device Tree", or simply Device Tree (DT), is a data
14structure and language for describing hardware. More specifically, it
15is a description of hardware that is readable by an operating system
16so that the operating system doesn't need to hard code details of the
17machine.
18
19Structurally, the DT is a tree, or acyclic graph with named nodes, and
20nodes may have an arbitrary number of named properties encapsulating
21arbitrary data. A mechanism also exists to create arbitrary
22links from one node to another outside of the natural tree structure.
23
24Conceptually, a common set of usage conventions, called 'bindings',
25is defined for how data should appear in the tree to describe typical
26hardware characteristics including data busses, interrupt lines, GPIO
27connections, and peripheral devices.
28
29As much as possible, hardware is described using existing bindings to
30maximize use of existing support code, but since property and node
31names are simply text strings, it is easy to extend existing bindings
32or create new ones by defining new nodes and properties. Be wary,
33however, of creating a new binding without first doing some homework
34about what already exists. There are currently two different,
35incompatible, bindings for i2c busses that came about because the new
36binding was created without first investigating how i2c devices were
37already being enumerated in existing systems.
38
391. History
40----------
41The DT was originally created by Open Firmware as part of the
42communication method for passing data from Open Firmware to a client
43program (like to an operating system). An operating system used the
44Device Tree to discover the topology of the hardware at runtime, and
45thereby support a majority of available hardware without hard coded
46information (assuming drivers were available for all devices).
47
48Since Open Firmware is commonly used on PowerPC and SPARC platforms,
49the Linux support for those architectures has for a long time used the
50Device Tree.
51
52In 2005, when PowerPC Linux began a major cleanup and to merge 32-bit
53and 64-bit support, the decision was made to require DT support on all
54powerpc platforms, regardless of whether or not they used Open
55Firmware. To do this, a DT representation called the Flattened Device
56Tree (FDT) was created which could be passed to the kernel as a binary
57blob without requiring a real Open Firmware implementation. U-Boot,
58kexec, and other bootloaders were modified to support both passing a
59Device Tree Binary (dtb) and to modify a dtb at boot time. DT was
60also added to the PowerPC boot wrapper (arch/powerpc/boot/*) so that
61a dtb could be wrapped up with the kernel image to support booting
62existing non-DT aware firmware.
63
64Some time later, FDT infrastructure was generalized to be usable by
65all architectures. At the time of this writing, 6 mainlined
66architectures (arm, microblaze, mips, powerpc, sparc, and x86) and 1
67out of mainline (nios) have some level of DT support.
68
692. Data Model
70-------------
71If you haven't already read the Device Tree Usage[1] page,
72then go read it now. It's okay, I'll wait....
73
742.1 High Level View
75-------------------
76The most important thing to understand is that the DT is simply a data
77structure that describes the hardware. There is nothing magical about
78it, and it doesn't magically make all hardware configuration problems
79go away. What it does do is provide a language for decoupling the
80hardware configuration from the board and device driver support in the
81Linux kernel (or any other operating system for that matter). Using
82it allows board and device support to become data driven; to make
83setup decisions based on data passed into the kernel instead of on
84per-machine hard coded selections.
85
86Ideally, data driven platform setup should result in less code
87duplication and make it easier to support a wide range of hardware
88with a single kernel image.
89
90Linux uses DT data for three major purposes:
911) platform identification,
922) runtime configuration, and
933) device population.
94
952.2 Platform Identification
96---------------------------
97First and foremost, the kernel will use data in the DT to identify the
98specific machine. In a perfect world, the specific platform shouldn't
99matter to the kernel because all platform details would be described
100perfectly by the device tree in a consistent and reliable manner.
101Hardware is not perfect though, and so the kernel must identify the
102machine during early boot so that it has the opportunity to run
103machine-specific fixups.
104
105In the majority of cases, the machine identity is irrelevant, and the
106kernel will instead select setup code based on the machine's core
107CPU or SoC. On ARM for example, setup_arch() in
108arch/arm/kernel/setup.c will call setup_machine_fdt() in
109arch/arm/kernel/devicetree.c which searches through the machine_desc
110table and selects the machine_desc which best matches the device tree
111data. It determines the best match by looking at the 'compatible'
112property in the root device tree node, and comparing it with the
113dt_compat list in struct machine_desc.
114
115The 'compatible' property contains a sorted list of strings starting
116with the exact name of the machine, followed by an optional list of
117boards it is compatible with sorted from most compatible to least. For
118example, the root compatible properties for the TI BeagleBoard and its
119successor, the BeagleBoard xM board might look like:
120
121 compatible = "ti,omap3-beagleboard", "ti,omap3450", "ti,omap3";
122 compatible = "ti,omap3-beagleboard-xm", "ti,omap3450", "ti,omap3";
123
124Where "ti,omap3-beagleboard-xm" specifies the exact model, it also
125claims that it compatible with the OMAP 3450 SoC, and the omap3 family
126of SoCs in general. You'll notice that the list is sorted from most
127specific (exact board) to least specific (SoC family).
128
129Astute readers might point out that the Beagle xM could also claim
130compatibility with the original Beagle board. However, one should be
131cautioned about doing so at the board level since there is typically a
132high level of change from one board to another, even within the same
133product line, and it is hard to nail down exactly what is meant when one
134board claims to be compatible with another. For the top level, it is
135better to err on the side of caution and not claim one board is
136compatible with another. The notable exception would be when one
137board is a carrier for another, such as a CPU module attached to a
138carrier board.
139
140One more note on compatible values. Any string used in a compatible
141property must be documented as to what it indicates. Add
142documentation for compatible strings in Documentation/devicetree/bindings.
143
144Again on ARM, for each machine_desc, the kernel looks to see if
145any of the dt_compat list entries appear in the compatible property.
146If one does, then that machine_desc is a candidate for driving the
147machine. After searching the entire table of machine_descs,
148setup_machine_fdt() returns the 'most compatible' machine_desc based
149on which entry in the compatible property each machine_desc matches
150against. If no matching machine_desc is found, then it returns NULL.
151
152The reasoning behind this scheme is the observation that in the majority
153of cases, a single machine_desc can support a large number of boards
154if they all use the same SoC, or same family of SoCs. However,
155invariably there will be some exceptions where a specific board will
156require special setup code that is not useful in the generic case.
157Special cases could be handled by explicitly checking for the
158troublesome board(s) in generic setup code, but doing so very quickly
159becomes ugly and/or unmaintainable if it is more than just a couple of
160cases.
161
162Instead, the compatible list allows a generic machine_desc to provide
163support for a wide common set of boards by specifying "less
164compatible" value in the dt_compat list. In the example above,
165generic board support can claim compatibility with "ti,omap3" or
166"ti,omap3450". If a bug was discovered on the original beagleboard
167that required special workaround code during early boot, then a new
168machine_desc could be added which implements the workarounds and only
169matches on "ti,omap3-beagleboard".
170
171PowerPC uses a slightly different scheme where it calls the .probe()
172hook from each machine_desc, and the first one returning TRUE is used.
173However, this approach does not take into account the priority of the
174compatible list, and probably should be avoided for new architecture
175support.
176
1772.3 Runtime configuration
178-------------------------
179In most cases, a DT will be the sole method of communicating data from
180firmware to the kernel, so also gets used to pass in runtime and
181configuration data like the kernel parameters string and the location
182of an initrd image.
183
184Most of this data is contained in the /chosen node, and when booting
185Linux it will look something like this:
186
187 chosen {
188 bootargs = "console=ttyS0,115200 loglevel=8";
189 initrd-start = <0xc8000000>;
190 initrd-end = <0xc8200000>;
191 };
192
193The bootargs property contains the kernel arguments, and the initrd-*
194properties define the address and size of an initrd blob. The
195chosen node may also optionally contain an arbitrary number of
196additional properties for platform-specific configuration data.
197
198During early boot, the architecture setup code calls of_scan_flat_dt()
199several times with different helper callbacks to parse device tree
200data before paging is setup. The of_scan_flat_dt() code scans through
201the device tree and uses the helpers to extract information required
202during early boot. Typically the early_init_dt_scan_chosen() helper
203is used to parse the chosen node including kernel parameters,
204early_init_dt_scan_root() to initialize the DT address space model,
205and early_init_dt_scan_memory() to determine the size and
206location of usable RAM.
207
208On ARM, the function setup_machine_fdt() is responsible for early
209scanning of the device tree after selecting the correct machine_desc
210that supports the board.
211
2122.4 Device population
213---------------------
214After the board has been identified, and after the early configuration data
215has been parsed, then kernel initialization can proceed in the normal
216way. At some point in this process, unflatten_device_tree() is called
217to convert the data into a more efficient runtime representation.
218This is also when machine-specific setup hooks will get called, like
219the machine_desc .init_early(), .init_irq() and .init_machine() hooks
220on ARM. The remainder of this section uses examples from the ARM
221implementation, but all architectures will do pretty much the same
222thing when using a DT.
223
224As can be guessed by the names, .init_early() is used for any machine-
225specific setup that needs to be executed early in the boot process,
226and .init_irq() is used to set up interrupt handling. Using a DT
227doesn't materially change the behaviour of either of these functions.
228If a DT is provided, then both .init_early() and .init_irq() are able
229to call any of the DT query functions (of_* in include/linux/of*.h) to
230get additional data about the platform.
231
232The most interesting hook in the DT context is .init_machine() which
233is primarily responsible for populating the Linux device model with
234data about the platform. Historically this has been implemented on
235embedded platforms by defining a set of static clock structures,
236platform_devices, and other data in the board support .c file, and
237registering it en-masse in .init_machine(). When DT is used, then
238instead of hard coding static devices for each platform, the list of
239devices can be obtained by parsing the DT, and allocating device
240structures dynamically.
241
242The simplest case is when .init_machine() is only responsible for
243registering a block of platform_devices. A platform_device is a concept
244used by Linux for memory or I/O mapped devices which cannot be detected
245by hardware, and for 'composite' or 'virtual' devices (more on those
246later). While there is no 'platform device' terminology for the DT,
247platform devices roughly correspond to device nodes at the root of the
248tree and children of simple memory mapped bus nodes.
249
250About now is a good time to lay out an example. Here is part of the
251device tree for the NVIDIA Tegra board.
252
253/{
254 compatible = "nvidia,harmony", "nvidia,tegra20";
255 #address-cells = <1>;
256 #size-cells = <1>;
257 interrupt-parent = <&intc>;
258
259 chosen { };
260 aliases { };
261
262 memory {
263 device_type = "memory";
264 reg = <0x00000000 0x40000000>;
265 };
266
267 soc {
268 compatible = "nvidia,tegra20-soc", "simple-bus";
269 #address-cells = <1>;
270 #size-cells = <1>;
271 ranges;
272
273 intc: interrupt-controller@50041000 {
274 compatible = "nvidia,tegra20-gic";
275 interrupt-controller;
276 #interrupt-cells = <1>;
277 reg = <0x50041000 0x1000>, < 0x50040100 0x0100 >;
278 };
279
280 serial@70006300 {
281 compatible = "nvidia,tegra20-uart";
282 reg = <0x70006300 0x100>;
283 interrupts = <122>;
284 };
285
286 i2s1: i2s@70002800 {
287 compatible = "nvidia,tegra20-i2s";
288 reg = <0x70002800 0x100>;
289 interrupts = <77>;
290 codec = <&wm8903>;
291 };
292
293 i2c@7000c000 {
294 compatible = "nvidia,tegra20-i2c";
295 #address-cells = <1>;
296 #size-cells = <0>;
297 reg = <0x7000c000 0x100>;
298 interrupts = <70>;
299
300 wm8903: codec@1a {
301 compatible = "wlf,wm8903";
302 reg = <0x1a>;
303 interrupts = <347>;
304 };
305 };
306 };
307
308 sound {
309 compatible = "nvidia,harmony-sound";
310 i2s-controller = <&i2s1>;
311 i2s-codec = <&wm8903>;
312 };
313};
314
315At .machine_init() time, Tegra board support code will need to look at
316this DT and decide which nodes to create platform_devices for.
317However, looking at the tree, it is not immediately obvious what kind
318of device each node represents, or even if a node represents a device
319at all. The /chosen, /aliases, and /memory nodes are informational
320nodes that don't describe devices (although arguably memory could be
321considered a device). The children of the /soc node are memory mapped
322devices, but the codec@1a is an i2c device, and the sound node
323represents not a device, but rather how other devices are connected
324together to create the audio subsystem. I know what each device is
325because I'm familiar with the board design, but how does the kernel
326know what to do with each node?
327
328The trick is that the kernel starts at the root of the tree and looks
329for nodes that have a 'compatible' property. First, it is generally
330assumed that any node with a 'compatible' property represents a device
331of some kind, and second, it can be assumed that any node at the root
332of the tree is either directly attached to the processor bus, or is a
333miscellaneous system device that cannot be described any other way.
334For each of these nodes, Linux allocates and registers a
335platform_device, which in turn may get bound to a platform_driver.
336
337Why is using a platform_device for these nodes a safe assumption?
338Well, for the way that Linux models devices, just about all bus_types
339assume that its devices are children of a bus controller. For
340example, each i2c_client is a child of an i2c_master. Each spi_device
341is a child of an SPI bus. Similarly for USB, PCI, MDIO, etc. The
342same hierarchy is also found in the DT, where I2C device nodes only
343ever appear as children of an I2C bus node. Ditto for SPI, MDIO, USB,
344etc. The only devices which do not require a specific type of parent
345device are platform_devices (and amba_devices, but more on that
346later), which will happily live at the base of the Linux /sys/devices
347tree. Therefore, if a DT node is at the root of the tree, then it
348really probably is best registered as a platform_device.
349
350Linux board support code calls of_platform_populate(NULL, NULL, NULL)
351to kick off discovery of devices at the root of the tree. The
352parameters are all NULL because when starting from the root of the
353tree, there is no need to provide a starting node (the first NULL), a
354parent struct device (the last NULL), and we're not using a match
355table (yet). For a board that only needs to register devices,
356.init_machine() can be completely empty except for the
357of_platform_populate() call.
358
359In the Tegra example, this accounts for the /soc and /sound nodes, but
360what about the children of the SoC node? Shouldn't they be registered
361as platform devices too? For Linux DT support, the generic behaviour
362is for child devices to be registered by the parent's device driver at
363driver .probe() time. So, an i2c bus device driver will register a
364i2c_client for each child node, an SPI bus driver will register
365its spi_device children, and similarly for other bus_types.
366According to that model, a driver could be written that binds to the
367SoC node and simply registers platform_devices for each of its
368children. The board support code would allocate and register an SoC
369device, a (theoretical) SoC device driver could bind to the SoC device,
370and register platform_devices for /soc/interrupt-controller, /soc/serial,
371/soc/i2s, and /soc/i2c in its .probe() hook. Easy, right?
372
373Actually, it turns out that registering children of some
374platform_devices as more platform_devices is a common pattern, and the
375device tree support code reflects that and makes the above example
376simpler. The second argument to of_platform_populate() is an
377of_device_id table, and any node that matches an entry in that table
378will also get its child nodes registered. In the tegra case, the code
379can look something like this:
380
381static void __init harmony_init_machine(void)
382{
383 /* ... */
384 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
385}
386
387"simple-bus" is defined in the ePAPR 1.0 specification as a property
388meaning a simple memory mapped bus, so the of_platform_populate() code
389could be written to just assume simple-bus compatible nodes will
390always be traversed. However, we pass it in as an argument so that
391board support code can always override the default behaviour.
392
393[Need to add discussion of adding i2c/spi/etc child devices]
394
395Appendix A: AMBA devices
396------------------------
397
398ARM Primecells are a certain kind of device attached to the ARM AMBA
399bus which include some support for hardware detection and power
400management. In Linux, struct amba_device and the amba_bus_type is
401used to represent Primecell devices. However, the fiddly bit is that
402not all devices on an AMBA bus are Primecells, and for Linux it is
403typical for both amba_device and platform_device instances to be
404siblings of the same bus segment.
405
406When using the DT, this creates problems for of_platform_populate()
407because it must decide whether to register each node as either a
408platform_device or an amba_device. This unfortunately complicates the
409device creation model a little bit, but the solution turns out not to
410be too invasive. If a node is compatible with "arm,amba-primecell", then
411of_platform_populate() will register it as an amba_device instead of a
412platform_device.
diff --git a/Documentation/dma-buf-sharing.txt b/Documentation/dma-buf-sharing.txt
index 225f96d88f55..3bbd5c51605a 100644
--- a/Documentation/dma-buf-sharing.txt
+++ b/Documentation/dma-buf-sharing.txt
@@ -32,8 +32,12 @@ The buffer-user
32*IMPORTANT*: [see https://lkml.org/lkml/2011/12/20/211 for more details] 32*IMPORTANT*: [see https://lkml.org/lkml/2011/12/20/211 for more details]
33For this first version, A buffer shared using the dma_buf sharing API: 33For this first version, A buffer shared using the dma_buf sharing API:
34- *may* be exported to user space using "mmap" *ONLY* by exporter, outside of 34- *may* be exported to user space using "mmap" *ONLY* by exporter, outside of
35 this framework. 35 this framework.
36- may be used *ONLY* by importers that do not need CPU access to the buffer. 36- with this new iteration of the dma-buf api cpu access from the kernel has been
37 enable, see below for the details.
38
39dma-buf operations for device dma only
40--------------------------------------
37 41
38The dma_buf buffer sharing API usage contains the following steps: 42The dma_buf buffer sharing API usage contains the following steps:
39 43
@@ -219,10 +223,120 @@ NOTES:
219 If the exporter chooses not to allow an attach() operation once a 223 If the exporter chooses not to allow an attach() operation once a
220 map_dma_buf() API has been called, it simply returns an error. 224 map_dma_buf() API has been called, it simply returns an error.
221 225
222Miscellaneous notes: 226Kernel cpu access to a dma-buf buffer object
227--------------------------------------------
228
229The motivation to allow cpu access from the kernel to a dma-buf object from the
230importers side are:
231- fallback operations, e.g. if the devices is connected to a usb bus and the
232 kernel needs to shuffle the data around first before sending it away.
233- full transparency for existing users on the importer side, i.e. userspace
234 should not notice the difference between a normal object from that subsystem
235 and an imported one backed by a dma-buf. This is really important for drm
236 opengl drivers that expect to still use all the existing upload/download
237 paths.
238
239Access to a dma_buf from the kernel context involves three steps:
240
2411. Prepare access, which invalidate any necessary caches and make the object
242 available for cpu access.
2432. Access the object page-by-page with the dma_buf map apis
2443. Finish access, which will flush any necessary cpu caches and free reserved
245 resources.
246
2471. Prepare access
248
249 Before an importer can access a dma_buf object with the cpu from the kernel
250 context, it needs to notify the exporter of the access that is about to
251 happen.
252
253 Interface:
254 int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
255 size_t start, size_t len,
256 enum dma_data_direction direction)
257
258 This allows the exporter to ensure that the memory is actually available for
259 cpu access - the exporter might need to allocate or swap-in and pin the
260 backing storage. The exporter also needs to ensure that cpu access is
261 coherent for the given range and access direction. The range and access
262 direction can be used by the exporter to optimize the cache flushing, i.e.
263 access outside of the range or with a different direction (read instead of
264 write) might return stale or even bogus data (e.g. when the exporter needs to
265 copy the data to temporary storage).
266
267 This step might fail, e.g. in oom conditions.
268
2692. Accessing the buffer
270
271 To support dma_buf objects residing in highmem cpu access is page-based using
272 an api similar to kmap. Accessing a dma_buf is done in aligned chunks of
273 PAGE_SIZE size. Before accessing a chunk it needs to be mapped, which returns
274 a pointer in kernel virtual address space. Afterwards the chunk needs to be
275 unmapped again. There is no limit on how often a given chunk can be mapped
276 and unmapped, i.e. the importer does not need to call begin_cpu_access again
277 before mapping the same chunk again.
278
279 Interfaces:
280 void *dma_buf_kmap(struct dma_buf *, unsigned long);
281 void dma_buf_kunmap(struct dma_buf *, unsigned long, void *);
282
283 There are also atomic variants of these interfaces. Like for kmap they
284 facilitate non-blocking fast-paths. Neither the importer nor the exporter (in
285 the callback) is allowed to block when using these.
286
287 Interfaces:
288 void *dma_buf_kmap_atomic(struct dma_buf *, unsigned long);
289 void dma_buf_kunmap_atomic(struct dma_buf *, unsigned long, void *);
290
291 For importers all the restrictions of using kmap apply, like the limited
292 supply of kmap_atomic slots. Hence an importer shall only hold onto at most 2
293 atomic dma_buf kmaps at the same time (in any given process context).
294
295 dma_buf kmap calls outside of the range specified in begin_cpu_access are
296 undefined. If the range is not PAGE_SIZE aligned, kmap needs to succeed on
297 the partial chunks at the beginning and end but may return stale or bogus
298 data outside of the range (in these partial chunks).
299
300 Note that these calls need to always succeed. The exporter needs to complete
301 any preparations that might fail in begin_cpu_access.
302
3033. Finish access
304
305 When the importer is done accessing the range specified in begin_cpu_access,
306 it needs to announce this to the exporter (to facilitate cache flushing and
307 unpinning of any pinned resources). The result of of any dma_buf kmap calls
308 after end_cpu_access is undefined.
309
310 Interface:
311 void dma_buf_end_cpu_access(struct dma_buf *dma_buf,
312 size_t start, size_t len,
313 enum dma_data_direction dir);
314
315
316Miscellaneous notes
317-------------------
318
223- Any exporters or users of the dma-buf buffer sharing framework must have 319- Any exporters or users of the dma-buf buffer sharing framework must have
224 a 'select DMA_SHARED_BUFFER' in their respective Kconfigs. 320 a 'select DMA_SHARED_BUFFER' in their respective Kconfigs.
225 321
322- In order to avoid fd leaks on exec, the FD_CLOEXEC flag must be set
323 on the file descriptor. This is not just a resource leak, but a
324 potential security hole. It could give the newly exec'd application
325 access to buffers, via the leaked fd, to which it should otherwise
326 not be permitted access.
327
328 The problem with doing this via a separate fcntl() call, versus doing it
329 atomically when the fd is created, is that this is inherently racy in a
330 multi-threaded app[3]. The issue is made worse when it is library code
331 opening/creating the file descriptor, as the application may not even be
332 aware of the fd's.
333
334 To avoid this problem, userspace must have a way to request O_CLOEXEC
335 flag be set when the dma-buf fd is created. So any API provided by
336 the exporting driver to create a dmabuf fd must provide a way to let
337 userspace control setting of O_CLOEXEC flag passed in to dma_buf_fd().
338
226References: 339References:
227[1] struct dma_buf_ops in include/linux/dma-buf.h 340[1] struct dma_buf_ops in include/linux/dma-buf.h
228[2] All interfaces mentioned above defined in include/linux/dma-buf.h 341[2] All interfaces mentioned above defined in include/linux/dma-buf.h
342[3] https://lwn.net/Articles/236486/
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index 0c083c5c2faa..b4a898f43c37 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -158,7 +158,6 @@ logo_*.c
158logo_*_clut224.c 158logo_*_clut224.c
159logo_*_mono.c 159logo_*_mono.c
160lxdialog 160lxdialog
161mach
162mach-types 161mach-types
163mach-types.h 162mach-types.h
164machtypes.h 163machtypes.h
diff --git a/Documentation/fb/intel810.txt b/Documentation/fb/intel810.txt
index be3e7836abef..a8e9f5bca6f3 100644
--- a/Documentation/fb/intel810.txt
+++ b/Documentation/fb/intel810.txt
@@ -211,7 +211,7 @@ Using the same setup as described above, load the module like this:
211 modprobe i810fb vram=2 xres=1024 bpp=8 hsync1=30 hsync2=55 vsync1=50 \ 211 modprobe i810fb vram=2 xres=1024 bpp=8 hsync1=30 hsync2=55 vsync1=50 \
212 vsync2=85 accel=1 mtrr=1 212 vsync2=85 accel=1 mtrr=1
213 213
214Or just add the following to /etc/modprobe.conf 214Or just add the following to a configuration file in /etc/modprobe.d/
215 215
216 options i810fb vram=2 xres=1024 bpp=16 hsync1=30 hsync2=55 vsync1=50 \ 216 options i810fb vram=2 xres=1024 bpp=16 hsync1=30 hsync2=55 vsync1=50 \
217 vsync2=85 accel=1 mtrr=1 217 vsync2=85 accel=1 mtrr=1
diff --git a/Documentation/fb/intelfb.txt b/Documentation/fb/intelfb.txt
index dd9e944ea628..feac4e4d6968 100644
--- a/Documentation/fb/intelfb.txt
+++ b/Documentation/fb/intelfb.txt
@@ -120,7 +120,7 @@ Using the same setup as described above, load the module like this:
120 120
121 modprobe intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1 121 modprobe intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1
122 122
123Or just add the following to /etc/modprobe.conf 123Or just add the following to a configuration file in /etc/modprobe.d/
124 124
125 options intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1 125 options intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1
126 126
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 0cad4803ffac..709e08e9a222 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -6,14 +6,6 @@ be removed from this file.
6 6
7--------------------------- 7---------------------------
8 8
9What: x86 floppy disable_hlt
10When: 2012
11Why: ancient workaround of dubious utility clutters the
12 code used by everybody else.
13Who: Len Brown <len.brown@intel.com>
14
15---------------------------
16
17What: CONFIG_APM_CPU_IDLE, and its ability to call APM BIOS in idle 9What: CONFIG_APM_CPU_IDLE, and its ability to call APM BIOS in idle
18When: 2012 10When: 2012
19Why: This optional sub-feature of APM is of dubious reliability, 11Why: This optional sub-feature of APM is of dubious reliability,
@@ -529,3 +521,13 @@ When: 3.5
529Why: The old kmap_atomic() with two arguments is deprecated, we only 521Why: The old kmap_atomic() with two arguments is deprecated, we only
530 keep it for backward compatibility for few cycles and then drop it. 522 keep it for backward compatibility for few cycles and then drop it.
531Who: Cong Wang <amwang@redhat.com> 523Who: Cong Wang <amwang@redhat.com>
524
525----------------------------
526
527What: get_robust_list syscall
528When: 2013
529Why: There appear to be no production users of the get_robust_list syscall,
530 and it runs the risk of leaking address locations, allowing the bypass
531 of ASLR. It was only ever intended for debugging, so it should be
532 removed.
533Who: Kees Cook <keescook@chromium.org>
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index 8c10bf375c73..1b7f9acbcbbe 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -144,9 +144,6 @@ journal_async_commit Commit block can be written to disk without waiting
144 mount the device. This will enable 'journal_checksum' 144 mount the device. This will enable 'journal_checksum'
145 internally. 145 internally.
146 146
147journal=update Update the ext4 file system's journal to the current
148 format.
149
150journal_dev=devnum When the external journal device's major/minor numbers 147journal_dev=devnum When the external journal device's major/minor numbers
151 have changed, this option allows the user to specify 148 have changed, this option allows the user to specify
152 the new journal location. The journal device is 149 the new journal location. The journal device is
@@ -356,11 +353,6 @@ nouid32 Disables 32-bit UIDs and GIDs. This is for
356 interoperability with older kernels which only 353 interoperability with older kernels which only
357 store and expect 16-bit values. 354 store and expect 16-bit values.
358 355
359resize Allows to resize filesystem to the end of the last
360 existing block group, further resize has to be done
361 with resize2fs either online, or offline. It can be
362 used only with conjunction with remount.
363
364block_validity This options allows to enables/disables the in-kernel 356block_validity This options allows to enables/disables the in-kernel
365noblock_validity facility for tracking filesystem metadata blocks 357noblock_validity facility for tracking filesystem metadata blocks
366 within internal data structures. This allows multi- 358 within internal data structures. This allows multi-
diff --git a/Documentation/filesystems/files.txt b/Documentation/filesystems/files.txt
index ac2facc50d2a..46dfc6b038c3 100644
--- a/Documentation/filesystems/files.txt
+++ b/Documentation/filesystems/files.txt
@@ -113,8 +113,8 @@ the fdtable structure -
113 if (fd >= 0) { 113 if (fd >= 0) {
114 /* locate_fd() may have expanded fdtable, load the ptr */ 114 /* locate_fd() may have expanded fdtable, load the ptr */
115 fdt = files_fdtable(files); 115 fdt = files_fdtable(files);
116 FD_SET(fd, fdt->open_fds); 116 __set_open_fd(fd, fdt);
117 FD_CLR(fd, fdt->close_on_exec); 117 __clear_close_on_exec(fd, fdt);
118 spin_unlock(&files->file_lock); 118 spin_unlock(&files->file_lock);
119 ..... 119 .....
120 120
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index 792faa3c06cf..620a07844e8c 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -271,9 +271,26 @@ Some platforms may also use knowledge about what GPIOs are active for
271power management, such as by powering down unused chip sectors and, more 271power management, such as by powering down unused chip sectors and, more
272easily, gating off unused clocks. 272easily, gating off unused clocks.
273 273
274Note that requesting a GPIO does NOT cause it to be configured in any 274For GPIOs that use pins known to the pinctrl subsystem, that subsystem should
275way; it just marks that GPIO as in use. Separate code must handle any 275be informed of their use; a gpiolib driver's .request() operation may call
276pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown). 276pinctrl_request_gpio(), and a gpiolib driver's .free() operation may call
277pinctrl_free_gpio(). The pinctrl subsystem allows a pinctrl_request_gpio()
278to succeed concurrently with a pin or pingroup being "owned" by a device for
279pin multiplexing.
280
281Any programming of pin multiplexing hardware that is needed to route the
282GPIO signal to the appropriate pin should occur within a GPIO driver's
283.direction_input() or .direction_output() operations, and occur after any
284setup of an output GPIO's value. This allows a glitch-free migration from a
285pin's special function to GPIO. This is sometimes required when using a GPIO
286to implement a workaround on signals typically driven by a non-GPIO HW block.
287
288Some platforms allow some or all GPIO signals to be routed to different pins.
289Similarly, other aspects of the GPIO or pin may need to be configured, such as
290pullup/pulldown. Platform software should arrange that any such details are
291configured prior to gpio_request() being called for those GPIOs, e.g. using
292the pinctrl subsystem's mapping table, so that GPIO users need not be aware
293of these details.
277 294
278Also note that it's your responsibility to have stopped using a GPIO 295Also note that it's your responsibility to have stopped using a GPIO
279before you free it. 296before you free it.
@@ -302,6 +319,8 @@ where 'flags' is currently defined to specify the following properties:
302 319
303 * GPIOF_INIT_LOW - as output, set initial level to LOW 320 * GPIOF_INIT_LOW - as output, set initial level to LOW
304 * GPIOF_INIT_HIGH - as output, set initial level to HIGH 321 * GPIOF_INIT_HIGH - as output, set initial level to HIGH
322 * GPIOF_OPEN_DRAIN - gpio pin is open drain type.
323 * GPIOF_OPEN_SOURCE - gpio pin is open source type.
305 324
306since GPIOF_INIT_* are only valid when configured as output, so group valid 325since GPIOF_INIT_* are only valid when configured as output, so group valid
307combinations as: 326combinations as:
@@ -310,8 +329,19 @@ combinations as:
310 * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW 329 * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW
311 * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH 330 * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH
312 331
313In the future, these flags can be extended to support more properties such 332When setting the flag as GPIOF_OPEN_DRAIN then it will assume that pins is
314as open-drain status. 333open drain type. Such pins will not be driven to 1 in output mode. It is
334require to connect pull-up on such pins. By enabling this flag, gpio lib will
335make the direction to input when it is asked to set value of 1 in output mode
336to make the pin HIGH. The pin is make to LOW by driving value 0 in output mode.
337
338When setting the flag as GPIOF_OPEN_SOURCE then it will assume that pins is
339open source type. Such pins will not be driven to 0 in output mode. It is
340require to connect pull-down on such pin. By enabling this flag, gpio lib will
341make the direction to input when it is asked to set value of 0 in output mode
342to make the pin LOW. The pin is make to HIGH by driving value 1 in output mode.
343
344In the future, these flags can be extended to support more properties.
315 345
316Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is 346Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is
317introduced to encapsulate all three fields as: 347introduced to encapsulate all three fields as:
diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
index a10f73624ad3..90956b618025 100644
--- a/Documentation/hwmon/k10temp
+++ b/Documentation/hwmon/k10temp
@@ -11,7 +11,7 @@ Supported chips:
11 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) 11 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
12* AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series) 12* AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series)
13* AMD Family 14h processors: "Brazos" (C/E/G/Z-Series) 13* AMD Family 14h processors: "Brazos" (C/E/G/Z-Series)
14* AMD Family 15h processors: "Bulldozer" 14* AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity"
15 15
16 Prefix: 'k10temp' 16 Prefix: 'k10temp'
17 Addresses scanned: PCI space 17 Addresses scanned: PCI space
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801
index 2871fd500349..71f55bbcefc8 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -20,6 +20,7 @@ Supported adapters:
20 * Intel Patsburg (PCH) 20 * Intel Patsburg (PCH)
21 * Intel DH89xxCC (PCH) 21 * Intel DH89xxCC (PCH)
22 * Intel Panther Point (PCH) 22 * Intel Panther Point (PCH)
23 * Intel Lynx Point (PCH)
23 Datasheets: Publicly available at the Intel website 24 Datasheets: Publicly available at the Intel website
24 25
25On Intel Patsburg and later chipsets, both the normal host SMBus controller 26On Intel Patsburg and later chipsets, both the normal host SMBus controller
diff --git a/Documentation/i2c/busses/scx200_acb b/Documentation/i2c/busses/scx200_acb
index 7c07883d4dfc..ce83c871fe95 100644
--- a/Documentation/i2c/busses/scx200_acb
+++ b/Documentation/i2c/busses/scx200_acb
@@ -28,5 +28,5 @@ If the scx200_acb driver is built into the kernel, add the following
28parameter to your boot command line: 28parameter to your boot command line:
29 scx200_acb.base=0x810,0x820 29 scx200_acb.base=0x810,0x820
30If the scx200_acb driver is built as a module, add the following line to 30If the scx200_acb driver is built as a module, add the following line to
31the file /etc/modprobe.conf instead: 31a configuration file in /etc/modprobe.d/ instead:
32 options scx200_acb base=0x810,0x820 32 options scx200_acb base=0x810,0x820
diff --git a/Documentation/ide/ide.txt b/Documentation/ide/ide.txt
index e77bebfa7b0d..7aca987c23d9 100644
--- a/Documentation/ide/ide.txt
+++ b/Documentation/ide/ide.txt
@@ -169,7 +169,7 @@ When using ide.c as a module in combination with kmod, add:
169 169
170 alias block-major-3 ide-probe 170 alias block-major-3 ide-probe
171 171
172to /etc/modprobe.conf. 172to a configuration file in /etc/modprobe.d/.
173 173
174When ide.c is used as a module, you can pass command line parameters to the 174When ide.c is used as a module, you can pass command line parameters to the
175driver using the "options=" keyword to insmod, while replacing any ',' with 175driver using the "options=" keyword to insmod, while replacing any ',' with
diff --git a/Documentation/input/input.txt b/Documentation/input/input.txt
index b3d6787b4fb1..666c06c5ab0c 100644
--- a/Documentation/input/input.txt
+++ b/Documentation/input/input.txt
@@ -250,8 +250,8 @@ And so on up to event31.
250a USB keyboard works and is correctly connected to the kernel keyboard 250a USB keyboard works and is correctly connected to the kernel keyboard
251driver. 251driver.
252 252
253 Doing a cat /dev/input/mouse0 (c, 13, 32) will verify that a mouse 253 Doing a "cat /dev/input/mouse0" (c, 13, 32) will verify that a mouse
254is also emulated, characters should appear if you move it. 254is also emulated; characters should appear if you move it.
255 255
256 You can test the joystick emulation with the 'jstest' utility, 256 You can test the joystick emulation with the 'jstest' utility,
257available in the joystick package (see Documentation/input/joystick.txt). 257available in the joystick package (see Documentation/input/joystick.txt).
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
index 3b7488fc3373..e34b531dc316 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -225,6 +225,7 @@ Code Seq#(hex) Include File Comments
225'j' 00-3F linux/joystick.h 225'j' 00-3F linux/joystick.h
226'k' 00-0F linux/spi/spidev.h conflict! 226'k' 00-0F linux/spi/spidev.h conflict!
227'k' 00-05 video/kyro.h conflict! 227'k' 00-05 video/kyro.h conflict!
228'k' 10-17 linux/hsi/hsi_char.h HSI character device
228'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system 229'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system
229 <http://web.archive.org/web/*/http://mikonos.dia.unisa.it/tcfs> 230 <http://web.archive.org/web/*/http://mikonos.dia.unisa.it/tcfs>
230'l' 40-7F linux/udf_fs_i.h in development: 231'l' 40-7F linux/udf_fs_i.h in development:
diff --git a/Documentation/isdn/README.gigaset b/Documentation/isdn/README.gigaset
index ef3343eaa002..7534c6039adc 100644
--- a/Documentation/isdn/README.gigaset
+++ b/Documentation/isdn/README.gigaset
@@ -97,8 +97,7 @@ GigaSet 307x Device Driver
97 2.5.): 1=on (default), 0=off 97 2.5.): 1=on (default), 0=off
98 98
99 Depending on your distribution you may want to create a separate module 99 Depending on your distribution you may want to create a separate module
100 configuration file /etc/modprobe.d/gigaset for these, or add them to a 100 configuration file like /etc/modprobe.d/gigaset.conf for these.
101 custom file like /etc/modprobe.conf.local.
102 101
1032.2. Device nodes for user space programs 1022.2. Device nodes for user space programs
104 ------------------------------------ 103 ------------------------------------
@@ -212,8 +211,8 @@ GigaSet 307x Device Driver
212 211
213 options ppp_async flag_time=0 212 options ppp_async flag_time=0
214 213
215 to an appropriate module configuration file, like /etc/modprobe.d/gigaset 214 to an appropriate module configuration file, like
216 or /etc/modprobe.conf.local. 215 /etc/modprobe.d/gigaset.conf.
217 216
218 Unimodem mode is needed for making some devices [e.g. SX100] work which 217 Unimodem mode is needed for making some devices [e.g. SX100] work which
219 do not support the regular Gigaset command set. If debug output (see 218 do not support the regular Gigaset command set. If debug output (see
@@ -237,8 +236,8 @@ GigaSet 307x Device Driver
237 modprobe usb_gigaset startmode=0 236 modprobe usb_gigaset startmode=0
238 or by adding a line like 237 or by adding a line like
239 options usb_gigaset startmode=0 238 options usb_gigaset startmode=0
240 to an appropriate module configuration file, like /etc/modprobe.d/gigaset 239 to an appropriate module configuration file, like
241 or /etc/modprobe.conf.local. 240 /etc/modprobe.d/gigaset.conf
242 241
2432.6. Call-ID (CID) mode 2422.6. Call-ID (CID) mode
244 ------------------ 243 ------------------
@@ -310,7 +309,7 @@ GigaSet 307x Device Driver
310 309
311 options isdn dialtimeout=15 310 options isdn dialtimeout=15
312 311
313 to /etc/modprobe.d/gigaset, /etc/modprobe.conf.local or a similar file. 312 to /etc/modprobe.d/gigaset.conf or a similar file.
314 313
315 Problem: 314 Problem:
316 The isdnlog program emits error messages or just doesn't work. 315 The isdnlog program emits error messages or just doesn't work.
@@ -350,8 +349,7 @@ GigaSet 307x Device Driver
350 The initial value can be set using the debug parameter when loading the 349 The initial value can be set using the debug parameter when loading the
351 module "gigaset", e.g. by adding a line 350 module "gigaset", e.g. by adding a line
352 options gigaset debug=0 351 options gigaset debug=0
353 to your module configuration file, eg. /etc/modprobe.d/gigaset or 352 to your module configuration file, eg. /etc/modprobe.d/gigaset.conf
354 /etc/modprobe.conf.local.
355 353
356 Generated debugging information can be found 354 Generated debugging information can be found
357 - as output of the command 355 - as output of the command
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt
index c313d71324b4..9d5f2a90dca9 100644
--- a/Documentation/kbuild/kconfig.txt
+++ b/Documentation/kbuild/kconfig.txt
@@ -28,12 +28,10 @@ new (default) values, so you can use:
28 28
29 grep "(NEW)" conf.new 29 grep "(NEW)" conf.new
30 30
31to see the new config symbols or you can 'diff' the previous and 31to see the new config symbols or you can use diffconfig to see the
32new .config files to see the differences: 32differences between the previous and new .config files:
33 33
34 diff .config.old .config | less 34 scripts/diffconfig .config.old .config | less
35
36(Yes, we need something better here.)
37 35
38______________________________________________________________________ 36______________________________________________________________________
39Environment variables for '*config' 37Environment variables for '*config'
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 58eac231fe69..c1601e5a8b71 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1699,6 +1699,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1699 The default is to send the implementation identification 1699 The default is to send the implementation identification
1700 information. 1700 information.
1701 1701
1702 nfsd.nfs4_disable_idmapping=
1703 [NFSv4] When set to the default of '1', the NFSv4
1704 server will return only numeric uids and gids to
1705 clients using auth_sys, and will accept numeric uids
1706 and gids from such clients. This is intended to ease
1707 migration from NFSv2/v3.
1702 1708
1703 objlayoutdriver.osd_login_prog= 1709 objlayoutdriver.osd_login_prog=
1704 [NFS] [OBJLAYOUT] sets the pathname to the program which 1710 [NFS] [OBJLAYOUT] sets the pathname to the program which
@@ -1869,6 +1875,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1869 shutdown the other cpus. Instead use the REBOOT_VECTOR 1875 shutdown the other cpus. Instead use the REBOOT_VECTOR
1870 irq. 1876 irq.
1871 1877
1878 nomodule Disable module load
1879
1872 nopat [X86] Disable PAT (page attribute table extension of 1880 nopat [X86] Disable PAT (page attribute table extension of
1873 pagetables) support. 1881 pagetables) support.
1874 1882
diff --git a/Documentation/laptops/asus-laptop.txt b/Documentation/laptops/asus-laptop.txt
index 803e51f6768b..a1e04d679289 100644
--- a/Documentation/laptops/asus-laptop.txt
+++ b/Documentation/laptops/asus-laptop.txt
@@ -45,7 +45,7 @@ Status
45Usage 45Usage
46----- 46-----
47 47
48 Try "modprobe asus_acpi". Check your dmesg (simply type dmesg). You should 48 Try "modprobe asus-laptop". Check your dmesg (simply type dmesg). You should
49 see some lines like this : 49 see some lines like this :
50 50
51 Asus Laptop Extras version 0.42 51 Asus Laptop Extras version 0.42
diff --git a/Documentation/laptops/sony-laptop.txt b/Documentation/laptops/sony-laptop.txt
index 2bd4e82e5d9f..0d5ac7f5287e 100644
--- a/Documentation/laptops/sony-laptop.txt
+++ b/Documentation/laptops/sony-laptop.txt
@@ -17,6 +17,11 @@ subsystem. See the logs of acpid or /proc/acpi/event and
17devices are created by the driver. Additionally, loading the driver with the 17devices are created by the driver. Additionally, loading the driver with the
18debug option will report all events in the kernel log. 18debug option will report all events in the kernel log.
19 19
20The "scancodes" passed to the input system (that can be remapped with udev)
21are indexes to the table "sony_laptop_input_keycode_map" in the sony-laptop.c
22module. For example the "FN/E" key combination (EJECTCD on some models)
23generates the scancode 20 (0x14).
24
20Backlight control: 25Backlight control:
21------------------ 26------------------
22If your laptop model supports it, you will find sysfs files in the 27If your laptop model supports it, you will find sysfs files in the
diff --git a/Documentation/laptops/sonypi.txt b/Documentation/laptops/sonypi.txt
index 4857acfc50f1..606bdb9ce036 100644
--- a/Documentation/laptops/sonypi.txt
+++ b/Documentation/laptops/sonypi.txt
@@ -110,7 +110,7 @@ Module use:
110----------- 110-----------
111 111
112In order to automatically load the sonypi module on use, you can put those 112In order to automatically load the sonypi module on use, you can put those
113lines in your /etc/modprobe.conf file: 113lines a configuration file in /etc/modprobe.d/:
114 114
115 alias char-major-10-250 sonypi 115 alias char-major-10-250 sonypi
116 options sonypi minor=250 116 options sonypi minor=250
diff --git a/Documentation/mono.txt b/Documentation/mono.txt
index e8e1758e87da..d01ac6052194 100644
--- a/Documentation/mono.txt
+++ b/Documentation/mono.txt
@@ -38,11 +38,11 @@ if [ ! -e /proc/sys/fs/binfmt_misc/register ]; then
38 /sbin/modprobe binfmt_misc 38 /sbin/modprobe binfmt_misc
39 # Some distributions, like Fedora Core, perform 39 # Some distributions, like Fedora Core, perform
40 # the following command automatically when the 40 # the following command automatically when the
41 # binfmt_misc module is loaded into the kernel. 41 # binfmt_misc module is loaded into the kernel
42 # or during normal boot up (systemd-based systems).
42 # Thus, it is possible that the following line 43 # Thus, it is possible that the following line
43 # is not needed at all. Look at /etc/modprobe.conf 44 # is not needed at all.
44 # to check whether this is applicable or not. 45 mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
45 mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
46fi 46fi
47 47
48# Register support for .NET CLR binaries 48# Register support for .NET CLR binaries
diff --git a/Documentation/networking/baycom.txt b/Documentation/networking/baycom.txt
index 4e68849d5639..688f18fd4467 100644
--- a/Documentation/networking/baycom.txt
+++ b/Documentation/networking/baycom.txt
@@ -93,7 +93,7 @@ Every time a driver is inserted into the kernel, it has to know which
93modems it should access at which ports. This can be done with the setbaycom 93modems it should access at which ports. This can be done with the setbaycom
94utility. If you are only using one modem, you can also configure the 94utility. If you are only using one modem, you can also configure the
95driver from the insmod command line (or by means of an option line in 95driver from the insmod command line (or by means of an option line in
96/etc/modprobe.conf). 96/etc/modprobe.d/*.conf).
97 97
98Examples: 98Examples:
99 modprobe baycom_ser_fdx mode="ser12*" iobase=0x3f8 irq=4 99 modprobe baycom_ser_fdx mode="ser12*" iobase=0x3f8 irq=4
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index 080ad26690ae..bfea8a338901 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -173,9 +173,8 @@ bonding module at load time, or are specified via sysfs.
173 173
174 Module options may be given as command line arguments to the 174 Module options may be given as command line arguments to the
175insmod or modprobe command, but are usually specified in either the 175insmod or modprobe command, but are usually specified in either the
176/etc/modules.conf or /etc/modprobe.conf configuration file, or in a 176/etc/modrobe.d/*.conf configuration files, or in a distro-specific
177distro-specific configuration file (some of which are detailed in the next 177configuration file (some of which are detailed in the next section).
178section).
179 178
180 Details on bonding support for sysfs is provided in the 179 Details on bonding support for sysfs is provided in the
181"Configuring Bonding Manually via Sysfs" section, below. 180"Configuring Bonding Manually via Sysfs" section, below.
@@ -1021,7 +1020,7 @@ ifcfg-bondX files.
1021 1020
1022 Because the sysconfig scripts supply the bonding module 1021 Because the sysconfig scripts supply the bonding module
1023options in the ifcfg-bondX file, it is not necessary to add them to 1022options in the ifcfg-bondX file, it is not necessary to add them to
1024the system /etc/modules.conf or /etc/modprobe.conf configuration file. 1023the system /etc/modules.d/*.conf configuration files.
1025 1024
10263.2 Configuration with Initscripts Support 10253.2 Configuration with Initscripts Support
1027------------------------------------------ 1026------------------------------------------
@@ -1098,15 +1097,13 @@ queried targets, e.g.,
1098 arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2 1097 arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2
1099 1098
1100 is the proper syntax to specify multiple targets. When specifying 1099 is the proper syntax to specify multiple targets. When specifying
1101options via BONDING_OPTS, it is not necessary to edit /etc/modules.conf or 1100options via BONDING_OPTS, it is not necessary to edit /etc/modprobe.d/*.conf.
1102/etc/modprobe.conf.
1103 1101
1104 For even older versions of initscripts that do not support 1102 For even older versions of initscripts that do not support
1105BONDING_OPTS, it is necessary to edit /etc/modules.conf (or 1103BONDING_OPTS, it is necessary to edit /etc/modprobe.d/*.conf, depending upon
1106/etc/modprobe.conf, depending upon your distro) to load the bonding module 1104your distro) to load the bonding module with your desired options when the
1107with your desired options when the bond0 interface is brought up. The 1105bond0 interface is brought up. The following lines in /etc/modprobe.d/*.conf
1108following lines in /etc/modules.conf (or modprobe.conf) will load the 1106will load the bonding module, and select its options:
1109bonding module, and select its options:
1110 1107
1111alias bond0 bonding 1108alias bond0 bonding
1112options bond0 mode=balance-alb miimon=100 1109options bond0 mode=balance-alb miimon=100
@@ -1152,7 +1149,7 @@ knowledge of bonding. One such distro is SuSE Linux Enterprise Server
1152version 8. 1149version 8.
1153 1150
1154 The general method for these systems is to place the bonding 1151 The general method for these systems is to place the bonding
1155module parameters into /etc/modules.conf or /etc/modprobe.conf (as 1152module parameters into a config file in /etc/modprobe.d/ (as
1156appropriate for the installed distro), then add modprobe and/or 1153appropriate for the installed distro), then add modprobe and/or
1157ifenslave commands to the system's global init script. The name of 1154ifenslave commands to the system's global init script. The name of
1158the global init script differs; for sysconfig, it is 1155the global init script differs; for sysconfig, it is
@@ -1228,7 +1225,7 @@ network initialization scripts.
1228specify a different name for each instance (the module loading system 1225specify a different name for each instance (the module loading system
1229requires that every loaded module, even multiple instances of the same 1226requires that every loaded module, even multiple instances of the same
1230module, have a unique name). This is accomplished by supplying multiple 1227module, have a unique name). This is accomplished by supplying multiple
1231sets of bonding options in /etc/modprobe.conf, for example: 1228sets of bonding options in /etc/modprobe.d/*.conf, for example:
1232 1229
1233alias bond0 bonding 1230alias bond0 bonding
1234options bond0 -o bond0 mode=balance-rr miimon=100 1231options bond0 -o bond0 mode=balance-rr miimon=100
@@ -1793,8 +1790,8 @@ route additions may cause trouble.
1793 On systems with network configuration scripts that do not 1790 On systems with network configuration scripts that do not
1794associate physical devices directly with network interface names (so 1791associate physical devices directly with network interface names (so
1795that the same physical device always has the same "ethX" name), it may 1792that the same physical device always has the same "ethX" name), it may
1796be necessary to add some special logic to either /etc/modules.conf or 1793be necessary to add some special logic to config files in
1797/etc/modprobe.conf (depending upon which is installed on the system). 1794/etc/modprobe.d/.
1798 1795
1799 For example, given a modules.conf containing the following: 1796 For example, given a modules.conf containing the following:
1800 1797
@@ -1821,20 +1818,15 @@ add above bonding e1000 tg3
1821bonding is loaded. This command is fully documented in the 1818bonding is loaded. This command is fully documented in the
1822modules.conf manual page. 1819modules.conf manual page.
1823 1820
1824 On systems utilizing modprobe.conf (or modprobe.conf.local), 1821 On systems utilizing modprobe an equivalent problem can occur.
1825an equivalent problem can occur. In this case, the following can be 1822In this case, the following can be added to config files in
1826added to modprobe.conf (or modprobe.conf.local, as appropriate), as 1823/etc/modprobe.d/ as:
1827follows (all on one line; it has been split here for clarity):
1828 1824
1829install bonding /sbin/modprobe tg3; /sbin/modprobe e1000; 1825softdep bonding pre: tg3 e1000
1830 /sbin/modprobe --ignore-install bonding
1831 1826
1832 This will, when loading the bonding module, rather than 1827 This will load tg3 and e1000 modules before loading the bonding one.
1833performing the normal action, instead execute the provided command. 1828Full documentation on this can be found in the modprobe.d and modprobe
1834This command loads the device drivers in the order needed, then calls 1829manual pages.
1835modprobe with --ignore-install to cause the normal action to then take
1836place. Full documentation on this can be found in the modprobe.conf
1837and modprobe manual pages.
1838 1830
18398.3. Painfully Slow Or No Failed Link Detection By Miimon 18318.3. Painfully Slow Or No Failed Link Detection By Miimon
1840--------------------------------------------------------- 1832---------------------------------------------------------
diff --git a/Documentation/networking/dl2k.txt b/Documentation/networking/dl2k.txt
index 10e8490fa406..cba74f7a3abc 100644
--- a/Documentation/networking/dl2k.txt
+++ b/Documentation/networking/dl2k.txt
@@ -45,12 +45,13 @@ Now eth0 should active, you can test it by "ping" or get more information by
45"ifconfig". If tested ok, continue the next step. 45"ifconfig". If tested ok, continue the next step.
46 46
474. cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net 474. cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net
485. Add the following line to /etc/modprobe.conf: 485. Add the following line to /etc/modprobe.d/dl2k.conf:
49 alias eth0 dl2k 49 alias eth0 dl2k
506. Run "netconfig" or "netconf" to create configuration script ifcfg-eth0 506. Run depmod to updated module indexes.
517. Run "netconfig" or "netconf" to create configuration script ifcfg-eth0
51 located at /etc/sysconfig/network-scripts or create it manually. 52 located at /etc/sysconfig/network-scripts or create it manually.
52 [see - Configuration Script Sample] 53 [see - Configuration Script Sample]
537. Driver will automatically load and configure at next boot time. 548. Driver will automatically load and configure at next boot time.
54 55
55Compiling the Driver 56Compiling the Driver
56==================== 57====================
@@ -154,8 +155,8 @@ Installing the Driver
154 ----------------- 155 -----------------
155 1. Copy dl2k.o to the network modules directory, typically 156 1. Copy dl2k.o to the network modules directory, typically
156 /lib/modules/2.x.x-xx/net or /lib/modules/2.x.x/kernel/drivers/net. 157 /lib/modules/2.x.x-xx/net or /lib/modules/2.x.x/kernel/drivers/net.
157 2. Locate the boot module configuration file, most commonly modprobe.conf 158 2. Locate the boot module configuration file, most commonly in the
158 or modules.conf (for 2.4) in the /etc directory. Add the following lines: 159 /etc/modprobe.d/ directory. Add the following lines:
159 160
160 alias ethx dl2k 161 alias ethx dl2k
161 options dl2k <optional parameters> 162 options dl2k <optional parameters>
diff --git a/Documentation/networking/driver.txt b/Documentation/networking/driver.txt
index 03283daa64fe..da59e2884130 100644
--- a/Documentation/networking/driver.txt
+++ b/Documentation/networking/driver.txt
@@ -2,16 +2,16 @@ Document about softnet driver issues
2 2
3Transmit path guidelines: 3Transmit path guidelines:
4 4
51) The hard_start_xmit method must never return '1' under any 51) The ndo_start_xmit method must not return NETDEV_TX_BUSY under
6 normal circumstances. It is considered a hard error unless 6 any normal circumstances. It is considered a hard error unless
7 there is no way your device can tell ahead of time when it's 7 there is no way your device can tell ahead of time when it's
8 transmit function will become busy. 8 transmit function will become busy.
9 9
10 Instead it must maintain the queue properly. For example, 10 Instead it must maintain the queue properly. For example,
11 for a driver implementing scatter-gather this means: 11 for a driver implementing scatter-gather this means:
12 12
13 static int drv_hard_start_xmit(struct sk_buff *skb, 13 static netdev_tx_t drv_hard_start_xmit(struct sk_buff *skb,
14 struct net_device *dev) 14 struct net_device *dev)
15 { 15 {
16 struct drv *dp = netdev_priv(dev); 16 struct drv *dp = netdev_priv(dev);
17 17
@@ -23,7 +23,7 @@ Transmit path guidelines:
23 unlock_tx(dp); 23 unlock_tx(dp);
24 printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", 24 printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
25 dev->name); 25 dev->name);
26 return 1; 26 return NETDEV_TX_BUSY;
27 } 27 }
28 28
29 ... queue packet to card ... 29 ... queue packet to card ...
@@ -35,6 +35,7 @@ Transmit path guidelines:
35 ... 35 ...
36 unlock_tx(dp); 36 unlock_tx(dp);
37 ... 37 ...
38 return NETDEV_TX_OK;
38 } 39 }
39 40
40 And then at the end of your TX reclamation event handling: 41 And then at the end of your TX reclamation event handling:
@@ -58,15 +59,12 @@ Transmit path guidelines:
58 TX_BUFFS_AVAIL(dp) > 0) 59 TX_BUFFS_AVAIL(dp) > 0)
59 netif_wake_queue(dp->dev); 60 netif_wake_queue(dp->dev);
60 61
612) Do not forget to update netdev->trans_start to jiffies after 622) An ndo_start_xmit method must not modify the shared parts of a
62 each new tx packet is given to the hardware.
63
643) A hard_start_xmit method must not modify the shared parts of a
65 cloned SKB. 63 cloned SKB.
66 64
674) Do not forget that once you return 0 from your hard_start_xmit 653) Do not forget that once you return NETDEV_TX_OK from your
68 method, it is your driver's responsibility to free up the SKB 66 ndo_start_xmit method, it is your driver's responsibility to free
69 and in some finite amount of time. 67 up the SKB and in some finite amount of time.
70 68
71 For example, this means that it is not allowed for your TX 69 For example, this means that it is not allowed for your TX
72 mitigation scheme to let TX packets "hang out" in the TX 70 mitigation scheme to let TX packets "hang out" in the TX
@@ -74,8 +72,9 @@ Transmit path guidelines:
74 This error can deadlock sockets waiting for send buffer room 72 This error can deadlock sockets waiting for send buffer room
75 to be freed up. 73 to be freed up.
76 74
77 If you return 1 from the hard_start_xmit method, you must not keep 75 If you return NETDEV_TX_BUSY from the ndo_start_xmit method, you
78 any reference to that SKB and you must not attempt to free it up. 76 must not keep any reference to that SKB and you must not attempt
77 to free it up.
79 78
80Probing guidelines: 79Probing guidelines:
81 80
@@ -85,10 +84,10 @@ Probing guidelines:
85 84
86Close/stop guidelines: 85Close/stop guidelines:
87 86
881) After the dev->stop routine has been called, the hardware must 871) After the ndo_stop routine has been called, the hardware must
89 not receive or transmit any data. All in flight packets must 88 not receive or transmit any data. All in flight packets must
90 be aborted. If necessary, poll or wait for completion of 89 be aborted. If necessary, poll or wait for completion of
91 any reset commands. 90 any reset commands.
92 91
932) The dev->stop routine will be called by unregister_netdevice 922) The ndo_stop routine will be called by unregister_netdevice
94 if device is still UP. 93 if device is still UP.
diff --git a/Documentation/networking/e100.txt b/Documentation/networking/e100.txt
index 162f323a7a1f..fcb6c71cdb69 100644
--- a/Documentation/networking/e100.txt
+++ b/Documentation/networking/e100.txt
@@ -94,8 +94,8 @@ Additional Configurations
94 94
95 Configuring a network driver to load properly when the system is started is 95 Configuring a network driver to load properly when the system is started is
96 distribution dependent. Typically, the configuration process involves adding 96 distribution dependent. Typically, the configuration process involves adding
97 an alias line to /etc/modules.conf or /etc/modprobe.conf as well as editing 97 an alias line to /etc/modprobe.d/*.conf as well as editing other system
98 other system startup scripts and/or configuration files. Many popular Linux 98 startup scripts and/or configuration files. Many popular Linux
99 distributions ship with tools to make these changes for you. To learn the 99 distributions ship with tools to make these changes for you. To learn the
100 proper way to configure a network device for your system, refer to your 100 proper way to configure a network device for your system, refer to your
101 distribution documentation. If during this process you are asked for the 101 distribution documentation. If during this process you are asked for the
@@ -103,7 +103,7 @@ Additional Configurations
103 PRO/100 Family of Adapters is e100. 103 PRO/100 Family of Adapters is e100.
104 104
105 As an example, if you install the e100 driver for two PRO/100 adapters 105 As an example, if you install the e100 driver for two PRO/100 adapters
106 (eth0 and eth1), add the following to modules.conf or modprobe.conf: 106 (eth0 and eth1), add the following to a configuraton file in /etc/modprobe.d/
107 107
108 alias eth0 e100 108 alias eth0 e100
109 alias eth1 e100 109 alias eth1 e100
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index ad3e80e17b4f..bd80ba5847d2 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -604,15 +604,8 @@ IP Variables:
604ip_local_port_range - 2 INTEGERS 604ip_local_port_range - 2 INTEGERS
605 Defines the local port range that is used by TCP and UDP to 605 Defines the local port range that is used by TCP and UDP to
606 choose the local port. The first number is the first, the 606 choose the local port. The first number is the first, the
607 second the last local port number. Default value depends on 607 second the last local port number. The default values are
608 amount of memory available on the system: 608 32768 and 61000 respectively.
609 > 128Mb 32768-61000
610 < 128Mb 1024-4999 or even less.
611 This number defines number of active connections, which this
612 system can issue simultaneously to systems not supporting
613 TCP extensions (timestamps). With tcp_tw_recycle enabled
614 (i.e. by default) range 1024-4999 is enough to issue up to
615 2000 connections per second to systems supporting timestamps.
616 609
617ip_local_reserved_ports - list of comma separated ranges 610ip_local_reserved_ports - list of comma separated ranges
618 Specify the ports which are reserved for known third-party 611 Specify the ports which are reserved for known third-party
diff --git a/Documentation/networking/ipv6.txt b/Documentation/networking/ipv6.txt
index 9fd7e21296c8..6cd74fa55358 100644
--- a/Documentation/networking/ipv6.txt
+++ b/Documentation/networking/ipv6.txt
@@ -2,9 +2,9 @@
2Options for the ipv6 module are supplied as parameters at load time. 2Options for the ipv6 module are supplied as parameters at load time.
3 3
4Module options may be given as command line arguments to the insmod 4Module options may be given as command line arguments to the insmod
5or modprobe command, but are usually specified in either the 5or modprobe command, but are usually specified in either
6/etc/modules.conf or /etc/modprobe.conf configuration file, or in a 6/etc/modules.d/*.conf configuration files, or in a distro-specific
7distro-specific configuration file. 7configuration file.
8 8
9The available ipv6 module parameters are listed below. If a parameter 9The available ipv6 module parameters are listed below. If a parameter
10is not specified the default value is used. 10is not specified the default value is used.
diff --git a/Documentation/networking/ixgb.txt b/Documentation/networking/ixgb.txt
index e196f16df313..d75a1f9565bb 100644
--- a/Documentation/networking/ixgb.txt
+++ b/Documentation/networking/ixgb.txt
@@ -274,9 +274,9 @@ Additional Configurations
274 ------------------------------------------------- 274 -------------------------------------------------
275 Configuring a network driver to load properly when the system is started is 275 Configuring a network driver to load properly when the system is started is
276 distribution dependent. Typically, the configuration process involves adding 276 distribution dependent. Typically, the configuration process involves adding
277 an alias line to /etc/modprobe.conf as well as editing other system startup 277 an alias line to files in /etc/modprobe.d/ as well as editing other system
278 scripts and/or configuration files. Many popular Linux distributions ship 278 startup scripts and/or configuration files. Many popular Linux distributions
279 with tools to make these changes for you. To learn the proper way to 279 ship with tools to make these changes for you. To learn the proper way to
280 configure a network device for your system, refer to your distribution 280 configure a network device for your system, refer to your distribution
281 documentation. If during this process you are asked for the driver or module 281 documentation. If during this process you are asked for the driver or module
282 name, the name for the Linux Base Driver for the Intel 10GbE Family of 282 name, the name for the Linux Base Driver for the Intel 10GbE Family of
diff --git a/Documentation/networking/ltpc.txt b/Documentation/networking/ltpc.txt
index fe2a9129d959..0bf3220c715b 100644
--- a/Documentation/networking/ltpc.txt
+++ b/Documentation/networking/ltpc.txt
@@ -25,7 +25,7 @@ the driver will try to determine them itself.
25 25
26If you load the driver as a module, you can pass the parameters "io=", 26If you load the driver as a module, you can pass the parameters "io=",
27"irq=", and "dma=" on the command line with insmod or modprobe, or add 27"irq=", and "dma=" on the command line with insmod or modprobe, or add
28them as options in /etc/modprobe.conf: 28them as options in a configuration file in /etc/modprobe.d/ directory:
29 29
30 alias lt0 ltpc # autoload the module when the interface is configured 30 alias lt0 ltpc # autoload the module when the interface is configured
31 options ltpc io=0x240 irq=9 dma=1 31 options ltpc io=0x240 irq=9 dma=1
diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt
index 89358341682a..c7ecc7080494 100644
--- a/Documentation/networking/netdevices.txt
+++ b/Documentation/networking/netdevices.txt
@@ -47,26 +47,25 @@ packets is preferred.
47 47
48struct net_device synchronization rules 48struct net_device synchronization rules
49======================================= 49=======================================
50dev->open: 50ndo_open:
51 Synchronization: rtnl_lock() semaphore. 51 Synchronization: rtnl_lock() semaphore.
52 Context: process 52 Context: process
53 53
54dev->stop: 54ndo_stop:
55 Synchronization: rtnl_lock() semaphore. 55 Synchronization: rtnl_lock() semaphore.
56 Context: process 56 Context: process
57 Note1: netif_running() is guaranteed false 57 Note: netif_running() is guaranteed false
58 Note2: dev->poll() is guaranteed to be stopped
59 58
60dev->do_ioctl: 59ndo_do_ioctl:
61 Synchronization: rtnl_lock() semaphore. 60 Synchronization: rtnl_lock() semaphore.
62 Context: process 61 Context: process
63 62
64dev->get_stats: 63ndo_get_stats:
65 Synchronization: dev_base_lock rwlock. 64 Synchronization: dev_base_lock rwlock.
66 Context: nominally process, but don't sleep inside an rwlock 65 Context: nominally process, but don't sleep inside an rwlock
67 66
68dev->hard_start_xmit: 67ndo_start_xmit:
69 Synchronization: netif_tx_lock spinlock. 68 Synchronization: __netif_tx_lock spinlock.
70 69
71 When the driver sets NETIF_F_LLTX in dev->features this will be 70 When the driver sets NETIF_F_LLTX in dev->features this will be
72 called without holding netif_tx_lock. In this case the driver 71 called without holding netif_tx_lock. In this case the driver
@@ -87,20 +86,20 @@ dev->hard_start_xmit:
87 o NETDEV_TX_LOCKED Locking failed, please retry quickly. 86 o NETDEV_TX_LOCKED Locking failed, please retry quickly.
88 Only valid when NETIF_F_LLTX is set. 87 Only valid when NETIF_F_LLTX is set.
89 88
90dev->tx_timeout: 89ndo_tx_timeout:
91 Synchronization: netif_tx_lock spinlock. 90 Synchronization: netif_tx_lock spinlock; all TX queues frozen.
92 Context: BHs disabled 91 Context: BHs disabled
93 Notes: netif_queue_stopped() is guaranteed true 92 Notes: netif_queue_stopped() is guaranteed true
94 93
95dev->set_rx_mode: 94ndo_set_rx_mode:
96 Synchronization: netif_tx_lock spinlock. 95 Synchronization: netif_addr_lock spinlock.
97 Context: BHs disabled 96 Context: BHs disabled
98 97
99struct napi_struct synchronization rules 98struct napi_struct synchronization rules
100======================================== 99========================================
101napi->poll: 100napi->poll:
102 Synchronization: NAPI_STATE_SCHED bit in napi->state. Device 101 Synchronization: NAPI_STATE_SCHED bit in napi->state. Device
103 driver's dev->close method will invoke napi_disable() on 102 driver's ndo_stop method will invoke napi_disable() on
104 all NAPI instances which will do a sleeping poll on the 103 all NAPI instances which will do a sleeping poll on the
105 NAPI_STATE_SCHED napi->state bit, waiting for all pending 104 NAPI_STATE_SCHED napi->state bit, waiting for all pending
106 NAPI activity to cease. 105 NAPI activity to cease.
diff --git a/Documentation/networking/vortex.txt b/Documentation/networking/vortex.txt
index bd70976b8160..b4038ffb3bc5 100644
--- a/Documentation/networking/vortex.txt
+++ b/Documentation/networking/vortex.txt
@@ -67,8 +67,8 @@ Module parameters
67================= 67=================
68 68
69There are several parameters which may be provided to the driver when 69There are several parameters which may be provided to the driver when
70its module is loaded. These are usually placed in /etc/modprobe.conf 70its module is loaded. These are usually placed in /etc/modprobe.d/*.conf
71(/etc/modules.conf in 2.4). Example: 71configuretion files. Example:
72 72
73options 3c59x debug=3 rx_copybreak=300 73options 3c59x debug=3 rx_copybreak=300
74 74
@@ -425,7 +425,7 @@ steps you should take:
425 1) Increase the debug level. Usually this is done via: 425 1) Increase the debug level. Usually this is done via:
426 426
427 a) modprobe driver debug=7 427 a) modprobe driver debug=7
428 b) In /etc/modprobe.conf (or /etc/modules.conf for 2.4): 428 b) In /etc/modprobe.d/driver.conf:
429 options driver debug=7 429 options driver debug=7
430 430
431 2) Recreate the problem with the higher debug level, 431 2) Recreate the problem with the higher debug level,
diff --git a/Documentation/parport.txt b/Documentation/parport.txt
index 93a7ceef398d..c208e4366c03 100644
--- a/Documentation/parport.txt
+++ b/Documentation/parport.txt
@@ -36,18 +36,17 @@ addresses should not be specified for supported PCI cards since they
36are automatically detected. 36are automatically detected.
37 37
38 38
39KMod 39modprobe
40---- 40--------
41 41
42If you use kmod, you will find it useful to edit /etc/modprobe.conf. 42If you use modprobe , you will find it useful to add lines as below to a
43Here is an example of the lines that need to be added: 43configuration file in /etc/modprobe.d/ directory:.
44 44
45 alias parport_lowlevel parport_pc 45 alias parport_lowlevel parport_pc
46 options parport_pc io=0x378,0x278 irq=7,auto 46 options parport_pc io=0x378,0x278 irq=7,auto
47 47
48KMod will then automatically load parport_pc (with the options 48modprobe will load parport_pc (with the options "io=0x378,0x278 irq=7,auto")
49"io=0x378,0x278 irq=7,auto") whenever a parallel port device driver 49whenever a parallel port device driver (such as lp) is loaded.
50(such as lp) is loaded.
51 50
52Note that these are example lines only! You shouldn't in general need 51Note that these are example lines only! You shouldn't in general need
53to specify any options to parport_pc in order to be able to use a 52to specify any options to parport_pc in order to be able to use a
diff --git a/Documentation/s390/3270.txt b/Documentation/s390/3270.txt
index 7a5c73a7ed7f..7c715de99774 100644
--- a/Documentation/s390/3270.txt
+++ b/Documentation/s390/3270.txt
@@ -47,9 +47,9 @@ including the console 3270, changes subchannel identifier relative to
47one another. ReIPL as soon as possible after running the configuration 47one another. ReIPL as soon as possible after running the configuration
48script and the resulting /tmp/mkdev3270. 48script and the resulting /tmp/mkdev3270.
49 49
50If you have chosen to make tub3270 a module, you add a line to 50If you have chosen to make tub3270 a module, you add a line to a
51/etc/modprobe.conf. If you are working on a VM virtual machine, you 51configuration file under /etc/modprobe.d/. If you are working on a VM
52can use DEF GRAF to define virtual 3270 devices. 52virtual machine, you can use DEF GRAF to define virtual 3270 devices.
53 53
54You may generate both 3270 and 3215 console support, or one or the 54You may generate both 3270 and 3215 console support, or one or the
55other, or neither. If you generate both, the console type under VM is 55other, or neither. If you generate both, the console type under VM is
@@ -60,7 +60,7 @@ at boot time to a 3270 if it is a 3215.
60 60
61In brief, these are the steps: 61In brief, these are the steps:
62 1. Install the tub3270 patch 62 1. Install the tub3270 patch
63 2. (If a module) add a line to /etc/modprobe.conf 63 2. (If a module) add a line to a file in /etc/modprobe.d/*.conf
64 3. (If VM) define devices with DEF GRAF 64 3. (If VM) define devices with DEF GRAF
65 4. Reboot 65 4. Reboot
66 5. Configure 66 5. Configure
@@ -84,13 +84,12 @@ Here are the installation steps in detail:
84 make modules_install 84 make modules_install
85 85
86 2. (Perform this step only if you have configured tub3270 as a 86 2. (Perform this step only if you have configured tub3270 as a
87 module.) Add a line to /etc/modprobe.conf to automatically 87 module.) Add a line to a file /etc/modprobe.d/*.conf to automatically
88 load the driver when it's needed. With this line added, 88 load the driver when it's needed. With this line added, you will see
89 you will see login prompts appear on your 3270s as soon as 89 login prompts appear on your 3270s as soon as boot is complete (or
90 boot is complete (or with emulated 3270s, as soon as you dial 90 with emulated 3270s, as soon as you dial into your vm guest using the
91 into your vm guest using the command "DIAL <vmguestname>"). 91 command "DIAL <vmguestname>"). Since the line-mode major number is
92 Since the line-mode major number is 227, the line to add to 92 227, the line to add should be:
93 /etc/modprobe.conf should be:
94 alias char-major-227 tub3270 93 alias char-major-227 tub3270
95 94
96 3. Define graphic devices to your vm guest machine, if you 95 3. Define graphic devices to your vm guest machine, if you
diff --git a/Documentation/scsi/00-INDEX b/Documentation/scsi/00-INDEX
index b48ded55b555..b7dd6502bec5 100644
--- a/Documentation/scsi/00-INDEX
+++ b/Documentation/scsi/00-INDEX
@@ -94,3 +94,5 @@ sym53c8xx_2.txt
94 - info on second generation driver for sym53c8xx based adapters 94 - info on second generation driver for sym53c8xx based adapters
95tmscsim.txt 95tmscsim.txt
96 - info on driver for AM53c974 based adapters 96 - info on driver for AM53c974 based adapters
97ufs.txt
98 - info on Universal Flash Storage(UFS) and UFS host controller driver.
diff --git a/Documentation/scsi/aic79xx.txt b/Documentation/scsi/aic79xx.txt
index 64ac7093c872..e2d3273000d4 100644
--- a/Documentation/scsi/aic79xx.txt
+++ b/Documentation/scsi/aic79xx.txt
@@ -215,7 +215,7 @@ The following information is available in this file:
215 INCORRECTLY CAN RENDER YOUR SYSTEM INOPERABLE. 215 INCORRECTLY CAN RENDER YOUR SYSTEM INOPERABLE.
216 USE THEM WITH CAUTION. 216 USE THEM WITH CAUTION.
217 217
218 Edit the file "modprobe.conf" in the directory /etc and add/edit a 218 Put a .conf file in the /etc/modprobe.d/ directory and add/edit a
219 line containing 'options aic79xx aic79xx=[command[,command...]]' where 219 line containing 'options aic79xx aic79xx=[command[,command...]]' where
220 'command' is one or more of the following: 220 'command' is one or more of the following:
221 ----------------------------------------------------------------- 221 -----------------------------------------------------------------
diff --git a/Documentation/scsi/aic7xxx.txt b/Documentation/scsi/aic7xxx.txt
index 18f8d1905e6a..7c5d0223d444 100644
--- a/Documentation/scsi/aic7xxx.txt
+++ b/Documentation/scsi/aic7xxx.txt
@@ -190,7 +190,7 @@ The following information is available in this file:
190 INCORRECTLY CAN RENDER YOUR SYSTEM INOPERABLE. 190 INCORRECTLY CAN RENDER YOUR SYSTEM INOPERABLE.
191 USE THEM WITH CAUTION. 191 USE THEM WITH CAUTION.
192 192
193 Edit the file "modprobe.conf" in the directory /etc and add/edit a 193 Put a .conf file in the /etc/modprobe.d directory and add/edit a
194 line containing 'options aic7xxx aic7xxx=[command[,command...]]' where 194 line containing 'options aic7xxx aic7xxx=[command[,command...]]' where
195 'command' is one or more of the following: 195 'command' is one or more of the following:
196 ----------------------------------------------------------------- 196 -----------------------------------------------------------------
diff --git a/Documentation/scsi/osst.txt b/Documentation/scsi/osst.txt
index ad86c6d1e898..00c8ebb2fd18 100644
--- a/Documentation/scsi/osst.txt
+++ b/Documentation/scsi/osst.txt
@@ -66,7 +66,7 @@ recognized.
66If you want to have the module autoloaded on access to /dev/osst, you may 66If you want to have the module autoloaded on access to /dev/osst, you may
67add something like 67add something like
68alias char-major-206 osst 68alias char-major-206 osst
69to your /etc/modprobe.conf (before 2.6: modules.conf). 69to a file under /etc/modprobe.d/ directory.
70 70
71You may find it convenient to create a symbolic link 71You may find it convenient to create a symbolic link
72ln -s nosst0 /dev/tape 72ln -s nosst0 /dev/tape
diff --git a/Documentation/scsi/st.txt b/Documentation/scsi/st.txt
index 691ca292c24d..685bf3582abe 100644
--- a/Documentation/scsi/st.txt
+++ b/Documentation/scsi/st.txt
@@ -390,6 +390,10 @@ MTSETDRVBUFFER
390 MT_ST_SYSV sets the SYSV semantics (mode) 390 MT_ST_SYSV sets the SYSV semantics (mode)
391 MT_ST_NOWAIT enables immediate mode (i.e., don't wait for 391 MT_ST_NOWAIT enables immediate mode (i.e., don't wait for
392 the command to finish) for some commands (e.g., rewind) 392 the command to finish) for some commands (e.g., rewind)
393 MT_ST_NOWAIT_EOF enables immediate filemark mode (i.e. when
394 writing a filemark, don't wait for it to complete). Please
395 see the BASICS note about MTWEOFI with respect to the
396 possible dangers of writing immediate filemarks.
393 MT_ST_SILI enables setting the SILI bit in SCSI commands when 397 MT_ST_SILI enables setting the SILI bit in SCSI commands when
394 reading in variable block mode to enhance performance when 398 reading in variable block mode to enhance performance when
395 reading blocks shorter than the byte count; set this only 399 reading blocks shorter than the byte count; set this only
diff --git a/Documentation/scsi/ufs.txt b/Documentation/scsi/ufs.txt
new file mode 100644
index 000000000000..41a6164592aa
--- /dev/null
+++ b/Documentation/scsi/ufs.txt
@@ -0,0 +1,133 @@
1 Universal Flash Storage
2 =======================
3
4
5Contents
6--------
7
81. Overview
92. UFS Architecture Overview
10 2.1 Application Layer
11 2.2 UFS Transport Protocol(UTP) layer
12 2.3 UFS Interconnect(UIC) Layer
133. UFSHCD Overview
14 3.1 UFS controller initialization
15 3.2 UTP Transfer requests
16 3.3 UFS error handling
17 3.4 SCSI Error handling
18
19
201. Overview
21-----------
22
23Universal Flash Storage(UFS) is a storage specification for flash devices.
24It is aimed to provide a universal storage interface for both
25embedded and removable flash memory based storage in mobile
26devices such as smart phones and tablet computers. The specification
27is defined by JEDEC Solid State Technology Association. UFS is based
28on MIPI M-PHY physical layer standard. UFS uses MIPI M-PHY as the
29physical layer and MIPI Unipro as the link layer.
30
31The main goals of UFS is to provide,
32 * Optimized performance:
33 For UFS version 1.0 and 1.1 the target performance is as follows,
34 Support for Gear1 is mandatory (rate A: 1248Mbps, rate B: 1457.6Mbps)
35 Support for Gear2 is optional (rate A: 2496Mbps, rate B: 2915.2Mbps)
36 Future version of the standard,
37 Gear3 (rate A: 4992Mbps, rate B: 5830.4Mbps)
38 * Low power consumption
39 * High random IOPs and low latency
40
41
422. UFS Architecture Overview
43----------------------------
44
45UFS has a layered communication architecture which is based on SCSI
46SAM-5 architectural model.
47
48UFS communication architecture consists of following layers,
49
502.1 Application Layer
51
52 The Application layer is composed of UFS command set layer(UCS),
53 Task Manager and Device manager. The UFS interface is designed to be
54 protocol agnostic, however SCSI has been selected as a baseline
55 protocol for versions 1.0 and 1.1 of UFS protocol layer.
56 UFS supports subset of SCSI commands defined by SPC-4 and SBC-3.
57 * UCS: It handles SCSI commands supported by UFS specification.
58 * Task manager: It handles task management functions defined by the
59 UFS which are meant for command queue control.
60 * Device manager: It handles device level operations and device
61 configuration operations. Device level operations mainly involve
62 device power management operations and commands to Interconnect
63 layers. Device level configurations involve handling of query
64 requests which are used to modify and retrieve configuration
65 information of the device.
66
672.2 UFS Transport Protocol(UTP) layer
68
69 UTP layer provides services for
70 the higher layers through Service Access Points. UTP defines 3
71 service access points for higher layers.
72 * UDM_SAP: Device manager service access point is exposed to device
73 manager for device level operations. These device level operations
74 are done through query requests.
75 * UTP_CMD_SAP: Command service access point is exposed to UFS command
76 set layer(UCS) to transport commands.
77 * UTP_TM_SAP: Task management service access point is exposed to task
78 manager to transport task management functions.
79 UTP transports messages through UFS protocol information unit(UPIU).
80
812.3 UFS Interconnect(UIC) Layer
82
83 UIC is the lowest layer of UFS layered architecture. It handles
84 connection between UFS host and UFS device. UIC consists of
85 MIPI UniPro and MIPI M-PHY. UIC provides 2 service access points
86 to upper layer,
87 * UIC_SAP: To transport UPIU between UFS host and UFS device.
88 * UIO_SAP: To issue commands to Unipro layers.
89
90
913. UFSHCD Overview
92------------------
93
94The UFS host controller driver is based on Linux SCSI Framework.
95UFSHCD is a low level device driver which acts as an interface between
96SCSI Midlayer and PCIe based UFS host controllers.
97
98The current UFSHCD implementation supports following functionality,
99
1003.1 UFS controller initialization
101
102 The initialization module brings UFS host controller to active state
103 and prepares the controller to transfer commands/response between
104 UFSHCD and UFS device.
105
1063.2 UTP Transfer requests
107
108 Transfer request handling module of UFSHCD receives SCSI commands
109 from SCSI Midlayer, forms UPIUs and issues the UPIUs to UFS Host
110 controller. Also, the module decodes, responses received from UFS
111 host controller in the form of UPIUs and intimates the SCSI Midlayer
112 of the status of the command.
113
1143.3 UFS error handling
115
116 Error handling module handles Host controller fatal errors,
117 Device fatal errors and UIC interconnect layer related errors.
118
1193.4 SCSI Error handling
120
121 This is done through UFSHCD SCSI error handling routines registered
122 with SCSI Midlayer. Examples of some of the error handling commands
123 issues by SCSI Midlayer are Abort task, Lun reset and host reset.
124 UFSHCD Routines to perform these tasks are registered with
125 SCSI Midlayer through .eh_abort_handler, .eh_device_reset_handler and
126 .eh_host_reset_handler.
127
128In this version of UFSHCD Query requests and power management
129functionality are not implemented.
130
131UFS Specifications can be found at,
132UFS - http://www.jedec.org/sites/default/files/docs/JESD220.pdf
133UFSHCI - http://www.jedec.org/sites/default/files/docs/JESD223.pdf
diff --git a/Documentation/serial/computone.txt b/Documentation/serial/computone.txt
index 39ddcdbeeb85..a6a1158ea2ba 100644
--- a/Documentation/serial/computone.txt
+++ b/Documentation/serial/computone.txt
@@ -49,7 +49,7 @@ Hardware - If you have an ISA card, find a free interrupt and io port.
49 49
50 Note the hardware address from the Computone ISA cards installed into 50 Note the hardware address from the Computone ISA cards installed into
51 the system. These are required for editing ip2.c or editing 51 the system. These are required for editing ip2.c or editing
52 /etc/modprobe.conf, or for specification on the modprobe 52 /etc/modprobe.d/*.conf, or for specification on the modprobe
53 command line. 53 command line.
54 54
55 Note that the /etc/modules.conf should be used for older (pre-2.6) 55 Note that the /etc/modules.conf should be used for older (pre-2.6)
@@ -66,7 +66,7 @@ b) Run "make config" or "make menuconfig" or "make xconfig"
66c) Set address on ISA cards then: 66c) Set address on ISA cards then:
67 edit /usr/src/linux/drivers/char/ip2.c if needed 67 edit /usr/src/linux/drivers/char/ip2.c if needed
68 or 68 or
69 edit /etc/modprobe.conf if needed (module). 69 edit config file in /etc/modprobe.d/ if needed (module).
70 or both to match this setting. 70 or both to match this setting.
71d) Run "make modules" 71d) Run "make modules"
72e) Run "make modules_install" 72e) Run "make modules_install"
@@ -153,11 +153,11 @@ the irqs are not specified the driver uses the default in ip2.c (which
153selects polled mode). If no base addresses are specified the defaults in 153selects polled mode). If no base addresses are specified the defaults in
154ip2.c are used. If you are autoloading the driver module with kerneld or 154ip2.c are used. If you are autoloading the driver module with kerneld or
155kmod the base addresses and interrupt number must also be set in ip2.c 155kmod the base addresses and interrupt number must also be set in ip2.c
156and recompile or just insert and options line in /etc/modprobe.conf or both. 156and recompile or just insert and options line in /etc/modprobe.d/*.conf or both.
157The options line is equivalent to the command line and takes precedence over 157The options line is equivalent to the command line and takes precedence over
158what is in ip2.c. 158what is in ip2.c.
159 159
160/etc/modprobe.conf sample: 160config sample to put /etc/modprobe.d/*.conf:
161 options ip2 io=1,0x328 irq=1,10 161 options ip2 io=1,0x328 irq=1,10
162 alias char-major-71 ip2 162 alias char-major-71 ip2
163 alias char-major-72 ip2 163 alias char-major-72 ip2
diff --git a/Documentation/serial/rocket.txt b/Documentation/serial/rocket.txt
index 1d8582990435..60b039891057 100644
--- a/Documentation/serial/rocket.txt
+++ b/Documentation/serial/rocket.txt
@@ -62,7 +62,7 @@ in the system log at /var/log/messages.
62 62
63If installed as a module, the module must be loaded. This can be done 63If installed as a module, the module must be loaded. This can be done
64manually by entering "modprobe rocket". To have the module loaded automatically 64manually by entering "modprobe rocket". To have the module loaded automatically
65upon system boot, edit the /etc/modprobe.conf file and add the line 65upon system boot, edit a /etc/modprobe.d/*.conf file and add the line
66"alias char-major-46 rocket". 66"alias char-major-46 rocket".
67 67
68In order to use the ports, their device names (nodes) must be created with mknod. 68In order to use the ports, their device names (nodes) must be created with mknod.
diff --git a/Documentation/serial/stallion.txt b/Documentation/serial/stallion.txt
index 5c4902d9a5be..55090914a9c5 100644
--- a/Documentation/serial/stallion.txt
+++ b/Documentation/serial/stallion.txt
@@ -139,8 +139,8 @@ secondary address 0x280 and IRQ 10.
139 139
140You will probably want to enter this module load and configuration information 140You will probably want to enter this module load and configuration information
141into your system startup scripts so that the drivers are loaded and configured 141into your system startup scripts so that the drivers are loaded and configured
142on each system boot. Typically the start up script would be something like 142on each system boot. Typically configuration files are put in the
143/etc/modprobe.conf. 143/etc/modprobe.d/ directory.
144 144
145 145
1462.2 STATIC DRIVER CONFIGURATION: 1462.2 STATIC DRIVER CONFIGURATION:
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 6f75ba3b8a39..8c16d50f6cb6 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -2044,7 +2044,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
2044 Install the necessary firmware files in alsa-firmware package. 2044 Install the necessary firmware files in alsa-firmware package.
2045 When no hotplug fw loader is available, you need to load the 2045 When no hotplug fw loader is available, you need to load the
2046 firmware via vxloader utility in alsa-tools package. To invoke 2046 firmware via vxloader utility in alsa-tools package. To invoke
2047 vxloader automatically, add the following to /etc/modprobe.conf 2047 vxloader automatically, add the following to /etc/modprobe.d/alsa.conf
2048 2048
2049 install snd-vx222 /sbin/modprobe --first-time -i snd-vx222 && /usr/bin/vxloader 2049 install snd-vx222 /sbin/modprobe --first-time -i snd-vx222 && /usr/bin/vxloader
2050 2050
@@ -2168,10 +2168,10 @@ corresponds to the card index of ALSA. Usually, define this
2168as the same card module. 2168as the same card module.
2169 2169
2170An example configuration for a single emu10k1 card is like below: 2170An example configuration for a single emu10k1 card is like below:
2171----- /etc/modprobe.conf 2171----- /etc/modprobe.d/alsa.conf
2172alias snd-card-0 snd-emu10k1 2172alias snd-card-0 snd-emu10k1
2173alias sound-slot-0 snd-emu10k1 2173alias sound-slot-0 snd-emu10k1
2174----- /etc/modprobe.conf 2174----- /etc/modprobe.d/alsa.conf
2175 2175
2176The available number of auto-loaded sound cards depends on the module 2176The available number of auto-loaded sound cards depends on the module
2177option "cards_limit" of snd module. As default it's set to 1. 2177option "cards_limit" of snd module. As default it's set to 1.
@@ -2184,7 +2184,7 @@ cards is kept consistent.
2184 2184
2185An example configuration for two sound cards is like below: 2185An example configuration for two sound cards is like below:
2186 2186
2187----- /etc/modprobe.conf 2187----- /etc/modprobe.d/alsa.conf
2188# ALSA portion 2188# ALSA portion
2189options snd cards_limit=2 2189options snd cards_limit=2
2190alias snd-card-0 snd-interwave 2190alias snd-card-0 snd-interwave
@@ -2194,7 +2194,7 @@ options snd-ens1371 index=1
2194# OSS/Free portion 2194# OSS/Free portion
2195alias sound-slot-0 snd-interwave 2195alias sound-slot-0 snd-interwave
2196alias sound-slot-1 snd-ens1371 2196alias sound-slot-1 snd-ens1371
2197----- /etc/modprobe.conf 2197----- /etc/modprobe.d/alsa.conf
2198 2198
2199In this example, the interwave card is always loaded as the first card 2199In this example, the interwave card is always loaded as the first card
2200(index 0) and ens1371 as the second (index 1). 2200(index 0) and ens1371 as the second (index 1).
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt
index a4c53d8961e1..654dd3b694a8 100644
--- a/Documentation/sound/alsa/Audiophile-Usb.txt
+++ b/Documentation/sound/alsa/Audiophile-Usb.txt
@@ -232,7 +232,7 @@ The parameter can be given:
232 # modprobe snd-usb-audio index=1 device_setup=0x09 232 # modprobe snd-usb-audio index=1 device_setup=0x09
233 233
234 * Or while configuring the modules options in your modules configuration file 234 * Or while configuring the modules options in your modules configuration file
235 - For Fedora distributions, edit the /etc/modprobe.conf file: 235 (tipically a .conf file in /etc/modprobe.d/ directory:
236 alias snd-card-1 snd-usb-audio 236 alias snd-card-1 snd-usb-audio
237 options snd-usb-audio index=1 device_setup=0x09 237 options snd-usb-audio index=1 device_setup=0x09
238 238
@@ -253,7 +253,7 @@ CAUTION when initializing the device
253 - first turn off the device 253 - first turn off the device
254 - de-register the snd-usb-audio module (modprobe -r) 254 - de-register the snd-usb-audio module (modprobe -r)
255 - change the device_setup parameter by changing the device_setup 255 - change the device_setup parameter by changing the device_setup
256 option in /etc/modprobe.conf 256 option in /etc/modprobe.d/*.conf
257 - turn on the device 257 - turn on the device
258 * A workaround for this last issue has been applied to kernel 2.6.23, but it may not 258 * A workaround for this last issue has been applied to kernel 2.6.23, but it may not
259 be enough to ensure the 'stability' of the device initialization. 259 be enough to ensure the 'stability' of the device initialization.
diff --git a/Documentation/sound/alsa/MIXART.txt b/Documentation/sound/alsa/MIXART.txt
index ef42c44fa1f2..4ee35b4fbe4a 100644
--- a/Documentation/sound/alsa/MIXART.txt
+++ b/Documentation/sound/alsa/MIXART.txt
@@ -76,9 +76,9 @@ FIRMWARE
76 when CONFIG_FW_LOADER is set. The mixartloader is necessary only 76 when CONFIG_FW_LOADER is set. The mixartloader is necessary only
77 for older versions or when you build the driver into kernel.] 77 for older versions or when you build the driver into kernel.]
78 78
79For loading the firmware automatically after the module is loaded, use 79For loading the firmware automatically after the module is loaded, use a
80the post-install command. For example, add the following entry to 80install command. For example, add the following entry to
81/etc/modprobe.conf for miXart driver: 81/etc/modprobe.d/mixart.conf for miXart driver:
82 82
83 install snd-mixart /sbin/modprobe --first-time -i snd-mixart && \ 83 install snd-mixart /sbin/modprobe --first-time -i snd-mixart && \
84 /usr/bin/mixartloader 84 /usr/bin/mixartloader
diff --git a/Documentation/sound/alsa/OSS-Emulation.txt b/Documentation/sound/alsa/OSS-Emulation.txt
index 022aaeb0e9dd..152ca2a3f1bd 100644
--- a/Documentation/sound/alsa/OSS-Emulation.txt
+++ b/Documentation/sound/alsa/OSS-Emulation.txt
@@ -19,7 +19,7 @@ the card number and the minor unit number. Usually you don't have to
19define these aliases by yourself. 19define these aliases by yourself.
20 20
21Only necessary step for auto-loading of OSS modules is to define the 21Only necessary step for auto-loading of OSS modules is to define the
22card alias in /etc/modprobe.conf, such as 22card alias in /etc/modprobe.d/alsa.conf, such as
23 23
24 alias sound-slot-0 snd-emu10k1 24 alias sound-slot-0 snd-emu10k1
25 25
diff --git a/Documentation/sound/oss/AudioExcelDSP16 b/Documentation/sound/oss/AudioExcelDSP16
index e0dc0641b480..ea8549faede9 100644
--- a/Documentation/sound/oss/AudioExcelDSP16
+++ b/Documentation/sound/oss/AudioExcelDSP16
@@ -41,7 +41,7 @@ mpu_base I/O base address for activate MPU-401 mode
41 (0x300, 0x310, 0x320 or 0x330) 41 (0x300, 0x310, 0x320 or 0x330)
42mpu_irq MPU-401 irq line (5, 7, 9, 10 or 0) 42mpu_irq MPU-401 irq line (5, 7, 9, 10 or 0)
43 43
44The /etc/modprobe.conf will have lines like this: 44A configuration file in /etc/modprobe.d/ directory will have lines like this:
45 45
46options opl3 io=0x388 46options opl3 io=0x388
47options ad1848 io=0x530 irq=11 dma=3 47options ad1848 io=0x530 irq=11 dma=3
@@ -51,11 +51,11 @@ Where the aedsp16 options are the options for this driver while opl3 and
51ad1848 are the corresponding options for the MSS and OPL3 modules. 51ad1848 are the corresponding options for the MSS and OPL3 modules.
52 52
53Loading MSS and OPL3 needs to pre load the aedsp16 module to set up correctly 53Loading MSS and OPL3 needs to pre load the aedsp16 module to set up correctly
54the sound card. Installation dependencies must be written in the modprobe.conf 54the sound card. Installation dependencies must be written in configuration
55file: 55files under /etc/modprobe.d/ directory:
56 56
57install ad1848 /sbin/modprobe aedsp16 && /sbin/modprobe -i ad1848 57softdep ad1848 pre: aedsp16
58install opl3 /sbin/modprobe aedsp16 && /sbin/modprobe -i opl3 58softdep opl3 pre: aedsp16
59 59
60Then you must load the sound modules stack in this order: 60Then you must load the sound modules stack in this order:
61sound -> aedsp16 -> [ ad1848, opl3 ] 61sound -> aedsp16 -> [ ad1848, opl3 ]
diff --git a/Documentation/sound/oss/CMI8330 b/Documentation/sound/oss/CMI8330
index 9c439f1a6dba..8a5fd1611c6f 100644
--- a/Documentation/sound/oss/CMI8330
+++ b/Documentation/sound/oss/CMI8330
@@ -143,11 +143,10 @@ CONFIG_SOUND_MSS=m
143 143
144 144
145 145
146Alma Chao <elysian@ethereal.torsion.org> suggests the following /etc/modprobe.conf: 146Alma Chao <elysian@ethereal.torsion.org> suggests the following in
147a /etc/modprobe.d/*conf file:
147 148
148alias sound ad1848 149alias sound ad1848
149alias synth0 opl3 150alias synth0 opl3
150options ad1848 io=0x530 irq=7 dma=0 soundpro=1 151options ad1848 io=0x530 irq=7 dma=0 soundpro=1
151options opl3 io=0x388 152options opl3 io=0x388
152
153
diff --git a/Documentation/sound/oss/Introduction b/Documentation/sound/oss/Introduction
index 75d967ff9266..42da2d8fa372 100644
--- a/Documentation/sound/oss/Introduction
+++ b/Documentation/sound/oss/Introduction
@@ -167,8 +167,8 @@ in a file such as /root/soundon.sh.
167MODPROBE: 167MODPROBE:
168========= 168=========
169 169
170If loading via modprobe, these common files are automatically loaded 170If loading via modprobe, these common files are automatically loaded when
171when requested by modprobe. For example, my /etc/modprobe.conf contains: 171requested by modprobe. For example, my /etc/modprobe.d/oss.conf contains:
172 172
173alias sound sb 173alias sound sb
174options sb io=0x240 irq=9 dma=3 dma16=5 mpu_io=0x300 174options sb io=0x240 irq=9 dma=3 dma16=5 mpu_io=0x300
@@ -228,7 +228,7 @@ http://www.opensound.com. Before loading the commercial sound
228driver, you should do the following: 228driver, you should do the following:
229 229
2301. remove sound modules (detailed above) 2301. remove sound modules (detailed above)
2312. remove the sound modules from /etc/modprobe.conf 2312. remove the sound modules from /etc/modprobe.d/*.conf
2323. move the sound modules from /lib/modules/<kernel>/misc 2323. move the sound modules from /lib/modules/<kernel>/misc
233 (for example, I make a /lib/modules/<kernel>/misc/tmp 233 (for example, I make a /lib/modules/<kernel>/misc/tmp
234 directory and copy the sound module files to that 234 directory and copy the sound module files to that
@@ -265,7 +265,7 @@ twice, you need to do the following:
265 sb.o could be copied (or symlinked) to sb1.o for the 265 sb.o could be copied (or symlinked) to sb1.o for the
266 second SoundBlaster. 266 second SoundBlaster.
267 267
2682. Make a second entry in /etc/modprobe.conf, for example, 2682. Make a second entry in /etc/modprobe.d/*conf, for example,
269 sound1 or sb1. This second entry should refer to the 269 sound1 or sb1. This second entry should refer to the
270 new module names for example sb1, and should include 270 new module names for example sb1, and should include
271 the I/O, etc. for the second sound card. 271 the I/O, etc. for the second sound card.
@@ -369,7 +369,7 @@ There are several ways of configuring your sound:
3692) On the command line when using insmod or in a bash script 3692) On the command line when using insmod or in a bash script
370 using command line calls to load sound. 370 using command line calls to load sound.
371 371
3723) In /etc/modprobe.conf when using modprobe. 3723) In /etc/modprobe.d/*conf when using modprobe.
373 373
3744) Via Red Hat's GPL'd /usr/sbin/sndconfig program (text based). 3744) Via Red Hat's GPL'd /usr/sbin/sndconfig program (text based).
375 375
diff --git a/Documentation/sound/oss/Opti b/Documentation/sound/oss/Opti
index c15af3c07d46..4cd5d9ab3580 100644
--- a/Documentation/sound/oss/Opti
+++ b/Documentation/sound/oss/Opti
@@ -18,7 +18,7 @@ force the card into a mode in which it can be programmed.
18If you have another OS installed on your computer it is recommended 18If you have another OS installed on your computer it is recommended
19that Linux and the other OS use the same resources. 19that Linux and the other OS use the same resources.
20 20
21Also, it is recommended that resources specified in /etc/modprobe.conf 21Also, it is recommended that resources specified in /etc/modprobe.d/*.conf
22and resources specified in /etc/isapnp.conf agree. 22and resources specified in /etc/isapnp.conf agree.
23 23
24Compiling the sound driver 24Compiling the sound driver
@@ -67,11 +67,7 @@ address is hard-coded into the driver.
67 67
68Using kmod and autoloading the sound driver 68Using kmod and autoloading the sound driver
69------------------------------------------- 69-------------------------------------------
70Comment: as of linux-2.1.90 kmod is replacing kerneld. 70Config files in '/etc/modprobe.d/' are used as below:
71The config file '/etc/modprobe.conf' is used as before.
72
73This is the sound part of my /etc/modprobe.conf file.
74Following that I will explain each line.
75 71
76alias mixer0 mad16 72alias mixer0 mad16
77alias audio0 mad16 73alias audio0 mad16
diff --git a/Documentation/sound/oss/PAS16 b/Documentation/sound/oss/PAS16
index 3dca4b75988e..5c27229eec8c 100644
--- a/Documentation/sound/oss/PAS16
+++ b/Documentation/sound/oss/PAS16
@@ -128,7 +128,7 @@ CONFIG_SOUND_YM3812
128 You can then get OPL3 functionality by issuing the command: 128 You can then get OPL3 functionality by issuing the command:
129 insmod opl3 129 insmod opl3
130 In addition, you must either add the following line to 130 In addition, you must either add the following line to
131 /etc/modprobe.conf: 131 /etc/modprobe.d/*.conf:
132 options opl3 io=0x388 132 options opl3 io=0x388
133 or else add the following line to /etc/lilo.conf: 133 or else add the following line to /etc/lilo.conf:
134 opl3=0x388 134 opl3=0x388
@@ -158,5 +158,5 @@ following line would be appropriate:
158append="pas2=0x388,10,3,-1,0,-1,-1,-1 opl3=0x388" 158append="pas2=0x388,10,3,-1,0,-1,-1,-1 opl3=0x388"
159 159
160If sound is built totally modular, the above options may be 160If sound is built totally modular, the above options may be
161specified in /etc/modprobe.conf for pas2, sb and opl3 161specified in /etc/modprobe.d/*.conf for pas2, sb and opl3
162respectively. 162respectively.
diff --git a/Documentation/sound/oss/README.modules b/Documentation/sound/oss/README.modules
index e691d74e1e5e..cdc039421a46 100644
--- a/Documentation/sound/oss/README.modules
+++ b/Documentation/sound/oss/README.modules
@@ -26,7 +26,7 @@ Note that it is no longer necessary or possible to configure sound in the
26drivers/sound dir. Now one simply configures and makes one's kernel and 26drivers/sound dir. Now one simply configures and makes one's kernel and
27modules in the usual way. 27modules in the usual way.
28 28
29 Then, add to your /etc/modprobe.conf something like: 29 Then, add to your /etc/modprobe.d/oss.conf something like:
30 30
31alias char-major-14-* sb 31alias char-major-14-* sb
32install sb /sbin/modprobe -i sb && /sbin/modprobe adlib_card 32install sb /sbin/modprobe -i sb && /sbin/modprobe adlib_card
@@ -36,7 +36,7 @@ options adlib_card io=0x388 # FM synthesizer
36 Alternatively, if you have compiled in kernel level ISAPnP support: 36 Alternatively, if you have compiled in kernel level ISAPnP support:
37 37
38alias char-major-14 sb 38alias char-major-14 sb
39post-install sb /sbin/modprobe "-k" "adlib_card" 39softdep sb post: adlib_card
40options adlib_card io=0x388 40options adlib_card io=0x388
41 41
42 The effect of this is that the sound driver and all necessary bits and 42 The effect of this is that the sound driver and all necessary bits and
@@ -66,12 +66,12 @@ args are expected.
66 Note that at present there is no way to configure the io, irq and other 66 Note that at present there is no way to configure the io, irq and other
67parameters for the modular drivers as one does for the wired drivers.. One 67parameters for the modular drivers as one does for the wired drivers.. One
68needs to pass the modules the necessary parameters as arguments, either 68needs to pass the modules the necessary parameters as arguments, either
69with /etc/modprobe.conf or with command-line args to modprobe, e.g. 69with /etc/modprobe.d/*.conf or with command-line args to modprobe, e.g.
70 70
71modprobe sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330 71modprobe sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330
72modprobe adlib_card io=0x388 72modprobe adlib_card io=0x388
73 73
74 recommend using /etc/modprobe.conf. 74 recommend using /etc/modprobe.d/*.conf.
75 75
76Persistent DMA Buffers: 76Persistent DMA Buffers:
77 77
@@ -89,7 +89,7 @@ wasteful of RAM, but it guarantees that sound always works.
89 89
90To make the sound driver use persistent DMA buffers we need to pass the 90To make the sound driver use persistent DMA buffers we need to pass the
91sound.o module a "dmabuf=1" command-line argument. This is normally done 91sound.o module a "dmabuf=1" command-line argument. This is normally done
92in /etc/modprobe.conf like so: 92in /etc/modprobe.d/*.conf files like so:
93 93
94options sound dmabuf=1 94options sound dmabuf=1
95 95
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index 312e3754e8c5..642f84495b29 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -241,9 +241,8 @@ command you are interested in.
241 241
242* I have more questions, who can I ask? 242* I have more questions, who can I ask?
243~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 243~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
244And I'll answer any questions about the registration system you got, also 244Just ask them on the linux-kernel mailing list:
245responding as soon as possible. 245 linux-kernel@vger.kernel.org
246 -Crutcher
247 246
248* Credits 247* Credits
249~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 248~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt
index 817df299ea07..4204eb01fd38 100644
--- a/Documentation/usb/power-management.txt
+++ b/Documentation/usb/power-management.txt
@@ -179,7 +179,8 @@ do:
179 179
180 modprobe usbcore autosuspend=5 180 modprobe usbcore autosuspend=5
181 181
182Equivalently, you could add to /etc/modprobe.conf a line saying: 182Equivalently, you could add to a configuration file in /etc/modprobe.d
183a line saying:
183 184
184 options usbcore autosuspend=5 185 options usbcore autosuspend=5
185 186
diff --git a/Documentation/video4linux/CQcam.txt b/Documentation/video4linux/CQcam.txt
index 8977e7ce4dab..6e680fec1e9c 100644
--- a/Documentation/video4linux/CQcam.txt
+++ b/Documentation/video4linux/CQcam.txt
@@ -61,29 +61,19 @@ But that is my personal preference.
612.2 Configuration 612.2 Configuration
62 62
63 The configuration requires module configuration and device 63 The configuration requires module configuration and device
64configuration. I like kmod or kerneld process with the 64configuration. The following sections detail these procedures.
65/etc/modprobe.conf file so the modules can automatically load/unload as
66they are used. The video devices could already exist, be generated
67using MAKEDEV, or need to be created. The following sections detail
68these procedures.
69 65
70 66
712.1 Module Configuration 672.1 Module Configuration
72 68
73 Using modules requires a bit of work to install and pass the 69 Using modules requires a bit of work to install and pass the
74parameters. Understand that entries in /etc/modprobe.conf of: 70parameters. Understand that entries in /etc/modprobe.d/*.conf of:
75 71
76 alias parport_lowlevel parport_pc 72 alias parport_lowlevel parport_pc
77 options parport_pc io=0x378 irq=none 73 options parport_pc io=0x378 irq=none
78 alias char-major-81 videodev 74 alias char-major-81 videodev
79 alias char-major-81-0 c-qcam 75 alias char-major-81-0 c-qcam
80 76
81will cause the kmod/modprobe to do certain things. If you are
82using kmod, then a request for a 'char-major-81-0' will cause
83the 'c-qcam' module to load. If you have other video sources with
84modules, you might want to assign the different minor numbers to
85different modules.
86
872.2 Device Configuration 772.2 Device Configuration
88 78
89 At this point, we need to ensure that the device files exist. 79 At this point, we need to ensure that the device files exist.
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran
index 9ed629d4874b..b5a911fd0602 100644
--- a/Documentation/video4linux/Zoran
+++ b/Documentation/video4linux/Zoran
@@ -255,7 +255,7 @@ Load zr36067.o. If it can't autodetect your card, use the card=X insmod
255option with X being the card number as given in the previous section. 255option with X being the card number as given in the previous section.
256To have more than one card, use card=X1[,X2[,X3,[X4[..]]]] 256To have more than one card, use card=X1[,X2[,X3,[X4[..]]]]
257 257
258To automate this, add the following to your /etc/modprobe.conf: 258To automate this, add the following to your /etc/modprobe.d/zoran.conf:
259 259
260options zr36067 card=X1[,X2[,X3[,X4[..]]]] 260options zr36067 card=X1[,X2[,X3[,X4[..]]]]
261alias char-major-81-0 zr36067 261alias char-major-81-0 zr36067
diff --git a/Documentation/video4linux/bttv/Modules.conf b/Documentation/video4linux/bttv/Modules.conf
index 753f15956eb8..8f258faf18f1 100644
--- a/Documentation/video4linux/bttv/Modules.conf
+++ b/Documentation/video4linux/bttv/Modules.conf
@@ -1,4 +1,4 @@
1# For modern kernels (2.6 or above), this belongs in /etc/modprobe.conf 1# For modern kernels (2.6 or above), this belongs in /etc/modprobe.d/*.conf
2# For for 2.4 kernels or earlier, this belongs in /etc/modules.conf. 2# For for 2.4 kernels or earlier, this belongs in /etc/modules.conf.
3 3
4# i2c 4# i2c
diff --git a/Documentation/video4linux/meye.txt b/Documentation/video4linux/meye.txt
index 34e2842c70ae..a051152ea99c 100644
--- a/Documentation/video4linux/meye.txt
+++ b/Documentation/video4linux/meye.txt
@@ -55,7 +55,7 @@ Module use:
55----------- 55-----------
56 56
57In order to automatically load the meye module on use, you can put those lines 57In order to automatically load the meye module on use, you can put those lines
58in your /etc/modprobe.conf file: 58in your /etc/modprobe.d/meye.conf file:
59 59
60 alias char-major-81 videodev 60 alias char-major-81 videodev
61 alias char-major-81-0 meye 61 alias char-major-81-0 meye
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index e1d94bf4056e..6386f8c0482e 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -95,7 +95,7 @@ described as 'basic' will be available.
95Capability: basic 95Capability: basic
96Architectures: all 96Architectures: all
97Type: system ioctl 97Type: system ioctl
98Parameters: none 98Parameters: machine type identifier (KVM_VM_*)
99Returns: a VM fd that can be used to control the new virtual machine. 99Returns: a VM fd that can be used to control the new virtual machine.
100 100
101The new VM has no virtual cpus and no memory. An mmap() of a VM fd 101The new VM has no virtual cpus and no memory. An mmap() of a VM fd
@@ -103,6 +103,11 @@ will access the virtual machine's physical address space; offset zero
103corresponds to guest physical address zero. Use of mmap() on a VM fd 103corresponds to guest physical address zero. Use of mmap() on a VM fd
104is discouraged if userspace memory allocation (KVM_CAP_USER_MEMORY) is 104is discouraged if userspace memory allocation (KVM_CAP_USER_MEMORY) is
105available. 105available.
106You most certainly want to use 0 as machine type.
107
108In order to create user controlled virtual machines on S390, check
109KVM_CAP_S390_UCONTROL and use the flag KVM_VM_S390_UCONTROL as
110privileged user (CAP_SYS_ADMIN).
106 111
1074.3 KVM_GET_MSR_INDEX_LIST 1124.3 KVM_GET_MSR_INDEX_LIST
108 113
@@ -213,6 +218,11 @@ allocation of vcpu ids. For example, if userspace wants
213single-threaded guest vcpus, it should make all vcpu ids be a multiple 218single-threaded guest vcpus, it should make all vcpu ids be a multiple
214of the number of vcpus per vcore. 219of the number of vcpus per vcore.
215 220
221For virtual cpus that have been created with S390 user controlled virtual
222machines, the resulting vcpu fd can be memory mapped at page offset
223KVM_S390_SIE_PAGE_OFFSET in order to obtain a memory map of the virtual
224cpu's hardware control block.
225
2164.8 KVM_GET_DIRTY_LOG (vm ioctl) 2264.8 KVM_GET_DIRTY_LOG (vm ioctl)
217 227
218Capability: basic 228Capability: basic
@@ -1159,6 +1169,14 @@ following flags are specified:
1159 1169
1160/* Depends on KVM_CAP_IOMMU */ 1170/* Depends on KVM_CAP_IOMMU */
1161#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 1171#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
1172/* The following two depend on KVM_CAP_PCI_2_3 */
1173#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
1174#define KVM_DEV_ASSIGN_MASK_INTX (1 << 2)
1175
1176If KVM_DEV_ASSIGN_PCI_2_3 is set, the kernel will manage legacy INTx interrupts
1177via the PCI-2.3-compliant device-level mask, thus enable IRQ sharing with other
1178assigned devices or host devices. KVM_DEV_ASSIGN_MASK_INTX specifies the
1179guest's view on the INTx mask, see KVM_ASSIGN_SET_INTX_MASK for details.
1162 1180
1163The KVM_DEV_ASSIGN_ENABLE_IOMMU flag is a mandatory option to ensure 1181The KVM_DEV_ASSIGN_ENABLE_IOMMU flag is a mandatory option to ensure
1164isolation of the device. Usages not specifying this flag are deprecated. 1182isolation of the device. Usages not specifying this flag are deprecated.
@@ -1399,6 +1417,71 @@ The following flags are defined:
1399If datamatch flag is set, the event will be signaled only if the written value 1417If datamatch flag is set, the event will be signaled only if the written value
1400to the registered address is equal to datamatch in struct kvm_ioeventfd. 1418to the registered address is equal to datamatch in struct kvm_ioeventfd.
1401 1419
14204.59 KVM_DIRTY_TLB
1421
1422Capability: KVM_CAP_SW_TLB
1423Architectures: ppc
1424Type: vcpu ioctl
1425Parameters: struct kvm_dirty_tlb (in)
1426Returns: 0 on success, -1 on error
1427
1428struct kvm_dirty_tlb {
1429 __u64 bitmap;
1430 __u32 num_dirty;
1431};
1432
1433This must be called whenever userspace has changed an entry in the shared
1434TLB, prior to calling KVM_RUN on the associated vcpu.
1435
1436The "bitmap" field is the userspace address of an array. This array
1437consists of a number of bits, equal to the total number of TLB entries as
1438determined by the last successful call to KVM_CONFIG_TLB, rounded up to the
1439nearest multiple of 64.
1440
1441Each bit corresponds to one TLB entry, ordered the same as in the shared TLB
1442array.
1443
1444The array is little-endian: the bit 0 is the least significant bit of the
1445first byte, bit 8 is the least significant bit of the second byte, etc.
1446This avoids any complications with differing word sizes.
1447
1448The "num_dirty" field is a performance hint for KVM to determine whether it
1449should skip processing the bitmap and just invalidate everything. It must
1450be set to the number of set bits in the bitmap.
1451
14524.60 KVM_ASSIGN_SET_INTX_MASK
1453
1454Capability: KVM_CAP_PCI_2_3
1455Architectures: x86
1456Type: vm ioctl
1457Parameters: struct kvm_assigned_pci_dev (in)
1458Returns: 0 on success, -1 on error
1459
1460Allows userspace to mask PCI INTx interrupts from the assigned device. The
1461kernel will not deliver INTx interrupts to the guest between setting and
1462clearing of KVM_ASSIGN_SET_INTX_MASK via this interface. This enables use of
1463and emulation of PCI 2.3 INTx disable command register behavior.
1464
1465This may be used for both PCI 2.3 devices supporting INTx disable natively and
1466older devices lacking this support. Userspace is responsible for emulating the
1467read value of the INTx disable bit in the guest visible PCI command register.
1468When modifying the INTx disable state, userspace should precede updating the
1469physical device command register by calling this ioctl to inform the kernel of
1470the new intended INTx mask state.
1471
1472Note that the kernel uses the device INTx disable bit to internally manage the
1473device interrupt state for PCI 2.3 devices. Reads of this register may
1474therefore not match the expected value. Writes should always use the guest
1475intended INTx disable value rather than attempting to read-copy-update the
1476current physical device state. Races between user and kernel updates to the
1477INTx disable bit are handled lazily in the kernel. It's possible the device
1478may generate unintended interrupts, but they will not be injected into the
1479guest.
1480
1481See KVM_ASSIGN_DEV_IRQ for the data structure. The target device is specified
1482by assigned_dev_id. In the flags field, only KVM_DEV_ASSIGN_MASK_INTX is
1483evaluated.
1484
14024.62 KVM_CREATE_SPAPR_TCE 14854.62 KVM_CREATE_SPAPR_TCE
1403 1486
1404Capability: KVM_CAP_SPAPR_TCE 1487Capability: KVM_CAP_SPAPR_TCE
@@ -1491,6 +1574,101 @@ following algorithm:
1491Some guests configure the LINT1 NMI input to cause a panic, aiding in 1574Some guests configure the LINT1 NMI input to cause a panic, aiding in
1492debugging. 1575debugging.
1493 1576
15774.65 KVM_S390_UCAS_MAP
1578
1579Capability: KVM_CAP_S390_UCONTROL
1580Architectures: s390
1581Type: vcpu ioctl
1582Parameters: struct kvm_s390_ucas_mapping (in)
1583Returns: 0 in case of success
1584
1585The parameter is defined like this:
1586 struct kvm_s390_ucas_mapping {
1587 __u64 user_addr;
1588 __u64 vcpu_addr;
1589 __u64 length;
1590 };
1591
1592This ioctl maps the memory at "user_addr" with the length "length" to
1593the vcpu's address space starting at "vcpu_addr". All parameters need to
1594be alligned by 1 megabyte.
1595
15964.66 KVM_S390_UCAS_UNMAP
1597
1598Capability: KVM_CAP_S390_UCONTROL
1599Architectures: s390
1600Type: vcpu ioctl
1601Parameters: struct kvm_s390_ucas_mapping (in)
1602Returns: 0 in case of success
1603
1604The parameter is defined like this:
1605 struct kvm_s390_ucas_mapping {
1606 __u64 user_addr;
1607 __u64 vcpu_addr;
1608 __u64 length;
1609 };
1610
1611This ioctl unmaps the memory in the vcpu's address space starting at
1612"vcpu_addr" with the length "length". The field "user_addr" is ignored.
1613All parameters need to be alligned by 1 megabyte.
1614
16154.67 KVM_S390_VCPU_FAULT
1616
1617Capability: KVM_CAP_S390_UCONTROL
1618Architectures: s390
1619Type: vcpu ioctl
1620Parameters: vcpu absolute address (in)
1621Returns: 0 in case of success
1622
1623This call creates a page table entry on the virtual cpu's address space
1624(for user controlled virtual machines) or the virtual machine's address
1625space (for regular virtual machines). This only works for minor faults,
1626thus it's recommended to access subject memory page via the user page
1627table upfront. This is useful to handle validity intercepts for user
1628controlled virtual machines to fault in the virtual cpu's lowcore pages
1629prior to calling the KVM_RUN ioctl.
1630
16314.68 KVM_SET_ONE_REG
1632
1633Capability: KVM_CAP_ONE_REG
1634Architectures: all
1635Type: vcpu ioctl
1636Parameters: struct kvm_one_reg (in)
1637Returns: 0 on success, negative value on failure
1638
1639struct kvm_one_reg {
1640 __u64 id;
1641 __u64 addr;
1642};
1643
1644Using this ioctl, a single vcpu register can be set to a specific value
1645defined by user space with the passed in struct kvm_one_reg, where id
1646refers to the register identifier as described below and addr is a pointer
1647to a variable with the respective size. There can be architecture agnostic
1648and architecture specific registers. Each have their own range of operation
1649and their own constants and width. To keep track of the implemented
1650registers, find a list below:
1651
1652 Arch | Register | Width (bits)
1653 | |
1654 PPC | KVM_REG_PPC_HIOR | 64
1655
16564.69 KVM_GET_ONE_REG
1657
1658Capability: KVM_CAP_ONE_REG
1659Architectures: all
1660Type: vcpu ioctl
1661Parameters: struct kvm_one_reg (in and out)
1662Returns: 0 on success, negative value on failure
1663
1664This ioctl allows to receive the value of a single register implemented
1665in a vcpu. The register to read is indicated by the "id" field of the
1666kvm_one_reg struct passed in. On success, the register value can be found
1667at the memory location pointed to by "addr".
1668
1669The list of registers accessible using this interface is identical to the
1670list in 4.64.
1671
14945. The kvm_run structure 16725. The kvm_run structure
1495 1673
1496Application code obtains a pointer to the kvm_run structure by 1674Application code obtains a pointer to the kvm_run structure by
@@ -1651,6 +1829,20 @@ s390 specific.
1651 1829
1652s390 specific. 1830s390 specific.
1653 1831
1832 /* KVM_EXIT_S390_UCONTROL */
1833 struct {
1834 __u64 trans_exc_code;
1835 __u32 pgm_code;
1836 } s390_ucontrol;
1837
1838s390 specific. A page fault has occurred for a user controlled virtual
1839machine (KVM_VM_S390_UNCONTROL) on it's host page table that cannot be
1840resolved by the kernel.
1841The program code and the translation exception code that were placed
1842in the cpu's lowcore are presented here as defined by the z Architecture
1843Principles of Operation Book in the Chapter for Dynamic Address Translation
1844(DAT)
1845
1654 /* KVM_EXIT_DCR */ 1846 /* KVM_EXIT_DCR */
1655 struct { 1847 struct {
1656 __u32 dcrn; 1848 __u32 dcrn;
@@ -1693,6 +1885,29 @@ developer registration required to access it).
1693 /* Fix the size of the union. */ 1885 /* Fix the size of the union. */
1694 char padding[256]; 1886 char padding[256];
1695 }; 1887 };
1888
1889 /*
1890 * shared registers between kvm and userspace.
1891 * kvm_valid_regs specifies the register classes set by the host
1892 * kvm_dirty_regs specified the register classes dirtied by userspace
1893 * struct kvm_sync_regs is architecture specific, as well as the
1894 * bits for kvm_valid_regs and kvm_dirty_regs
1895 */
1896 __u64 kvm_valid_regs;
1897 __u64 kvm_dirty_regs;
1898 union {
1899 struct kvm_sync_regs regs;
1900 char padding[1024];
1901 } s;
1902
1903If KVM_CAP_SYNC_REGS is defined, these fields allow userspace to access
1904certain guest registers without having to call SET/GET_*REGS. Thus we can
1905avoid some system call overhead if userspace has to handle the exit.
1906Userspace can query the validity of the structure by checking
1907kvm_valid_regs for specific bits. These bits are architecture specific
1908and usually define the validity of a groups of registers. (e.g. one bit
1909 for general purpose registers)
1910
1696}; 1911};
1697 1912
16986. Capabilities that can be enabled 19136. Capabilities that can be enabled
@@ -1741,3 +1956,45 @@ HTAB address part of SDR1 contains an HVA instead of a GPA, as PAPR keeps the
1741HTAB invisible to the guest. 1956HTAB invisible to the guest.
1742 1957
1743When this capability is enabled, KVM_EXIT_PAPR_HCALL can occur. 1958When this capability is enabled, KVM_EXIT_PAPR_HCALL can occur.
1959
19606.3 KVM_CAP_SW_TLB
1961
1962Architectures: ppc
1963Parameters: args[0] is the address of a struct kvm_config_tlb
1964Returns: 0 on success; -1 on error
1965
1966struct kvm_config_tlb {
1967 __u64 params;
1968 __u64 array;
1969 __u32 mmu_type;
1970 __u32 array_len;
1971};
1972
1973Configures the virtual CPU's TLB array, establishing a shared memory area
1974between userspace and KVM. The "params" and "array" fields are userspace
1975addresses of mmu-type-specific data structures. The "array_len" field is an
1976safety mechanism, and should be set to the size in bytes of the memory that
1977userspace has reserved for the array. It must be at least the size dictated
1978by "mmu_type" and "params".
1979
1980While KVM_RUN is active, the shared region is under control of KVM. Its
1981contents are undefined, and any modification by userspace results in
1982boundedly undefined behavior.
1983
1984On return from KVM_RUN, the shared region will reflect the current state of
1985the guest's TLB. If userspace makes any changes, it must call KVM_DIRTY_TLB
1986to tell KVM which entries have been changed, prior to calling KVM_RUN again
1987on this vcpu.
1988
1989For mmu types KVM_MMU_FSL_BOOKE_NOHV and KVM_MMU_FSL_BOOKE_HV:
1990 - The "params" field is of type "struct kvm_book3e_206_tlb_params".
1991 - The "array" field points to an array of type "struct
1992 kvm_book3e_206_tlb_entry".
1993 - The array consists of all entries in the first TLB, followed by all
1994 entries in the second TLB.
1995 - Within a TLB, entries are ordered first by increasing set number. Within a
1996 set, entries are ordered by way (increasing ESEL).
1997 - The hash for determining set number in TLB0 is: (MAS2 >> 12) & (num_sets - 1)
1998 where "num_sets" is the tlb_sizes[] value divided by the tlb_ways[] value.
1999 - The tsize field of mas1 shall be set to 4K on TLB0, even though the
2000 hardware ignores this value for TLB0.
diff --git a/Documentation/virtual/kvm/ppc-pv.txt b/Documentation/virtual/kvm/ppc-pv.txt
index 2b7ce190cde4..6e7c37050930 100644
--- a/Documentation/virtual/kvm/ppc-pv.txt
+++ b/Documentation/virtual/kvm/ppc-pv.txt
@@ -81,28 +81,8 @@ additional registers to the magic page. If you add fields to the magic page,
81also define a new hypercall feature to indicate that the host can give you more 81also define a new hypercall feature to indicate that the host can give you more
82registers. Only if the host supports the additional features, make use of them. 82registers. Only if the host supports the additional features, make use of them.
83 83
84The magic page has the following layout as described in 84The magic page layout is described by struct kvm_vcpu_arch_shared
85arch/powerpc/include/asm/kvm_para.h: 85in arch/powerpc/include/asm/kvm_para.h.
86
87struct kvm_vcpu_arch_shared {
88 __u64 scratch1;
89 __u64 scratch2;
90 __u64 scratch3;
91 __u64 critical; /* Guest may not get interrupts if == r1 */
92 __u64 sprg0;
93 __u64 sprg1;
94 __u64 sprg2;
95 __u64 sprg3;
96 __u64 srr0;
97 __u64 srr1;
98 __u64 dar;
99 __u64 msr;
100 __u32 dsisr;
101 __u32 int_pending; /* Tells the guest if we have an interrupt */
102};
103
104Additions to the page must only occur at the end. Struct fields are always 32
105or 64 bit aligned, depending on them being 32 or 64 bit wide respectively.
106 86
107Magic page features 87Magic page features
108=================== 88===================
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile
deleted file mode 100644
index 3fa4d0668864..000000000000
--- a/Documentation/vm/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build
5hostprogs-y := page-types hugepage-mmap hugepage-shm map_hugetlb
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/vm/hugepage-mmap.c b/Documentation/vm/hugepage-mmap.c
deleted file mode 100644
index db0dd9a33d54..000000000000
--- a/Documentation/vm/hugepage-mmap.c
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 * hugepage-mmap:
3 *
4 * Example of using huge page memory in a user application using the mmap
5 * system call. Before running this application, make sure that the
6 * administrator has mounted the hugetlbfs filesystem (on some directory
7 * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this
8 * example, the app is requesting memory of size 256MB that is backed by
9 * huge pages.
10 *
11 * For the ia64 architecture, the Linux kernel reserves Region number 4 for
12 * huge pages. That means that if one requires a fixed address, a huge page
13 * aligned address starting with 0x800000... will be required. If a fixed
14 * address is not required, the kernel will select an address in the proper
15 * range.
16 * Other architectures, such as ppc64, i386 or x86_64 are not so constrained.
17 */
18
19#include <stdlib.h>
20#include <stdio.h>
21#include <unistd.h>
22#include <sys/mman.h>
23#include <fcntl.h>
24
25#define FILE_NAME "/mnt/hugepagefile"
26#define LENGTH (256UL*1024*1024)
27#define PROTECTION (PROT_READ | PROT_WRITE)
28
29/* Only ia64 requires this */
30#ifdef __ia64__
31#define ADDR (void *)(0x8000000000000000UL)
32#define FLAGS (MAP_SHARED | MAP_FIXED)
33#else
34#define ADDR (void *)(0x0UL)
35#define FLAGS (MAP_SHARED)
36#endif
37
38static void check_bytes(char *addr)
39{
40 printf("First hex is %x\n", *((unsigned int *)addr));
41}
42
43static void write_bytes(char *addr)
44{
45 unsigned long i;
46
47 for (i = 0; i < LENGTH; i++)
48 *(addr + i) = (char)i;
49}
50
51static void read_bytes(char *addr)
52{
53 unsigned long i;
54
55 check_bytes(addr);
56 for (i = 0; i < LENGTH; i++)
57 if (*(addr + i) != (char)i) {
58 printf("Mismatch at %lu\n", i);
59 break;
60 }
61}
62
63int main(void)
64{
65 void *addr;
66 int fd;
67
68 fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755);
69 if (fd < 0) {
70 perror("Open failed");
71 exit(1);
72 }
73
74 addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0);
75 if (addr == MAP_FAILED) {
76 perror("mmap");
77 unlink(FILE_NAME);
78 exit(1);
79 }
80
81 printf("Returned address is %p\n", addr);
82 check_bytes(addr);
83 write_bytes(addr);
84 read_bytes(addr);
85
86 munmap(addr, LENGTH);
87 close(fd);
88 unlink(FILE_NAME);
89
90 return 0;
91}
diff --git a/Documentation/vm/hugepage-shm.c b/Documentation/vm/hugepage-shm.c
deleted file mode 100644
index 07956d8592c9..000000000000
--- a/Documentation/vm/hugepage-shm.c
+++ /dev/null
@@ -1,98 +0,0 @@
1/*
2 * hugepage-shm:
3 *
4 * Example of using huge page memory in a user application using Sys V shared
5 * memory system calls. In this example the app is requesting 256MB of
6 * memory that is backed by huge pages. The application uses the flag
7 * SHM_HUGETLB in the shmget system call to inform the kernel that it is
8 * requesting huge pages.
9 *
10 * For the ia64 architecture, the Linux kernel reserves Region number 4 for
11 * huge pages. That means that if one requires a fixed address, a huge page
12 * aligned address starting with 0x800000... will be required. If a fixed
13 * address is not required, the kernel will select an address in the proper
14 * range.
15 * Other architectures, such as ppc64, i386 or x86_64 are not so constrained.
16 *
17 * Note: The default shared memory limit is quite low on many kernels,
18 * you may need to increase it via:
19 *
20 * echo 268435456 > /proc/sys/kernel/shmmax
21 *
22 * This will increase the maximum size per shared memory segment to 256MB.
23 * The other limit that you will hit eventually is shmall which is the
24 * total amount of shared memory in pages. To set it to 16GB on a system
25 * with a 4kB pagesize do:
26 *
27 * echo 4194304 > /proc/sys/kernel/shmall
28 */
29
30#include <stdlib.h>
31#include <stdio.h>
32#include <sys/types.h>
33#include <sys/ipc.h>
34#include <sys/shm.h>
35#include <sys/mman.h>
36
37#ifndef SHM_HUGETLB
38#define SHM_HUGETLB 04000
39#endif
40
41#define LENGTH (256UL*1024*1024)
42
43#define dprintf(x) printf(x)
44
45/* Only ia64 requires this */
46#ifdef __ia64__
47#define ADDR (void *)(0x8000000000000000UL)
48#define SHMAT_FLAGS (SHM_RND)
49#else
50#define ADDR (void *)(0x0UL)
51#define SHMAT_FLAGS (0)
52#endif
53
54int main(void)
55{
56 int shmid;
57 unsigned long i;
58 char *shmaddr;
59
60 if ((shmid = shmget(2, LENGTH,
61 SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) {
62 perror("shmget");
63 exit(1);
64 }
65 printf("shmid: 0x%x\n", shmid);
66
67 shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS);
68 if (shmaddr == (char *)-1) {
69 perror("Shared memory attach failure");
70 shmctl(shmid, IPC_RMID, NULL);
71 exit(2);
72 }
73 printf("shmaddr: %p\n", shmaddr);
74
75 dprintf("Starting the writes:\n");
76 for (i = 0; i < LENGTH; i++) {
77 shmaddr[i] = (char)(i);
78 if (!(i % (1024 * 1024)))
79 dprintf(".");
80 }
81 dprintf("\n");
82
83 dprintf("Starting the Check...");
84 for (i = 0; i < LENGTH; i++)
85 if (shmaddr[i] != (char)i)
86 printf("\nIndex %lu mismatched\n", i);
87 dprintf("Done.\n");
88
89 if (shmdt((const void *)shmaddr) != 0) {
90 perror("Detach failure");
91 shmctl(shmid, IPC_RMID, NULL);
92 exit(3);
93 }
94
95 shmctl(shmid, IPC_RMID, NULL);
96
97 return 0;
98}
diff --git a/Documentation/vm/map_hugetlb.c b/Documentation/vm/map_hugetlb.c
deleted file mode 100644
index eda1a6d3578a..000000000000
--- a/Documentation/vm/map_hugetlb.c
+++ /dev/null
@@ -1,77 +0,0 @@
1/*
2 * Example of using hugepage memory in a user application using the mmap
3 * system call with MAP_HUGETLB flag. Before running this program make
4 * sure the administrator has allocated enough default sized huge pages
5 * to cover the 256 MB allocation.
6 *
7 * For ia64 architecture, Linux kernel reserves Region number 4 for hugepages.
8 * That means the addresses starting with 0x800000... will need to be
9 * specified. Specifying a fixed address is not required on ppc64, i386
10 * or x86_64.
11 */
12#include <stdlib.h>
13#include <stdio.h>
14#include <unistd.h>
15#include <sys/mman.h>
16#include <fcntl.h>
17
18#define LENGTH (256UL*1024*1024)
19#define PROTECTION (PROT_READ | PROT_WRITE)
20
21#ifndef MAP_HUGETLB
22#define MAP_HUGETLB 0x40000 /* arch specific */
23#endif
24
25/* Only ia64 requires this */
26#ifdef __ia64__
27#define ADDR (void *)(0x8000000000000000UL)
28#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_FIXED)
29#else
30#define ADDR (void *)(0x0UL)
31#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB)
32#endif
33
34static void check_bytes(char *addr)
35{
36 printf("First hex is %x\n", *((unsigned int *)addr));
37}
38
39static void write_bytes(char *addr)
40{
41 unsigned long i;
42
43 for (i = 0; i < LENGTH; i++)
44 *(addr + i) = (char)i;
45}
46
47static void read_bytes(char *addr)
48{
49 unsigned long i;
50
51 check_bytes(addr);
52 for (i = 0; i < LENGTH; i++)
53 if (*(addr + i) != (char)i) {
54 printf("Mismatch at %lu\n", i);
55 break;
56 }
57}
58
59int main(void)
60{
61 void *addr;
62
63 addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, 0, 0);
64 if (addr == MAP_FAILED) {
65 perror("mmap");
66 exit(1);
67 }
68
69 printf("Returned address is %p\n", addr);
70 check_bytes(addr);
71 write_bytes(addr);
72 read_bytes(addr);
73
74 munmap(addr, LENGTH);
75
76 return 0;
77}
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
deleted file mode 100644
index 0b13f02d4059..000000000000
--- a/Documentation/vm/page-types.c
+++ /dev/null
@@ -1,1102 +0,0 @@
1/*
2 * page-types: Tool for querying page flags
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should find a copy of v2 of the GNU General Public License somewhere on
14 * your Linux system; if not, write to the Free Software Foundation, Inc., 59
15 * Temple Place, Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Copyright (C) 2009 Intel corporation
18 *
19 * Authors: Wu Fengguang <fengguang.wu@intel.com>
20 */
21
22#define _LARGEFILE64_SOURCE
23#include <stdio.h>
24#include <stdlib.h>
25#include <unistd.h>
26#include <stdint.h>
27#include <stdarg.h>
28#include <string.h>
29#include <getopt.h>
30#include <limits.h>
31#include <assert.h>
32#include <sys/types.h>
33#include <sys/errno.h>
34#include <sys/fcntl.h>
35#include <sys/mount.h>
36#include <sys/statfs.h>
37#include "../../include/linux/magic.h"
38
39
40#ifndef MAX_PATH
41# define MAX_PATH 256
42#endif
43
44#ifndef STR
45# define _STR(x) #x
46# define STR(x) _STR(x)
47#endif
48
49/*
50 * pagemap kernel ABI bits
51 */
52
53#define PM_ENTRY_BYTES sizeof(uint64_t)
54#define PM_STATUS_BITS 3
55#define PM_STATUS_OFFSET (64 - PM_STATUS_BITS)
56#define PM_STATUS_MASK (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET)
57#define PM_STATUS(nr) (((nr) << PM_STATUS_OFFSET) & PM_STATUS_MASK)
58#define PM_PSHIFT_BITS 6
59#define PM_PSHIFT_OFFSET (PM_STATUS_OFFSET - PM_PSHIFT_BITS)
60#define PM_PSHIFT_MASK (((1LL << PM_PSHIFT_BITS) - 1) << PM_PSHIFT_OFFSET)
61#define PM_PSHIFT(x) (((u64) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK)
62#define PM_PFRAME_MASK ((1LL << PM_PSHIFT_OFFSET) - 1)
63#define PM_PFRAME(x) ((x) & PM_PFRAME_MASK)
64
65#define PM_PRESENT PM_STATUS(4LL)
66#define PM_SWAP PM_STATUS(2LL)
67
68
69/*
70 * kernel page flags
71 */
72
73#define KPF_BYTES 8
74#define PROC_KPAGEFLAGS "/proc/kpageflags"
75
76/* copied from kpageflags_read() */
77#define KPF_LOCKED 0
78#define KPF_ERROR 1
79#define KPF_REFERENCED 2
80#define KPF_UPTODATE 3
81#define KPF_DIRTY 4
82#define KPF_LRU 5
83#define KPF_ACTIVE 6
84#define KPF_SLAB 7
85#define KPF_WRITEBACK 8
86#define KPF_RECLAIM 9
87#define KPF_BUDDY 10
88
89/* [11-20] new additions in 2.6.31 */
90#define KPF_MMAP 11
91#define KPF_ANON 12
92#define KPF_SWAPCACHE 13
93#define KPF_SWAPBACKED 14
94#define KPF_COMPOUND_HEAD 15
95#define KPF_COMPOUND_TAIL 16
96#define KPF_HUGE 17
97#define KPF_UNEVICTABLE 18
98#define KPF_HWPOISON 19
99#define KPF_NOPAGE 20
100#define KPF_KSM 21
101#define KPF_THP 22
102
103/* [32-] kernel hacking assistances */
104#define KPF_RESERVED 32
105#define KPF_MLOCKED 33
106#define KPF_MAPPEDTODISK 34
107#define KPF_PRIVATE 35
108#define KPF_PRIVATE_2 36
109#define KPF_OWNER_PRIVATE 37
110#define KPF_ARCH 38
111#define KPF_UNCACHED 39
112
113/* [48-] take some arbitrary free slots for expanding overloaded flags
114 * not part of kernel API
115 */
116#define KPF_READAHEAD 48
117#define KPF_SLOB_FREE 49
118#define KPF_SLUB_FROZEN 50
119#define KPF_SLUB_DEBUG 51
120
121#define KPF_ALL_BITS ((uint64_t)~0ULL)
122#define KPF_HACKERS_BITS (0xffffULL << 32)
123#define KPF_OVERLOADED_BITS (0xffffULL << 48)
124#define BIT(name) (1ULL << KPF_##name)
125#define BITS_COMPOUND (BIT(COMPOUND_HEAD) | BIT(COMPOUND_TAIL))
126
127static const char *page_flag_names[] = {
128 [KPF_LOCKED] = "L:locked",
129 [KPF_ERROR] = "E:error",
130 [KPF_REFERENCED] = "R:referenced",
131 [KPF_UPTODATE] = "U:uptodate",
132 [KPF_DIRTY] = "D:dirty",
133 [KPF_LRU] = "l:lru",
134 [KPF_ACTIVE] = "A:active",
135 [KPF_SLAB] = "S:slab",
136 [KPF_WRITEBACK] = "W:writeback",
137 [KPF_RECLAIM] = "I:reclaim",
138 [KPF_BUDDY] = "B:buddy",
139
140 [KPF_MMAP] = "M:mmap",
141 [KPF_ANON] = "a:anonymous",
142 [KPF_SWAPCACHE] = "s:swapcache",
143 [KPF_SWAPBACKED] = "b:swapbacked",
144 [KPF_COMPOUND_HEAD] = "H:compound_head",
145 [KPF_COMPOUND_TAIL] = "T:compound_tail",
146 [KPF_HUGE] = "G:huge",
147 [KPF_UNEVICTABLE] = "u:unevictable",
148 [KPF_HWPOISON] = "X:hwpoison",
149 [KPF_NOPAGE] = "n:nopage",
150 [KPF_KSM] = "x:ksm",
151 [KPF_THP] = "t:thp",
152
153 [KPF_RESERVED] = "r:reserved",
154 [KPF_MLOCKED] = "m:mlocked",
155 [KPF_MAPPEDTODISK] = "d:mappedtodisk",
156 [KPF_PRIVATE] = "P:private",
157 [KPF_PRIVATE_2] = "p:private_2",
158 [KPF_OWNER_PRIVATE] = "O:owner_private",
159 [KPF_ARCH] = "h:arch",
160 [KPF_UNCACHED] = "c:uncached",
161
162 [KPF_READAHEAD] = "I:readahead",
163 [KPF_SLOB_FREE] = "P:slob_free",
164 [KPF_SLUB_FROZEN] = "A:slub_frozen",
165 [KPF_SLUB_DEBUG] = "E:slub_debug",
166};
167
168
169static const char *debugfs_known_mountpoints[] = {
170 "/sys/kernel/debug",
171 "/debug",
172 0,
173};
174
175/*
176 * data structures
177 */
178
179static int opt_raw; /* for kernel developers */
180static int opt_list; /* list pages (in ranges) */
181static int opt_no_summary; /* don't show summary */
182static pid_t opt_pid; /* process to walk */
183
184#define MAX_ADDR_RANGES 1024
185static int nr_addr_ranges;
186static unsigned long opt_offset[MAX_ADDR_RANGES];
187static unsigned long opt_size[MAX_ADDR_RANGES];
188
189#define MAX_VMAS 10240
190static int nr_vmas;
191static unsigned long pg_start[MAX_VMAS];
192static unsigned long pg_end[MAX_VMAS];
193
194#define MAX_BIT_FILTERS 64
195static int nr_bit_filters;
196static uint64_t opt_mask[MAX_BIT_FILTERS];
197static uint64_t opt_bits[MAX_BIT_FILTERS];
198
199static int page_size;
200
201static int pagemap_fd;
202static int kpageflags_fd;
203
204static int opt_hwpoison;
205static int opt_unpoison;
206
207static char hwpoison_debug_fs[MAX_PATH+1];
208static int hwpoison_inject_fd;
209static int hwpoison_forget_fd;
210
211#define HASH_SHIFT 13
212#define HASH_SIZE (1 << HASH_SHIFT)
213#define HASH_MASK (HASH_SIZE - 1)
214#define HASH_KEY(flags) (flags & HASH_MASK)
215
216static unsigned long total_pages;
217static unsigned long nr_pages[HASH_SIZE];
218static uint64_t page_flags[HASH_SIZE];
219
220
221/*
222 * helper functions
223 */
224
225#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
226
227#define min_t(type, x, y) ({ \
228 type __min1 = (x); \
229 type __min2 = (y); \
230 __min1 < __min2 ? __min1 : __min2; })
231
232#define max_t(type, x, y) ({ \
233 type __max1 = (x); \
234 type __max2 = (y); \
235 __max1 > __max2 ? __max1 : __max2; })
236
237static unsigned long pages2mb(unsigned long pages)
238{
239 return (pages * page_size) >> 20;
240}
241
242static void fatal(const char *x, ...)
243{
244 va_list ap;
245
246 va_start(ap, x);
247 vfprintf(stderr, x, ap);
248 va_end(ap);
249 exit(EXIT_FAILURE);
250}
251
252static int checked_open(const char *pathname, int flags)
253{
254 int fd = open(pathname, flags);
255
256 if (fd < 0) {
257 perror(pathname);
258 exit(EXIT_FAILURE);
259 }
260
261 return fd;
262}
263
264/*
265 * pagemap/kpageflags routines
266 */
267
268static unsigned long do_u64_read(int fd, char *name,
269 uint64_t *buf,
270 unsigned long index,
271 unsigned long count)
272{
273 long bytes;
274
275 if (index > ULONG_MAX / 8)
276 fatal("index overflow: %lu\n", index);
277
278 if (lseek(fd, index * 8, SEEK_SET) < 0) {
279 perror(name);
280 exit(EXIT_FAILURE);
281 }
282
283 bytes = read(fd, buf, count * 8);
284 if (bytes < 0) {
285 perror(name);
286 exit(EXIT_FAILURE);
287 }
288 if (bytes % 8)
289 fatal("partial read: %lu bytes\n", bytes);
290
291 return bytes / 8;
292}
293
294static unsigned long kpageflags_read(uint64_t *buf,
295 unsigned long index,
296 unsigned long pages)
297{
298 return do_u64_read(kpageflags_fd, PROC_KPAGEFLAGS, buf, index, pages);
299}
300
301static unsigned long pagemap_read(uint64_t *buf,
302 unsigned long index,
303 unsigned long pages)
304{
305 return do_u64_read(pagemap_fd, "/proc/pid/pagemap", buf, index, pages);
306}
307
308static unsigned long pagemap_pfn(uint64_t val)
309{
310 unsigned long pfn;
311
312 if (val & PM_PRESENT)
313 pfn = PM_PFRAME(val);
314 else
315 pfn = 0;
316
317 return pfn;
318}
319
320
321/*
322 * page flag names
323 */
324
325static char *page_flag_name(uint64_t flags)
326{
327 static char buf[65];
328 int present;
329 int i, j;
330
331 for (i = 0, j = 0; i < ARRAY_SIZE(page_flag_names); i++) {
332 present = (flags >> i) & 1;
333 if (!page_flag_names[i]) {
334 if (present)
335 fatal("unknown flag bit %d\n", i);
336 continue;
337 }
338 buf[j++] = present ? page_flag_names[i][0] : '_';
339 }
340
341 return buf;
342}
343
344static char *page_flag_longname(uint64_t flags)
345{
346 static char buf[1024];
347 int i, n;
348
349 for (i = 0, n = 0; i < ARRAY_SIZE(page_flag_names); i++) {
350 if (!page_flag_names[i])
351 continue;
352 if ((flags >> i) & 1)
353 n += snprintf(buf + n, sizeof(buf) - n, "%s,",
354 page_flag_names[i] + 2);
355 }
356 if (n)
357 n--;
358 buf[n] = '\0';
359
360 return buf;
361}
362
363
364/*
365 * page list and summary
366 */
367
368static void show_page_range(unsigned long voffset,
369 unsigned long offset, uint64_t flags)
370{
371 static uint64_t flags0;
372 static unsigned long voff;
373 static unsigned long index;
374 static unsigned long count;
375
376 if (flags == flags0 && offset == index + count &&
377 (!opt_pid || voffset == voff + count)) {
378 count++;
379 return;
380 }
381
382 if (count) {
383 if (opt_pid)
384 printf("%lx\t", voff);
385 printf("%lx\t%lx\t%s\n",
386 index, count, page_flag_name(flags0));
387 }
388
389 flags0 = flags;
390 index = offset;
391 voff = voffset;
392 count = 1;
393}
394
395static void show_page(unsigned long voffset,
396 unsigned long offset, uint64_t flags)
397{
398 if (opt_pid)
399 printf("%lx\t", voffset);
400 printf("%lx\t%s\n", offset, page_flag_name(flags));
401}
402
403static void show_summary(void)
404{
405 int i;
406
407 printf(" flags\tpage-count MB"
408 " symbolic-flags\t\t\tlong-symbolic-flags\n");
409
410 for (i = 0; i < ARRAY_SIZE(nr_pages); i++) {
411 if (nr_pages[i])
412 printf("0x%016llx\t%10lu %8lu %s\t%s\n",
413 (unsigned long long)page_flags[i],
414 nr_pages[i],
415 pages2mb(nr_pages[i]),
416 page_flag_name(page_flags[i]),
417 page_flag_longname(page_flags[i]));
418 }
419
420 printf(" total\t%10lu %8lu\n",
421 total_pages, pages2mb(total_pages));
422}
423
424
425/*
426 * page flag filters
427 */
428
429static int bit_mask_ok(uint64_t flags)
430{
431 int i;
432
433 for (i = 0; i < nr_bit_filters; i++) {
434 if (opt_bits[i] == KPF_ALL_BITS) {
435 if ((flags & opt_mask[i]) == 0)
436 return 0;
437 } else {
438 if ((flags & opt_mask[i]) != opt_bits[i])
439 return 0;
440 }
441 }
442
443 return 1;
444}
445
446static uint64_t expand_overloaded_flags(uint64_t flags)
447{
448 /* SLOB/SLUB overload several page flags */
449 if (flags & BIT(SLAB)) {
450 if (flags & BIT(PRIVATE))
451 flags ^= BIT(PRIVATE) | BIT(SLOB_FREE);
452 if (flags & BIT(ACTIVE))
453 flags ^= BIT(ACTIVE) | BIT(SLUB_FROZEN);
454 if (flags & BIT(ERROR))
455 flags ^= BIT(ERROR) | BIT(SLUB_DEBUG);
456 }
457
458 /* PG_reclaim is overloaded as PG_readahead in the read path */
459 if ((flags & (BIT(RECLAIM) | BIT(WRITEBACK))) == BIT(RECLAIM))
460 flags ^= BIT(RECLAIM) | BIT(READAHEAD);
461
462 return flags;
463}
464
465static uint64_t well_known_flags(uint64_t flags)
466{
467 /* hide flags intended only for kernel hacker */
468 flags &= ~KPF_HACKERS_BITS;
469
470 /* hide non-hugeTLB compound pages */
471 if ((flags & BITS_COMPOUND) && !(flags & BIT(HUGE)))
472 flags &= ~BITS_COMPOUND;
473
474 return flags;
475}
476
477static uint64_t kpageflags_flags(uint64_t flags)
478{
479 flags = expand_overloaded_flags(flags);
480
481 if (!opt_raw)
482 flags = well_known_flags(flags);
483
484 return flags;
485}
486
487/* verify that a mountpoint is actually a debugfs instance */
488static int debugfs_valid_mountpoint(const char *debugfs)
489{
490 struct statfs st_fs;
491
492 if (statfs(debugfs, &st_fs) < 0)
493 return -ENOENT;
494 else if (st_fs.f_type != (long) DEBUGFS_MAGIC)
495 return -ENOENT;
496
497 return 0;
498}
499
500/* find the path to the mounted debugfs */
501static const char *debugfs_find_mountpoint(void)
502{
503 const char **ptr;
504 char type[100];
505 FILE *fp;
506
507 ptr = debugfs_known_mountpoints;
508 while (*ptr) {
509 if (debugfs_valid_mountpoint(*ptr) == 0) {
510 strcpy(hwpoison_debug_fs, *ptr);
511 return hwpoison_debug_fs;
512 }
513 ptr++;
514 }
515
516 /* give up and parse /proc/mounts */
517 fp = fopen("/proc/mounts", "r");
518 if (fp == NULL)
519 perror("Can't open /proc/mounts for read");
520
521 while (fscanf(fp, "%*s %"
522 STR(MAX_PATH)
523 "s %99s %*s %*d %*d\n",
524 hwpoison_debug_fs, type) == 2) {
525 if (strcmp(type, "debugfs") == 0)
526 break;
527 }
528 fclose(fp);
529
530 if (strcmp(type, "debugfs") != 0)
531 return NULL;
532
533 return hwpoison_debug_fs;
534}
535
536/* mount the debugfs somewhere if it's not mounted */
537
538static void debugfs_mount(void)
539{
540 const char **ptr;
541
542 /* see if it's already mounted */
543 if (debugfs_find_mountpoint())
544 return;
545
546 ptr = debugfs_known_mountpoints;
547 while (*ptr) {
548 if (mount(NULL, *ptr, "debugfs", 0, NULL) == 0) {
549 /* save the mountpoint */
550 strcpy(hwpoison_debug_fs, *ptr);
551 break;
552 }
553 ptr++;
554 }
555
556 if (*ptr == NULL) {
557 perror("mount debugfs");
558 exit(EXIT_FAILURE);
559 }
560}
561
562/*
563 * page actions
564 */
565
566static void prepare_hwpoison_fd(void)
567{
568 char buf[MAX_PATH + 1];
569
570 debugfs_mount();
571
572 if (opt_hwpoison && !hwpoison_inject_fd) {
573 snprintf(buf, MAX_PATH, "%s/hwpoison/corrupt-pfn",
574 hwpoison_debug_fs);
575 hwpoison_inject_fd = checked_open(buf, O_WRONLY);
576 }
577
578 if (opt_unpoison && !hwpoison_forget_fd) {
579 snprintf(buf, MAX_PATH, "%s/hwpoison/unpoison-pfn",
580 hwpoison_debug_fs);
581 hwpoison_forget_fd = checked_open(buf, O_WRONLY);
582 }
583}
584
585static int hwpoison_page(unsigned long offset)
586{
587 char buf[100];
588 int len;
589
590 len = sprintf(buf, "0x%lx\n", offset);
591 len = write(hwpoison_inject_fd, buf, len);
592 if (len < 0) {
593 perror("hwpoison inject");
594 return len;
595 }
596 return 0;
597}
598
599static int unpoison_page(unsigned long offset)
600{
601 char buf[100];
602 int len;
603
604 len = sprintf(buf, "0x%lx\n", offset);
605 len = write(hwpoison_forget_fd, buf, len);
606 if (len < 0) {
607 perror("hwpoison forget");
608 return len;
609 }
610 return 0;
611}
612
613/*
614 * page frame walker
615 */
616
617static int hash_slot(uint64_t flags)
618{
619 int k = HASH_KEY(flags);
620 int i;
621
622 /* Explicitly reserve slot 0 for flags 0: the following logic
623 * cannot distinguish an unoccupied slot from slot (flags==0).
624 */
625 if (flags == 0)
626 return 0;
627
628 /* search through the remaining (HASH_SIZE-1) slots */
629 for (i = 1; i < ARRAY_SIZE(page_flags); i++, k++) {
630 if (!k || k >= ARRAY_SIZE(page_flags))
631 k = 1;
632 if (page_flags[k] == 0) {
633 page_flags[k] = flags;
634 return k;
635 }
636 if (page_flags[k] == flags)
637 return k;
638 }
639
640 fatal("hash table full: bump up HASH_SHIFT?\n");
641 exit(EXIT_FAILURE);
642}
643
644static void add_page(unsigned long voffset,
645 unsigned long offset, uint64_t flags)
646{
647 flags = kpageflags_flags(flags);
648
649 if (!bit_mask_ok(flags))
650 return;
651
652 if (opt_hwpoison)
653 hwpoison_page(offset);
654 if (opt_unpoison)
655 unpoison_page(offset);
656
657 if (opt_list == 1)
658 show_page_range(voffset, offset, flags);
659 else if (opt_list == 2)
660 show_page(voffset, offset, flags);
661
662 nr_pages[hash_slot(flags)]++;
663 total_pages++;
664}
665
666#define KPAGEFLAGS_BATCH (64 << 10) /* 64k pages */
667static void walk_pfn(unsigned long voffset,
668 unsigned long index,
669 unsigned long count)
670{
671 uint64_t buf[KPAGEFLAGS_BATCH];
672 unsigned long batch;
673 long pages;
674 unsigned long i;
675
676 while (count) {
677 batch = min_t(unsigned long, count, KPAGEFLAGS_BATCH);
678 pages = kpageflags_read(buf, index, batch);
679 if (pages == 0)
680 break;
681
682 for (i = 0; i < pages; i++)
683 add_page(voffset + i, index + i, buf[i]);
684
685 index += pages;
686 count -= pages;
687 }
688}
689
690#define PAGEMAP_BATCH (64 << 10)
691static void walk_vma(unsigned long index, unsigned long count)
692{
693 uint64_t buf[PAGEMAP_BATCH];
694 unsigned long batch;
695 unsigned long pages;
696 unsigned long pfn;
697 unsigned long i;
698
699 while (count) {
700 batch = min_t(unsigned long, count, PAGEMAP_BATCH);
701 pages = pagemap_read(buf, index, batch);
702 if (pages == 0)
703 break;
704
705 for (i = 0; i < pages; i++) {
706 pfn = pagemap_pfn(buf[i]);
707 if (pfn)
708 walk_pfn(index + i, pfn, 1);
709 }
710
711 index += pages;
712 count -= pages;
713 }
714}
715
716static void walk_task(unsigned long index, unsigned long count)
717{
718 const unsigned long end = index + count;
719 unsigned long start;
720 int i = 0;
721
722 while (index < end) {
723
724 while (pg_end[i] <= index)
725 if (++i >= nr_vmas)
726 return;
727 if (pg_start[i] >= end)
728 return;
729
730 start = max_t(unsigned long, pg_start[i], index);
731 index = min_t(unsigned long, pg_end[i], end);
732
733 assert(start < index);
734 walk_vma(start, index - start);
735 }
736}
737
738static void add_addr_range(unsigned long offset, unsigned long size)
739{
740 if (nr_addr_ranges >= MAX_ADDR_RANGES)
741 fatal("too many addr ranges\n");
742
743 opt_offset[nr_addr_ranges] = offset;
744 opt_size[nr_addr_ranges] = min_t(unsigned long, size, ULONG_MAX-offset);
745 nr_addr_ranges++;
746}
747
748static void walk_addr_ranges(void)
749{
750 int i;
751
752 kpageflags_fd = checked_open(PROC_KPAGEFLAGS, O_RDONLY);
753
754 if (!nr_addr_ranges)
755 add_addr_range(0, ULONG_MAX);
756
757 for (i = 0; i < nr_addr_ranges; i++)
758 if (!opt_pid)
759 walk_pfn(0, opt_offset[i], opt_size[i]);
760 else
761 walk_task(opt_offset[i], opt_size[i]);
762
763 close(kpageflags_fd);
764}
765
766
767/*
768 * user interface
769 */
770
771static const char *page_flag_type(uint64_t flag)
772{
773 if (flag & KPF_HACKERS_BITS)
774 return "(r)";
775 if (flag & KPF_OVERLOADED_BITS)
776 return "(o)";
777 return " ";
778}
779
780static void usage(void)
781{
782 int i, j;
783
784 printf(
785"page-types [options]\n"
786" -r|--raw Raw mode, for kernel developers\n"
787" -d|--describe flags Describe flags\n"
788" -a|--addr addr-spec Walk a range of pages\n"
789" -b|--bits bits-spec Walk pages with specified bits\n"
790" -p|--pid pid Walk process address space\n"
791#if 0 /* planned features */
792" -f|--file filename Walk file address space\n"
793#endif
794" -l|--list Show page details in ranges\n"
795" -L|--list-each Show page details one by one\n"
796" -N|--no-summary Don't show summary info\n"
797" -X|--hwpoison hwpoison pages\n"
798" -x|--unpoison unpoison pages\n"
799" -h|--help Show this usage message\n"
800"flags:\n"
801" 0x10 bitfield format, e.g.\n"
802" anon bit-name, e.g.\n"
803" 0x10,anon comma-separated list, e.g.\n"
804"addr-spec:\n"
805" N one page at offset N (unit: pages)\n"
806" N+M pages range from N to N+M-1\n"
807" N,M pages range from N to M-1\n"
808" N, pages range from N to end\n"
809" ,M pages range from 0 to M-1\n"
810"bits-spec:\n"
811" bit1,bit2 (flags & (bit1|bit2)) != 0\n"
812" bit1,bit2=bit1 (flags & (bit1|bit2)) == bit1\n"
813" bit1,~bit2 (flags & (bit1|bit2)) == bit1\n"
814" =bit1,bit2 flags == (bit1|bit2)\n"
815"bit-names:\n"
816 );
817
818 for (i = 0, j = 0; i < ARRAY_SIZE(page_flag_names); i++) {
819 if (!page_flag_names[i])
820 continue;
821 printf("%16s%s", page_flag_names[i] + 2,
822 page_flag_type(1ULL << i));
823 if (++j > 3) {
824 j = 0;
825 putchar('\n');
826 }
827 }
828 printf("\n "
829 "(r) raw mode bits (o) overloaded bits\n");
830}
831
832static unsigned long long parse_number(const char *str)
833{
834 unsigned long long n;
835
836 n = strtoll(str, NULL, 0);
837
838 if (n == 0 && str[0] != '0')
839 fatal("invalid name or number: %s\n", str);
840
841 return n;
842}
843
844static void parse_pid(const char *str)
845{
846 FILE *file;
847 char buf[5000];
848
849 opt_pid = parse_number(str);
850
851 sprintf(buf, "/proc/%d/pagemap", opt_pid);
852 pagemap_fd = checked_open(buf, O_RDONLY);
853
854 sprintf(buf, "/proc/%d/maps", opt_pid);
855 file = fopen(buf, "r");
856 if (!file) {
857 perror(buf);
858 exit(EXIT_FAILURE);
859 }
860
861 while (fgets(buf, sizeof(buf), file) != NULL) {
862 unsigned long vm_start;
863 unsigned long vm_end;
864 unsigned long long pgoff;
865 int major, minor;
866 char r, w, x, s;
867 unsigned long ino;
868 int n;
869
870 n = sscanf(buf, "%lx-%lx %c%c%c%c %llx %x:%x %lu",
871 &vm_start,
872 &vm_end,
873 &r, &w, &x, &s,
874 &pgoff,
875 &major, &minor,
876 &ino);
877 if (n < 10) {
878 fprintf(stderr, "unexpected line: %s\n", buf);
879 continue;
880 }
881 pg_start[nr_vmas] = vm_start / page_size;
882 pg_end[nr_vmas] = vm_end / page_size;
883 if (++nr_vmas >= MAX_VMAS) {
884 fprintf(stderr, "too many VMAs\n");
885 break;
886 }
887 }
888 fclose(file);
889}
890
891static void parse_file(const char *name)
892{
893}
894
895static void parse_addr_range(const char *optarg)
896{
897 unsigned long offset;
898 unsigned long size;
899 char *p;
900
901 p = strchr(optarg, ',');
902 if (!p)
903 p = strchr(optarg, '+');
904
905 if (p == optarg) {
906 offset = 0;
907 size = parse_number(p + 1);
908 } else if (p) {
909 offset = parse_number(optarg);
910 if (p[1] == '\0')
911 size = ULONG_MAX;
912 else {
913 size = parse_number(p + 1);
914 if (*p == ',') {
915 if (size < offset)
916 fatal("invalid range: %lu,%lu\n",
917 offset, size);
918 size -= offset;
919 }
920 }
921 } else {
922 offset = parse_number(optarg);
923 size = 1;
924 }
925
926 add_addr_range(offset, size);
927}
928
929static void add_bits_filter(uint64_t mask, uint64_t bits)
930{
931 if (nr_bit_filters >= MAX_BIT_FILTERS)
932 fatal("too much bit filters\n");
933
934 opt_mask[nr_bit_filters] = mask;
935 opt_bits[nr_bit_filters] = bits;
936 nr_bit_filters++;
937}
938
939static uint64_t parse_flag_name(const char *str, int len)
940{
941 int i;
942
943 if (!*str || !len)
944 return 0;
945
946 if (len <= 8 && !strncmp(str, "compound", len))
947 return BITS_COMPOUND;
948
949 for (i = 0; i < ARRAY_SIZE(page_flag_names); i++) {
950 if (!page_flag_names[i])
951 continue;
952 if (!strncmp(str, page_flag_names[i] + 2, len))
953 return 1ULL << i;
954 }
955
956 return parse_number(str);
957}
958
959static uint64_t parse_flag_names(const char *str, int all)
960{
961 const char *p = str;
962 uint64_t flags = 0;
963
964 while (1) {
965 if (*p == ',' || *p == '=' || *p == '\0') {
966 if ((*str != '~') || (*str == '~' && all && *++str))
967 flags |= parse_flag_name(str, p - str);
968 if (*p != ',')
969 break;
970 str = p + 1;
971 }
972 p++;
973 }
974
975 return flags;
976}
977
978static void parse_bits_mask(const char *optarg)
979{
980 uint64_t mask;
981 uint64_t bits;
982 const char *p;
983
984 p = strchr(optarg, '=');
985 if (p == optarg) {
986 mask = KPF_ALL_BITS;
987 bits = parse_flag_names(p + 1, 0);
988 } else if (p) {
989 mask = parse_flag_names(optarg, 0);
990 bits = parse_flag_names(p + 1, 0);
991 } else if (strchr(optarg, '~')) {
992 mask = parse_flag_names(optarg, 1);
993 bits = parse_flag_names(optarg, 0);
994 } else {
995 mask = parse_flag_names(optarg, 0);
996 bits = KPF_ALL_BITS;
997 }
998
999 add_bits_filter(mask, bits);
1000}
1001
1002static void describe_flags(const char *optarg)
1003{
1004 uint64_t flags = parse_flag_names(optarg, 0);
1005
1006 printf("0x%016llx\t%s\t%s\n",
1007 (unsigned long long)flags,
1008 page_flag_name(flags),
1009 page_flag_longname(flags));
1010}
1011
1012static const struct option opts[] = {
1013 { "raw" , 0, NULL, 'r' },
1014 { "pid" , 1, NULL, 'p' },
1015 { "file" , 1, NULL, 'f' },
1016 { "addr" , 1, NULL, 'a' },
1017 { "bits" , 1, NULL, 'b' },
1018 { "describe" , 1, NULL, 'd' },
1019 { "list" , 0, NULL, 'l' },
1020 { "list-each" , 0, NULL, 'L' },
1021 { "no-summary", 0, NULL, 'N' },
1022 { "hwpoison" , 0, NULL, 'X' },
1023 { "unpoison" , 0, NULL, 'x' },
1024 { "help" , 0, NULL, 'h' },
1025 { NULL , 0, NULL, 0 }
1026};
1027
1028int main(int argc, char *argv[])
1029{
1030 int c;
1031
1032 page_size = getpagesize();
1033
1034 while ((c = getopt_long(argc, argv,
1035 "rp:f:a:b:d:lLNXxh", opts, NULL)) != -1) {
1036 switch (c) {
1037 case 'r':
1038 opt_raw = 1;
1039 break;
1040 case 'p':
1041 parse_pid(optarg);
1042 break;
1043 case 'f':
1044 parse_file(optarg);
1045 break;
1046 case 'a':
1047 parse_addr_range(optarg);
1048 break;
1049 case 'b':
1050 parse_bits_mask(optarg);
1051 break;
1052 case 'd':
1053 describe_flags(optarg);
1054 exit(0);
1055 case 'l':
1056 opt_list = 1;
1057 break;
1058 case 'L':
1059 opt_list = 2;
1060 break;
1061 case 'N':
1062 opt_no_summary = 1;
1063 break;
1064 case 'X':
1065 opt_hwpoison = 1;
1066 prepare_hwpoison_fd();
1067 break;
1068 case 'x':
1069 opt_unpoison = 1;
1070 prepare_hwpoison_fd();
1071 break;
1072 case 'h':
1073 usage();
1074 exit(0);
1075 default:
1076 usage();
1077 exit(1);
1078 }
1079 }
1080
1081 if (opt_list && opt_pid)
1082 printf("voffset\t");
1083 if (opt_list == 1)
1084 printf("offset\tlen\tflags\n");
1085 if (opt_list == 2)
1086 printf("offset\tflags\n");
1087
1088 walk_addr_ranges();
1089
1090 if (opt_list == 1)
1091 show_page_range(0, 0, 0); /* drain the buffer */
1092
1093 if (opt_no_summary)
1094 return 0;
1095
1096 if (opt_list)
1097 printf("\n\n");
1098
1099 show_summary();
1100
1101 return 0;
1102}
diff --git a/Documentation/watchdog/00-INDEX b/Documentation/watchdog/00-INDEX
deleted file mode 100644
index fc9082a1477a..000000000000
--- a/Documentation/watchdog/00-INDEX
+++ /dev/null
@@ -1,19 +0,0 @@
100-INDEX
2 - this file.
3convert_drivers_to_kernel_api.txt
4 - how-to for converting old watchdog drivers to the new kernel API.
5hpwdt.txt
6 - information on the HP iLO2 NMI watchdog
7pcwd-watchdog.txt
8 - documentation for Berkshire Products PC Watchdog ISA cards.
9src/
10 - directory holding watchdog related example programs.
11watchdog-api.txt
12 - description of the Linux Watchdog driver API.
13watchdog-kernel-api.txt
14 - description of the Linux WatchDog Timer Driver Core kernel API.
15watchdog-parameters.txt
16 - information on driver parameters (for drivers other than
17 the ones that have driver-specific files here)
18wdt.txt
19 - description of the Watchdog Timer Interfaces for Linux.
diff --git a/Documentation/watchdog/convert_drivers_to_kernel_api.txt b/Documentation/watchdog/convert_drivers_to_kernel_api.txt
index be8119bb15d2..271b8850dde7 100644
--- a/Documentation/watchdog/convert_drivers_to_kernel_api.txt
+++ b/Documentation/watchdog/convert_drivers_to_kernel_api.txt
@@ -59,6 +59,10 @@ Here is a overview of the functions and probably needed actions:
59 WDIOC_GETTIMEOUT: 59 WDIOC_GETTIMEOUT:
60 No preparations needed 60 No preparations needed
61 61
62 WDIOC_GETTIMELEFT:
63 It needs get_timeleft() callback to be defined. Otherwise it
64 will return EOPNOTSUPP
65
62 Other IOCTLs can be served using the ioctl-callback. Note that this is mainly 66 Other IOCTLs can be served using the ioctl-callback. Note that this is mainly
63 intended for porting old drivers; new drivers should not invent private IOCTLs. 67 intended for porting old drivers; new drivers should not invent private IOCTLs.
64 Private IOCTLs are processed first. When the callback returns with 68 Private IOCTLs are processed first. When the callback returns with
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt
index 9e162465b0cf..227f6cd0e5fa 100644
--- a/Documentation/watchdog/watchdog-kernel-api.txt
+++ b/Documentation/watchdog/watchdog-kernel-api.txt
@@ -1,6 +1,6 @@
1The Linux WatchDog Timer Driver Core kernel API. 1The Linux WatchDog Timer Driver Core kernel API.
2=============================================== 2===============================================
3Last reviewed: 29-Nov-2011 3Last reviewed: 16-Mar-2012
4 4
5Wim Van Sebroeck <wim@iguana.be> 5Wim Van Sebroeck <wim@iguana.be>
6 6
@@ -77,6 +77,7 @@ struct watchdog_ops {
77 int (*ping)(struct watchdog_device *); 77 int (*ping)(struct watchdog_device *);
78 unsigned int (*status)(struct watchdog_device *); 78 unsigned int (*status)(struct watchdog_device *);
79 int (*set_timeout)(struct watchdog_device *, unsigned int); 79 int (*set_timeout)(struct watchdog_device *, unsigned int);
80 unsigned int (*get_timeleft)(struct watchdog_device *);
80 long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long); 81 long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long);
81}; 82};
82 83
@@ -117,11 +118,13 @@ they are supported. These optional routines/operations are:
117 status of the device is reported with watchdog WDIOF_* status flags/bits. 118 status of the device is reported with watchdog WDIOF_* status flags/bits.
118* set_timeout: this routine checks and changes the timeout of the watchdog 119* set_timeout: this routine checks and changes the timeout of the watchdog
119 timer device. It returns 0 on success, -EINVAL for "parameter out of range" 120 timer device. It returns 0 on success, -EINVAL for "parameter out of range"
120 and -EIO for "could not write value to the watchdog". On success the timeout 121 and -EIO for "could not write value to the watchdog". On success this
121 value of the watchdog_device will be changed to the value that was just used 122 routine should set the timeout value of the watchdog_device to the
122 to re-program the watchdog timer device. 123 achieved timeout value (which may be different from the requested one
124 because the watchdog does not necessarily has a 1 second resolution).
123 (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the 125 (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the
124 watchdog's info structure). 126 watchdog's info structure).
127* get_timeleft: this routines returns the time that's left before a reset.
125* ioctl: if this routine is present then it will be called first before we do 128* ioctl: if this routine is present then it will be called first before we do
126 our own internal ioctl call handling. This routine should return -ENOIOCTLCMD 129 our own internal ioctl call handling. This routine should return -ENOIOCTLCMD
127 if a command is not supported. The parameters that are passed to the ioctl 130 if a command is not supported. The parameters that are passed to the ioctl