aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-10-17 03:58:25 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-17 03:58:25 -0400
commitbb3c3e807140816b5f5fd4840473ee52a916ad4f (patch)
tree9e8a69d266a7df86ca16177eefffab4b4e910753 /Documentation
parent595c36490deb49381dc51231a3d5e6b66786ed27 (diff)
parent012abeea669ea49636cf952d13298bb68654146a (diff)
Merge commit 'v2.6.32-rc5' into perf/probes
Conflicts: kernel/trace/trace_event_profile.c Merge reason: update to -rc5 and resolve conflict. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/testing/sysfs-bus-pci-devices-cciss28
-rw-r--r--Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc (renamed from Documentation/ABI/testing/sysfs-class-usb_host)4
-rw-r--r--Documentation/SubmittingPatches2
-rw-r--r--Documentation/arm/tcm.txt147
-rw-r--r--Documentation/auxdisplay/cfag12864b-example.c1
-rw-r--r--Documentation/cgroups/cgroups.txt43
-rw-r--r--Documentation/cgroups/memory.txt41
-rw-r--r--Documentation/connector/cn_test.c2
-rw-r--r--Documentation/connector/connector.txt8
-rw-r--r--Documentation/crypto/async-tx-api.txt75
-rw-r--r--Documentation/debugging-via-ohci1394.txt8
-rw-r--r--Documentation/feature-removal-schedule.txt38
-rw-r--r--Documentation/filesystems/9p.txt40
-rw-r--r--Documentation/filesystems/ext3.txt16
-rw-r--r--Documentation/filesystems/ext4.txt13
-rw-r--r--Documentation/filesystems/proc.txt1
-rw-r--r--Documentation/filesystems/sharedsubtree.txt220
-rw-r--r--Documentation/filesystems/vfat.txt2
-rw-r--r--Documentation/filesystems/vfs.txt7
-rw-r--r--Documentation/flexible-arrays.txt43
-rw-r--r--Documentation/hwmon/coretemp4
-rw-r--r--Documentation/hwmon/fscher169
-rw-r--r--Documentation/hwmon/ltc42157
-rw-r--r--Documentation/hwmon/ltc42457
-rw-r--r--Documentation/i2c/instantiating-devices2
-rw-r--r--Documentation/infiniband/user_mad.txt4
-rw-r--r--Documentation/infiniband/user_verbs.txt2
-rw-r--r--Documentation/ioctl/ioctl-number.txt1
-rw-r--r--Documentation/isdn/INTERFACE.CAPI83
-rw-r--r--Documentation/kbuild/kbuild.txt16
-rw-r--r--Documentation/kbuild/makefiles.txt20
-rw-r--r--Documentation/kernel-parameters.txt1
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt48
-rw-r--r--Documentation/misc-devices/eeprom (renamed from Documentation/i2c/chips/eeprom)0
-rw-r--r--Documentation/misc-devices/max6875 (renamed from Documentation/i2c/chips/max6875)6
-rw-r--r--Documentation/networking/pktgen.txt8
-rw-r--r--Documentation/networking/timestamping/timestamping.c2
-rw-r--r--Documentation/scsi/hptiop.txt21
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt2
-rw-r--r--Documentation/sysctl/fs.txt17
-rw-r--r--Documentation/sysctl/kernel.txt22
-rw-r--r--Documentation/sysctl/vm.txt41
-rw-r--r--Documentation/vm/.gitignore1
-rw-r--r--Documentation/vm/ksm.txt13
-rw-r--r--Documentation/vm/locking2
-rw-r--r--Documentation/vm/page-types.c388
-rw-r--r--Documentation/vm/pagemap.txt8
-rw-r--r--Documentation/w1/masters/ds24826
48 files changed, 1073 insertions, 567 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss
index 0a92a7c93a62..4f29e5f1ebfa 100644
--- a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss
+++ b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss
@@ -31,3 +31,31 @@ Date: March 2009
31Kernel Version: 2.6.30 31Kernel Version: 2.6.30
32Contact: iss_storagedev@hp.com 32Contact: iss_storagedev@hp.com
33Description: A symbolic link to /sys/block/cciss!cXdY 33Description: A symbolic link to /sys/block/cciss!cXdY
34
35Where: /sys/bus/pci/devices/<dev>/ccissX/rescan
36Date: August 2009
37Kernel Version: 2.6.31
38Contact: iss_storagedev@hp.com
39Description: Kicks of a rescan of the controller to discover logical
40 drive topology changes.
41
42Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/lunid
43Date: August 2009
44Kernel Version: 2.6.31
45Contact: iss_storagedev@hp.com
46Description: Displays the 8-byte LUN ID used to address logical
47 drive Y of controller X.
48
49Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/raid_level
50Date: August 2009
51Kernel Version: 2.6.31
52Contact: iss_storagedev@hp.com
53Description: Displays the RAID level of logical drive Y of
54 controller X.
55
56Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/usage_count
57Date: August 2009
58Kernel Version: 2.6.31
59Contact: iss_storagedev@hp.com
60Description: Displays the usage count (number of opens) of logical drive Y
61 of controller X.
diff --git a/Documentation/ABI/testing/sysfs-class-usb_host b/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc
index 46b66ad1f1b4..4e8106f7cfd9 100644
--- a/Documentation/ABI/testing/sysfs-class-usb_host
+++ b/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc
@@ -1,4 +1,4 @@
1What: /sys/class/usb_host/usb_hostN/wusb_chid 1What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_chid
2Date: July 2008 2Date: July 2008
3KernelVersion: 2.6.27 3KernelVersion: 2.6.27
4Contact: David Vrabel <david.vrabel@csr.com> 4Contact: David Vrabel <david.vrabel@csr.com>
@@ -9,7 +9,7 @@ Description:
9 9
10 Set an all zero CHID to stop the host controller. 10 Set an all zero CHID to stop the host controller.
11 11
12What: /sys/class/usb_host/usb_hostN/wusb_trust_timeout 12What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_trust_timeout
13Date: July 2008 13Date: July 2008
14KernelVersion: 2.6.27 14KernelVersion: 2.6.27
15Contact: David Vrabel <david.vrabel@csr.com> 15Contact: David Vrabel <david.vrabel@csr.com>
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index b7f9d3b4bbf6..72651f788f4e 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -232,7 +232,7 @@ your e-mail client so that it sends your patches untouched.
232When sending patches to Linus, always follow step #7. 232When sending patches to Linus, always follow step #7.
233 233
234Large changes are not appropriate for mailing lists, and some 234Large changes are not appropriate for mailing lists, and some
235maintainers. If your patch, uncompressed, exceeds 40 kB in size, 235maintainers. If your patch, uncompressed, exceeds 300 kB in size,
236it is preferred that you store your patch on an Internet-accessible 236it is preferred that you store your patch on an Internet-accessible
237server, and provide instead a URL (link) pointing to your patch. 237server, and provide instead a URL (link) pointing to your patch.
238 238
diff --git a/Documentation/arm/tcm.txt b/Documentation/arm/tcm.txt
new file mode 100644
index 000000000000..77fd9376e6d7
--- /dev/null
+++ b/Documentation/arm/tcm.txt
@@ -0,0 +1,147 @@
1ARM TCM (Tightly-Coupled Memory) handling in Linux
2----
3Written by Linus Walleij <linus.walleij@stericsson.com>
4
5Some ARM SoC:s have a so-called TCM (Tightly-Coupled Memory).
6This is usually just a few (4-64) KiB of RAM inside the ARM
7processor.
8
9Due to being embedded inside the CPU The TCM has a
10Harvard-architecture, so there is an ITCM (instruction TCM)
11and a DTCM (data TCM). The DTCM can not contain any
12instructions, but the ITCM can actually contain data.
13The size of DTCM or ITCM is minimum 4KiB so the typical
14minimum configuration is 4KiB ITCM and 4KiB DTCM.
15
16ARM CPU:s have special registers to read out status, physical
17location and size of TCM memories. arch/arm/include/asm/cputype.h
18defines a CPUID_TCM register that you can read out from the
19system control coprocessor. Documentation from ARM can be found
20at http://infocenter.arm.com, search for "TCM Status Register"
21to see documents for all CPUs. Reading this register you can
22determine if ITCM (bit 0) and/or DTCM (bit 16) is present in the
23machine.
24
25There is further a TCM region register (search for "TCM Region
26Registers" at the ARM site) that can report and modify the location
27size of TCM memories at runtime. This is used to read out and modify
28TCM location and size. Notice that this is not a MMU table: you
29actually move the physical location of the TCM around. At the
30place you put it, it will mask any underlying RAM from the
31CPU so it is usually wise not to overlap any physical RAM with
32the TCM.
33
34The TCM memory can then be remapped to another address again using
35the MMU, but notice that the TCM if often used in situations where
36the MMU is turned off. To avoid confusion the current Linux
37implementation will map the TCM 1 to 1 from physical to virtual
38memory in the location specified by the machine.
39
40TCM is used for a few things:
41
42- FIQ and other interrupt handlers that need deterministic
43 timing and cannot wait for cache misses.
44
45- Idle loops where all external RAM is set to self-refresh
46 retention mode, so only on-chip RAM is accessible by
47 the CPU and then we hang inside ITCM waiting for an
48 interrupt.
49
50- Other operations which implies shutting off or reconfiguring
51 the external RAM controller.
52
53There is an interface for using TCM on the ARM architecture
54in <asm/tcm.h>. Using this interface it is possible to:
55
56- Define the physical address and size of ITCM and DTCM.
57
58- Tag functions to be compiled into ITCM.
59
60- Tag data and constants to be allocated to DTCM and ITCM.
61
62- Have the remaining TCM RAM added to a special
63 allocation pool with gen_pool_create() and gen_pool_add()
64 and provice tcm_alloc() and tcm_free() for this
65 memory. Such a heap is great for things like saving
66 device state when shutting off device power domains.
67
68A machine that has TCM memory shall select HAVE_TCM in
69arch/arm/Kconfig for itself, and then the
70rest of the functionality will depend on the physical
71location and size of ITCM and DTCM to be defined in
72mach/memory.h for the machine. Code that needs to use
73TCM shall #include <asm/tcm.h> If the TCM is not located
74at the place given in memory.h it will be moved using
75the TCM Region registers.
76
77Functions to go into itcm can be tagged like this:
78int __tcmfunc foo(int bar);
79
80Variables to go into dtcm can be tagged like this:
81int __tcmdata foo;
82
83Constants can be tagged like this:
84int __tcmconst foo;
85
86To put assembler into TCM just use
87.section ".tcm.text" or .section ".tcm.data"
88respectively.
89
90Example code:
91
92#include <asm/tcm.h>
93
94/* Uninitialized data */
95static u32 __tcmdata tcmvar;
96/* Initialized data */
97static u32 __tcmdata tcmassigned = 0x2BADBABEU;
98/* Constant */
99static const u32 __tcmconst tcmconst = 0xCAFEBABEU;
100
101static void __tcmlocalfunc tcm_to_tcm(void)
102{
103 int i;
104 for (i = 0; i < 100; i++)
105 tcmvar ++;
106}
107
108static void __tcmfunc hello_tcm(void)
109{
110 /* Some abstract code that runs in ITCM */
111 int i;
112 for (i = 0; i < 100; i++) {
113 tcmvar ++;
114 }
115 tcm_to_tcm();
116}
117
118static void __init test_tcm(void)
119{
120 u32 *tcmem;
121 int i;
122
123 hello_tcm();
124 printk("Hello TCM executed from ITCM RAM\n");
125
126 printk("TCM variable from testrun: %u @ %p\n", tcmvar, &tcmvar);
127 tcmvar = 0xDEADBEEFU;
128 printk("TCM variable: 0x%x @ %p\n", tcmvar, &tcmvar);
129
130 printk("TCM assigned variable: 0x%x @ %p\n", tcmassigned, &tcmassigned);
131
132 printk("TCM constant: 0x%x @ %p\n", tcmconst, &tcmconst);
133
134 /* Allocate some TCM memory from the pool */
135 tcmem = tcm_alloc(20);
136 if (tcmem) {
137 printk("TCM Allocated 20 bytes of TCM @ %p\n", tcmem);
138 tcmem[0] = 0xDEADBEEFU;
139 tcmem[1] = 0x2BADBABEU;
140 tcmem[2] = 0xCAFEBABEU;
141 tcmem[3] = 0xDEADBEEFU;
142 tcmem[4] = 0x2BADBABEU;
143 for (i = 0; i < 5; i++)
144 printk("TCM tcmem[%d] = %08x\n", i, tcmem[i]);
145 tcm_free(tcmem, 20);
146 }
147}
diff --git a/Documentation/auxdisplay/cfag12864b-example.c b/Documentation/auxdisplay/cfag12864b-example.c
index 1d2c010bae12..e7823ffb1ca0 100644
--- a/Documentation/auxdisplay/cfag12864b-example.c
+++ b/Documentation/auxdisplay/cfag12864b-example.c
@@ -194,7 +194,6 @@ static void cfag12864b_blit(void)
194 */ 194 */
195 195
196#include <stdio.h> 196#include <stdio.h>
197#include <string.h>
198 197
199#define EXAMPLES 6 198#define EXAMPLES 6
200 199
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 6eb1a97e88ce..0b33bfe7dde9 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -227,7 +227,14 @@ as the path relative to the root of the cgroup file system.
227Each cgroup is represented by a directory in the cgroup file system 227Each cgroup is represented by a directory in the cgroup file system
228containing the following files describing that cgroup: 228containing the following files describing that cgroup:
229 229
230 - tasks: list of tasks (by pid) attached to that cgroup 230 - tasks: list of tasks (by pid) attached to that cgroup. This list
231 is not guaranteed to be sorted. Writing a thread id into this file
232 moves the thread into this cgroup.
233 - cgroup.procs: list of tgids in the cgroup. This list is not
234 guaranteed to be sorted or free of duplicate tgids, and userspace
235 should sort/uniquify the list if this property is required.
236 Writing a tgid into this file moves all threads with that tgid into
237 this cgroup.
231 - notify_on_release flag: run the release agent on exit? 238 - notify_on_release flag: run the release agent on exit?
232 - release_agent: the path to use for release notifications (this file 239 - release_agent: the path to use for release notifications (this file
233 exists in the top cgroup only) 240 exists in the top cgroup only)
@@ -374,7 +381,7 @@ Now you want to do something with this cgroup.
374 381
375In this directory you can find several files: 382In this directory you can find several files:
376# ls 383# ls
377notify_on_release tasks 384cgroup.procs notify_on_release tasks
378(plus whatever files added by the attached subsystems) 385(plus whatever files added by the attached subsystems)
379 386
380Now attach your shell to this cgroup: 387Now attach your shell to this cgroup:
@@ -408,6 +415,26 @@ You can attach the current shell task by echoing 0:
408 415
409# echo 0 > tasks 416# echo 0 > tasks
410 417
4182.3 Mounting hierarchies by name
419--------------------------------
420
421Passing the name=<x> option when mounting a cgroups hierarchy
422associates the given name with the hierarchy. This can be used when
423mounting a pre-existing hierarchy, in order to refer to it by name
424rather than by its set of active subsystems. Each hierarchy is either
425nameless, or has a unique name.
426
427The name should match [\w.-]+
428
429When passing a name=<x> option for a new hierarchy, you need to
430specify subsystems manually; the legacy behaviour of mounting all
431subsystems when none are explicitly specified is not supported when
432you give a subsystem a name.
433
434The name of the subsystem appears as part of the hierarchy description
435in /proc/mounts and /proc/<pid>/cgroups.
436
437
4113. Kernel API 4383. Kernel API
412============= 439=============
413 440
@@ -501,7 +528,7 @@ rmdir() will fail with it. From this behavior, pre_destroy() can be
501called multiple times against a cgroup. 528called multiple times against a cgroup.
502 529
503int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 530int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
504 struct task_struct *task) 531 struct task_struct *task, bool threadgroup)
505(cgroup_mutex held by caller) 532(cgroup_mutex held by caller)
506 533
507Called prior to moving a task into a cgroup; if the subsystem 534Called prior to moving a task into a cgroup; if the subsystem
@@ -509,14 +536,20 @@ returns an error, this will abort the attach operation. If a NULL
509task is passed, then a successful result indicates that *any* 536task is passed, then a successful result indicates that *any*
510unspecified task can be moved into the cgroup. Note that this isn't 537unspecified task can be moved into the cgroup. Note that this isn't
511called on a fork. If this method returns 0 (success) then this should 538called on a fork. If this method returns 0 (success) then this should
512remain valid while the caller holds cgroup_mutex. 539remain valid while the caller holds cgroup_mutex. If threadgroup is
540true, then a successful result indicates that all threads in the given
541thread's threadgroup can be moved together.
513 542
514void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 543void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
515 struct cgroup *old_cgrp, struct task_struct *task) 544 struct cgroup *old_cgrp, struct task_struct *task,
545 bool threadgroup)
516(cgroup_mutex held by caller) 546(cgroup_mutex held by caller)
517 547
518Called after the task has been attached to the cgroup, to allow any 548Called after the task has been attached to the cgroup, to allow any
519post-attachment activity that requires memory allocations or blocking. 549post-attachment activity that requires memory allocations or blocking.
550If threadgroup is true, the subsystem should take care of all threads
551in the specified thread's threadgroup. Currently does not support any
552subsystem that might need the old_cgrp for every thread in the group.
520 553
521void fork(struct cgroup_subsy *ss, struct task_struct *task) 554void fork(struct cgroup_subsy *ss, struct task_struct *task)
522 555
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 23d1262c0775..b871f2552b45 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -179,6 +179,9 @@ The reclaim algorithm has not been modified for cgroups, except that
179pages that are selected for reclaiming come from the per cgroup LRU 179pages that are selected for reclaiming come from the per cgroup LRU
180list. 180list.
181 181
182NOTE: Reclaim does not work for the root cgroup, since we cannot set any
183limits on the root cgroup.
184
1822. Locking 1852. Locking
183 186
184The memory controller uses the following hierarchy 187The memory controller uses the following hierarchy
@@ -210,6 +213,7 @@ We can alter the memory limit:
210NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, 213NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo,
211mega or gigabytes. 214mega or gigabytes.
212NOTE: We can write "-1" to reset the *.limit_in_bytes(unlimited). 215NOTE: We can write "-1" to reset the *.limit_in_bytes(unlimited).
216NOTE: We cannot set limits on the root cgroup any more.
213 217
214# cat /cgroups/0/memory.limit_in_bytes 218# cat /cgroups/0/memory.limit_in_bytes
2154194304 2194194304
@@ -375,7 +379,42 @@ cgroups created below it.
375 379
376NOTE2: This feature can be enabled/disabled per subtree. 380NOTE2: This feature can be enabled/disabled per subtree.
377 381
3787. TODO 3827. Soft limits
383
384Soft limits allow for greater sharing of memory. The idea behind soft limits
385is to allow control groups to use as much of the memory as needed, provided
386
387a. There is no memory contention
388b. They do not exceed their hard limit
389
390When the system detects memory contention or low memory control groups
391are pushed back to their soft limits. If the soft limit of each control
392group is very high, they are pushed back as much as possible to make
393sure that one control group does not starve the others of memory.
394
395Please note that soft limits is a best effort feature, it comes with
396no guarantees, but it does its best to make sure that when memory is
397heavily contended for, memory is allocated based on the soft limit
398hints/setup. Currently soft limit based reclaim is setup such that
399it gets invoked from balance_pgdat (kswapd).
400
4017.1 Interface
402
403Soft limits can be setup by using the following commands (in this example we
404assume a soft limit of 256 megabytes)
405
406# echo 256M > memory.soft_limit_in_bytes
407
408If we want to change this to 1G, we can at any time use
409
410# echo 1G > memory.soft_limit_in_bytes
411
412NOTE1: Soft limits take effect over a long period of time, since they involve
413 reclaiming memory for balancing between memory cgroups
414NOTE2: It is recommended to set the soft limit always below the hard limit,
415 otherwise the hard limit will take precedence.
416
4178. TODO
379 418
3801. Add support for accounting huge pages (as a separate controller) 4191. Add support for accounting huge pages (as a separate controller)
3812. Make per-cgroup scanner reclaim not-shared pages first 4202. Make per-cgroup scanner reclaim not-shared pages first
diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c
index 1711adc33373..b07add3467f1 100644
--- a/Documentation/connector/cn_test.c
+++ b/Documentation/connector/cn_test.c
@@ -34,7 +34,7 @@ static char cn_test_name[] = "cn_test";
34static struct sock *nls; 34static struct sock *nls;
35static struct timer_list cn_test_timer; 35static struct timer_list cn_test_timer;
36 36
37static void cn_test_callback(struct cn_msg *msg) 37static void cn_test_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
38{ 38{
39 pr_info("%s: %lu: idx=%x, val=%x, seq=%u, ack=%u, len=%d: %s.\n", 39 pr_info("%s: %lu: idx=%x, val=%x, seq=%u, ack=%u, len=%d: %s.\n",
40 __func__, jiffies, msg->id.idx, msg->id.val, 40 __func__, jiffies, msg->id.idx, msg->id.val,
diff --git a/Documentation/connector/connector.txt b/Documentation/connector/connector.txt
index 81e6bf6ead57..78c9466a9aa8 100644
--- a/Documentation/connector/connector.txt
+++ b/Documentation/connector/connector.txt
@@ -23,7 +23,7 @@ handling, etc... The Connector driver allows any kernelspace agents to use
23netlink based networking for inter-process communication in a significantly 23netlink based networking for inter-process communication in a significantly
24easier way: 24easier way:
25 25
26int cn_add_callback(struct cb_id *id, char *name, void (*callback) (void *)); 26int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *));
27void cn_netlink_send(struct cn_msg *msg, u32 __group, int gfp_mask); 27void cn_netlink_send(struct cn_msg *msg, u32 __group, int gfp_mask);
28 28
29struct cb_id 29struct cb_id
@@ -53,15 +53,15 @@ struct cn_msg
53Connector interfaces. 53Connector interfaces.
54/*****************************************/ 54/*****************************************/
55 55
56int cn_add_callback(struct cb_id *id, char *name, void (*callback) (void *)); 56int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *));
57 57
58 Registers new callback with connector core. 58 Registers new callback with connector core.
59 59
60 struct cb_id *id - unique connector's user identifier. 60 struct cb_id *id - unique connector's user identifier.
61 It must be registered in connector.h for legal in-kernel users. 61 It must be registered in connector.h for legal in-kernel users.
62 char *name - connector's callback symbolic name. 62 char *name - connector's callback symbolic name.
63 void (*callback) (void *) - connector's callback. 63 void (*callback) (struct cn..) - connector's callback.
64 Argument must be dereferenced to struct cn_msg *. 64 cn_msg and the sender's credentials
65 65
66 66
67void cn_del_callback(struct cb_id *id); 67void cn_del_callback(struct cb_id *id);
diff --git a/Documentation/crypto/async-tx-api.txt b/Documentation/crypto/async-tx-api.txt
index 9f59fcbf5d82..ba046b8fa92f 100644
--- a/Documentation/crypto/async-tx-api.txt
+++ b/Documentation/crypto/async-tx-api.txt
@@ -54,20 +54,23 @@ features surfaced as a result:
54 54
553.1 General format of the API: 553.1 General format of the API:
56struct dma_async_tx_descriptor * 56struct dma_async_tx_descriptor *
57async_<operation>(<op specific parameters>, 57async_<operation>(<op specific parameters>, struct async_submit ctl *submit)
58 enum async_tx_flags flags,
59 struct dma_async_tx_descriptor *dependency,
60 dma_async_tx_callback callback_routine,
61 void *callback_parameter);
62 58
633.2 Supported operations: 593.2 Supported operations:
64memcpy - memory copy between a source and a destination buffer 60memcpy - memory copy between a source and a destination buffer
65memset - fill a destination buffer with a byte value 61memset - fill a destination buffer with a byte value
66xor - xor a series of source buffers and write the result to a 62xor - xor a series of source buffers and write the result to a
67 destination buffer 63 destination buffer
68xor_zero_sum - xor a series of source buffers and set a flag if the 64xor_val - xor a series of source buffers and set a flag if the
69 result is zero. The implementation attempts to prevent 65 result is zero. The implementation attempts to prevent
70 writes to memory 66 writes to memory
67pq - generate the p+q (raid6 syndrome) from a series of source buffers
68pq_val - validate that a p and or q buffer are in sync with a given series of
69 sources
70datap - (raid6_datap_recov) recover a raid6 data block and the p block
71 from the given sources
722data - (raid6_2data_recov) recover 2 raid6 data blocks from the given
73 sources
71 74
723.3 Descriptor management: 753.3 Descriptor management:
73The return value is non-NULL and points to a 'descriptor' when the operation 76The return value is non-NULL and points to a 'descriptor' when the operation
@@ -80,8 +83,8 @@ acknowledged by the application before the offload engine driver is allowed to
80recycle (or free) the descriptor. A descriptor can be acked by one of the 83recycle (or free) the descriptor. A descriptor can be acked by one of the
81following methods: 84following methods:
821/ setting the ASYNC_TX_ACK flag if no child operations are to be submitted 851/ setting the ASYNC_TX_ACK flag if no child operations are to be submitted
832/ setting the ASYNC_TX_DEP_ACK flag to acknowledge the parent 862/ submitting an unacknowledged descriptor as a dependency to another
84 descriptor of a new operation. 87 async_tx call will implicitly set the acknowledged state.
853/ calling async_tx_ack() on the descriptor. 883/ calling async_tx_ack() on the descriptor.
86 89
873.4 When does the operation execute? 903.4 When does the operation execute?
@@ -119,30 +122,42 @@ of an operation.
119Perform a xor->copy->xor operation where each operation depends on the 122Perform a xor->copy->xor operation where each operation depends on the
120result from the previous operation: 123result from the previous operation:
121 124
122void complete_xor_copy_xor(void *param) 125void callback(void *param)
123{ 126{
124 printk("complete\n"); 127 struct completion *cmp = param;
128
129 complete(cmp);
125} 130}
126 131
127int run_xor_copy_xor(struct page **xor_srcs, 132void run_xor_copy_xor(struct page **xor_srcs,
128 int xor_src_cnt, 133 int xor_src_cnt,
129 struct page *xor_dest, 134 struct page *xor_dest,
130 size_t xor_len, 135 size_t xor_len,
131 struct page *copy_src, 136 struct page *copy_src,
132 struct page *copy_dest, 137 struct page *copy_dest,
133 size_t copy_len) 138 size_t copy_len)
134{ 139{
135 struct dma_async_tx_descriptor *tx; 140 struct dma_async_tx_descriptor *tx;
141 addr_conv_t addr_conv[xor_src_cnt];
142 struct async_submit_ctl submit;
143 addr_conv_t addr_conv[NDISKS];
144 struct completion cmp;
145
146 init_async_submit(&submit, ASYNC_TX_XOR_DROP_DST, NULL, NULL, NULL,
147 addr_conv);
148 tx = async_xor(xor_dest, xor_srcs, 0, xor_src_cnt, xor_len, &submit)
136 149
137 tx = async_xor(xor_dest, xor_srcs, 0, xor_src_cnt, xor_len, 150 submit->depend_tx = tx;
138 ASYNC_TX_XOR_DROP_DST, NULL, NULL, NULL); 151 tx = async_memcpy(copy_dest, copy_src, 0, 0, copy_len, &submit);
139 tx = async_memcpy(copy_dest, copy_src, 0, 0, copy_len, 152
140 ASYNC_TX_DEP_ACK, tx, NULL, NULL); 153 init_completion(&cmp);
141 tx = async_xor(xor_dest, xor_srcs, 0, xor_src_cnt, xor_len, 154 init_async_submit(&submit, ASYNC_TX_XOR_DROP_DST | ASYNC_TX_ACK, tx,
142 ASYNC_TX_XOR_DROP_DST | ASYNC_TX_DEP_ACK | ASYNC_TX_ACK, 155 callback, &cmp, addr_conv);
143 tx, complete_xor_copy_xor, NULL); 156 tx = async_xor(xor_dest, xor_srcs, 0, xor_src_cnt, xor_len, &submit);
144 157
145 async_tx_issue_pending_all(); 158 async_tx_issue_pending_all();
159
160 wait_for_completion(&cmp);
146} 161}
147 162
148See include/linux/async_tx.h for more information on the flags. See the 163See include/linux/async_tx.h for more information on the flags. See the
diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt
index 59a91e5c6909..611f5a5499b1 100644
--- a/Documentation/debugging-via-ohci1394.txt
+++ b/Documentation/debugging-via-ohci1394.txt
@@ -64,14 +64,14 @@ be used to view the printk buffer of a remote machine, even with live update.
64 64
65Bernhard Kaindl enhanced firescope to support accessing 64-bit machines 65Bernhard Kaindl enhanced firescope to support accessing 64-bit machines
66from 32-bit firescope and vice versa: 66from 32-bit firescope and vice versa:
67- ftp://ftp.suse.de/private/bk/firewire/tools/firescope-0.2.2.tar.bz2 67- http://halobates.de/firewire/firescope-0.2.2.tar.bz2
68 68
69and he implemented fast system dump (alpha version - read README.txt): 69and he implemented fast system dump (alpha version - read README.txt):
70- ftp://ftp.suse.de/private/bk/firewire/tools/firedump-0.1.tar.bz2 70- http://halobates.de/firewire/firedump-0.1.tar.bz2
71 71
72There is also a gdb proxy for firewire which allows to use gdb to access 72There is also a gdb proxy for firewire which allows to use gdb to access
73data which can be referenced from symbols found by gdb in vmlinux: 73data which can be referenced from symbols found by gdb in vmlinux:
74- ftp://ftp.suse.de/private/bk/firewire/tools/fireproxy-0.33.tar.bz2 74- http://halobates.de/firewire/fireproxy-0.33.tar.bz2
75 75
76The latest version of this gdb proxy (fireproxy-0.34) can communicate (not 76The latest version of this gdb proxy (fireproxy-0.34) can communicate (not
77yet stable) with kgdb over an memory-based communication module (kgdbom). 77yet stable) with kgdb over an memory-based communication module (kgdbom).
@@ -178,7 +178,7 @@ Step-by-step instructions for using firescope with early OHCI initialization:
178 178
179Notes 179Notes
180----- 180-----
181Documentation and specifications: ftp://ftp.suse.de/private/bk/firewire/docs 181Documentation and specifications: http://halobates.de/firewire/
182 182
183FireWire is a trademark of Apple Inc. - for more information please refer to: 183FireWire is a trademark of Apple Inc. - for more information please refer to:
184http://en.wikipedia.org/wiki/FireWire 184http://en.wikipedia.org/wiki/FireWire
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index fa75220f8d34..04e6c819b28a 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -354,14 +354,6 @@ Who: Krzysztof Piotr Oledzki <ole@ans.pl>
354 354
355--------------------------- 355---------------------------
356 356
357What: fscher and fscpos drivers
358When: June 2009
359Why: Deprecated by the new fschmd driver.
360Who: Hans de Goede <hdegoede@redhat.com>
361 Jean Delvare <khali@linux-fr.org>
362
363---------------------------
364
365What: sysfs ui for changing p4-clockmod parameters 357What: sysfs ui for changing p4-clockmod parameters
366When: September 2009 358When: September 2009
367Why: See commits 129f8ae9b1b5be94517da76009ea956e89104ce8 and 359Why: See commits 129f8ae9b1b5be94517da76009ea956e89104ce8 and
@@ -459,3 +451,33 @@ Why: OSS sound_core grabs all legacy minors (0-255) of SOUND_MAJOR
459 will also allow making ALSA OSS emulation independent of 451 will also allow making ALSA OSS emulation independent of
460 sound_core. The dependency will be broken then too. 452 sound_core. The dependency will be broken then too.
461Who: Tejun Heo <tj@kernel.org> 453Who: Tejun Heo <tj@kernel.org>
454
455----------------------------
456
457What: Support for VMware's guest paravirtuliazation technique [VMI] will be
458 dropped.
459When: 2.6.37 or earlier.
460Why: With the recent innovations in CPU hardware acceleration technologies
461 from Intel and AMD, VMware ran a few experiments to compare these
462 techniques to guest paravirtualization technique on VMware's platform.
463 These hardware assisted virtualization techniques have outperformed the
464 performance benefits provided by VMI in most of the workloads. VMware
465 expects that these hardware features will be ubiquitous in a couple of
466 years, as a result, VMware has started a phased retirement of this
467 feature from the hypervisor. We will be removing this feature from the
468 Kernel too. Right now we are targeting 2.6.37 but can retire earlier if
469 technical reasons (read opportunity to remove major chunk of pvops)
470 arise.
471
472 Please note that VMI has always been an optimization and non-VMI kernels
473 still work fine on VMware's platform.
474 Latest versions of VMware's product which support VMI are,
475 Workstation 7.0 and VSphere 4.0 on ESX side, future maintainence
476 releases for these products will continue supporting VMI.
477
478 For more details about VMI retirement take a look at this,
479 http://blogs.vmware.com/guestosguide/2009/09/vmi-retirement.html
480
481Who: Alok N Kataria <akataria@vmware.com>
482
483----------------------------
diff --git a/Documentation/filesystems/9p.txt b/Documentation/filesystems/9p.txt
index 6208f55c44c3..57e0b80a5274 100644
--- a/Documentation/filesystems/9p.txt
+++ b/Documentation/filesystems/9p.txt
@@ -18,11 +18,11 @@ the 9p client is available in the form of a USENIX paper:
18 18
19Other applications are described in the following papers: 19Other applications are described in the following papers:
20 * XCPU & Clustering 20 * XCPU & Clustering
21 http://www.xcpu.org/xcpu-talk.pdf 21 http://xcpu.org/papers/xcpu-talk.pdf
22 * KVMFS: control file system for KVM 22 * KVMFS: control file system for KVM
23 http://www.xcpu.org/kvmfs.pdf 23 http://xcpu.org/papers/kvmfs.pdf
24 * CellFS: A New ProgrammingModel for the Cell BE 24 * CellFS: A New Programming Model for the Cell BE
25 http://www.xcpu.org/cellfs-talk.pdf 25 http://xcpu.org/papers/cellfs-talk.pdf
26 * PROSE I/O: Using 9p to enable Application Partitions 26 * PROSE I/O: Using 9p to enable Application Partitions
27 http://plan9.escet.urjc.es/iwp9/cready/PROSE_iwp9_2006.pdf 27 http://plan9.escet.urjc.es/iwp9/cready/PROSE_iwp9_2006.pdf
28 28
@@ -48,6 +48,7 @@ OPTIONS
48 (see rfdno and wfdno) 48 (see rfdno and wfdno)
49 virtio - connect to the next virtio channel available 49 virtio - connect to the next virtio channel available
50 (from lguest or KVM with trans_virtio module) 50 (from lguest or KVM with trans_virtio module)
51 rdma - connect to a specified RDMA channel
51 52
52 uname=name user name to attempt mount as on the remote server. The 53 uname=name user name to attempt mount as on the remote server. The
53 server may override or ignore this value. Certain user 54 server may override or ignore this value. Certain user
@@ -59,16 +60,22 @@ OPTIONS
59 cache=mode specifies a caching policy. By default, no caches are used. 60 cache=mode specifies a caching policy. By default, no caches are used.
60 loose = no attempts are made at consistency, 61 loose = no attempts are made at consistency,
61 intended for exclusive, read-only mounts 62 intended for exclusive, read-only mounts
63 fscache = use FS-Cache for a persistent, read-only
64 cache backend.
62 65
63 debug=n specifies debug level. The debug level is a bitmask. 66 debug=n specifies debug level. The debug level is a bitmask.
64 0x01 = display verbose error messages 67 0x01 = display verbose error messages
65 0x02 = developer debug (DEBUG_CURRENT) 68 0x02 = developer debug (DEBUG_CURRENT)
66 0x04 = display 9p trace 69 0x04 = display 9p trace
67 0x08 = display VFS trace 70 0x08 = display VFS trace
68 0x10 = display Marshalling debug 71 0x10 = display Marshalling debug
69 0x20 = display RPC debug 72 0x20 = display RPC debug
70 0x40 = display transport debug 73 0x40 = display transport debug
71 0x80 = display allocation debug 74 0x80 = display allocation debug
75 0x100 = display protocol message debug
76 0x200 = display Fid debug
77 0x400 = display packet debug
78 0x800 = display fscache tracing debug
72 79
73 rfdno=n the file descriptor for reading with trans=fd 80 rfdno=n the file descriptor for reading with trans=fd
74 81
@@ -100,6 +107,10 @@ OPTIONS
100 any = v9fs does single attach and performs all 107 any = v9fs does single attach and performs all
101 operations as one user 108 operations as one user
102 109
110 cachetag cache tag to use the specified persistent cache.
111 cache tags for existing cache sessions can be listed at
112 /sys/fs/9p/caches. (applies only to cache=fscache)
113
103RESOURCES 114RESOURCES
104========= 115=========
105 116
@@ -118,7 +129,7 @@ and export.
118A Linux version of the 9p server is now maintained under the npfs project 129A Linux version of the 9p server is now maintained under the npfs project
119on sourceforge (http://sourceforge.net/projects/npfs). The currently 130on sourceforge (http://sourceforge.net/projects/npfs). The currently
120maintained version is the single-threaded version of the server (named spfs) 131maintained version is the single-threaded version of the server (named spfs)
121available from the same CVS repository. 132available from the same SVN repository.
122 133
123There are user and developer mailing lists available through the v9fs project 134There are user and developer mailing lists available through the v9fs project
124on sourceforge (http://sourceforge.net/projects/v9fs). 135on sourceforge (http://sourceforge.net/projects/v9fs).
@@ -126,7 +137,8 @@ on sourceforge (http://sourceforge.net/projects/v9fs).
126A stand-alone version of the module (which should build for any 2.6 kernel) 137A stand-alone version of the module (which should build for any 2.6 kernel)
127is available via (http://github.com/ericvh/9p-sac/tree/master) 138is available via (http://github.com/ericvh/9p-sac/tree/master)
128 139
129News and other information is maintained on SWiK (http://swik.net/v9fs). 140News and other information is maintained on SWiK (http://swik.net/v9fs)
141and the Wiki (http://sf.net/apps/mediawiki/v9fs/index.php).
130 142
131Bug reports may be issued through the kernel.org bugzilla 143Bug reports may be issued through the kernel.org bugzilla
132(http://bugzilla.kernel.org) 144(http://bugzilla.kernel.org)
diff --git a/Documentation/filesystems/ext3.txt b/Documentation/filesystems/ext3.txt
index 570f9bd9be2b..05d5cf1d743f 100644
--- a/Documentation/filesystems/ext3.txt
+++ b/Documentation/filesystems/ext3.txt
@@ -123,10 +123,18 @@ resuid=n The user ID which may use the reserved blocks.
123 123
124sb=n Use alternate superblock at this location. 124sb=n Use alternate superblock at this location.
125 125
126quota 126quota These options are ignored by the filesystem. They
127noquota 127noquota are used only by quota tools to recognize volumes
128grpquota 128grpquota where quota should be turned on. See documentation
129usrquota 129usrquota in the quota-tools package for more details
130 (http://sourceforge.net/projects/linuxquota).
131
132jqfmt=<quota type> These options tell filesystem details about quota
133usrjquota=<file> so that quota information can be properly updated
134grpjquota=<file> during journal replay. They replace the above
135 quota options. See documentation in the quota-tools
136 package for more details
137 (http://sourceforge.net/projects/linuxquota).
130 138
131bh (*) ext3 associates buffer heads to data pages to 139bh (*) ext3 associates buffer heads to data pages to
132nobh (a) cache disk block mapping information 140nobh (a) cache disk block mapping information
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index 18b5ec8cea45..bf4f4b7e11b3 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -282,9 +282,16 @@ stripe=n Number of filesystem blocks that mballoc will try
282 to use for allocation size and alignment. For RAID5/6 282 to use for allocation size and alignment. For RAID5/6
283 systems this should be the number of data 283 systems this should be the number of data
284 disks * RAID chunk size in file system blocks. 284 disks * RAID chunk size in file system blocks.
285delalloc (*) Deferring block allocation until write-out time. 285
286nodelalloc Disable delayed allocation. Blocks are allocation 286delalloc (*) Defer block allocation until just before ext4
287 when data is copied from user to page cache. 287 writes out the block(s) in question. This
288 allows ext4 to better allocation decisions
289 more efficiently.
290nodelalloc Disable delayed allocation. Blocks are allocated
291 when the data is copied from userspace to the
292 page cache, either via the write(2) system call
293 or when an mmap'ed page which was previously
294 unallocated is written for the first time.
288 295
289max_batch_time=usec Maximum amount of time ext4 should wait for 296max_batch_time=usec Maximum amount of time ext4 should wait for
290 additional filesystem operations to be batch 297 additional filesystem operations to be batch
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index b5aee7838a00..2c48f945546b 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1113,7 +1113,6 @@ Table 1-12: Files in /proc/fs/ext4/<devname>
1113.............................................................................. 1113..............................................................................
1114 File Content 1114 File Content
1115 mb_groups details of multiblock allocator buddy cache of free blocks 1115 mb_groups details of multiblock allocator buddy cache of free blocks
1116 mb_history multiblock allocation history
1117.............................................................................. 1116..............................................................................
1118 1117
1119 1118
diff --git a/Documentation/filesystems/sharedsubtree.txt b/Documentation/filesystems/sharedsubtree.txt
index 736540045dc7..23a181074f94 100644
--- a/Documentation/filesystems/sharedsubtree.txt
+++ b/Documentation/filesystems/sharedsubtree.txt
@@ -4,7 +4,7 @@ Shared Subtrees
4Contents: 4Contents:
5 1) Overview 5 1) Overview
6 2) Features 6 2) Features
7 3) smount command 7 3) Setting mount states
8 4) Use-case 8 4) Use-case
9 5) Detailed semantics 9 5) Detailed semantics
10 6) Quiz 10 6) Quiz
@@ -41,14 +41,14 @@ replicas continue to be exactly same.
41 41
42 Here is an example: 42 Here is an example:
43 43
44 Lets say /mnt has a mount that is shared. 44 Let's say /mnt has a mount that is shared.
45 mount --make-shared /mnt 45 mount --make-shared /mnt
46 46
47 note: mount command does not yet support the --make-shared flag. 47 Note: mount(8) command now supports the --make-shared flag,
48 I have included a small C program which does the same by executing 48 so the sample 'smount' program is no longer needed and has been
49 'smount /mnt shared' 49 removed.
50 50
51 #mount --bind /mnt /tmp 51 # mount --bind /mnt /tmp
52 The above command replicates the mount at /mnt to the mountpoint /tmp 52 The above command replicates the mount at /mnt to the mountpoint /tmp
53 and the contents of both the mounts remain identical. 53 and the contents of both the mounts remain identical.
54 54
@@ -58,8 +58,8 @@ replicas continue to be exactly same.
58 #ls /tmp 58 #ls /tmp
59 a b c 59 a b c
60 60
61 Now lets say we mount a device at /tmp/a 61 Now let's say we mount a device at /tmp/a
62 #mount /dev/sd0 /tmp/a 62 # mount /dev/sd0 /tmp/a
63 63
64 #ls /tmp/a 64 #ls /tmp/a
65 t1 t2 t2 65 t1 t2 t2
@@ -80,21 +80,20 @@ replicas continue to be exactly same.
80 80
81 Here is an example: 81 Here is an example:
82 82
83 Lets say /mnt has a mount which is shared. 83 Let's say /mnt has a mount which is shared.
84 #mount --make-shared /mnt 84 # mount --make-shared /mnt
85 85
86 Lets bind mount /mnt to /tmp 86 Let's bind mount /mnt to /tmp
87 #mount --bind /mnt /tmp 87 # mount --bind /mnt /tmp
88 88
89 the new mount at /tmp becomes a shared mount and it is a replica of 89 the new mount at /tmp becomes a shared mount and it is a replica of
90 the mount at /mnt. 90 the mount at /mnt.
91 91
92 Now lets make the mount at /tmp; a slave of /mnt 92 Now let's make the mount at /tmp; a slave of /mnt
93 #mount --make-slave /tmp 93 # mount --make-slave /tmp
94 [or smount /tmp slave]
95 94
96 lets mount /dev/sd0 on /mnt/a 95 let's mount /dev/sd0 on /mnt/a
97 #mount /dev/sd0 /mnt/a 96 # mount /dev/sd0 /mnt/a
98 97
99 #ls /mnt/a 98 #ls /mnt/a
100 t1 t2 t3 99 t1 t2 t3
@@ -104,9 +103,9 @@ replicas continue to be exactly same.
104 103
105 Note the mount event has propagated to the mount at /tmp 104 Note the mount event has propagated to the mount at /tmp
106 105
107 However lets see what happens if we mount something on the mount at /tmp 106 However let's see what happens if we mount something on the mount at /tmp
108 107
109 #mount /dev/sd1 /tmp/b 108 # mount /dev/sd1 /tmp/b
110 109
111 #ls /tmp/b 110 #ls /tmp/b
112 s1 s2 s3 111 s1 s2 s3
@@ -124,12 +123,11 @@ replicas continue to be exactly same.
124 123
1252d) A unbindable mount is a unbindable private mount 1242d) A unbindable mount is a unbindable private mount
126 125
127 lets say we have a mount at /mnt and we make is unbindable 126 let's say we have a mount at /mnt and we make is unbindable
128 127
129 #mount --make-unbindable /mnt 128 # mount --make-unbindable /mnt
130 [ smount /mnt unbindable ]
131 129
132 Lets try to bind mount this mount somewhere else. 130 Let's try to bind mount this mount somewhere else.
133 # mount --bind /mnt /tmp 131 # mount --bind /mnt /tmp
134 mount: wrong fs type, bad option, bad superblock on /mnt, 132 mount: wrong fs type, bad option, bad superblock on /mnt,
135 or too many mounted file systems 133 or too many mounted file systems
@@ -137,149 +135,15 @@ replicas continue to be exactly same.
137 Binding a unbindable mount is a invalid operation. 135 Binding a unbindable mount is a invalid operation.
138 136
139 137
1403) smount command 1383) Setting mount states
141 139
142 Currently the mount command is not aware of shared subtree features. 140 The mount command (util-linux package) can be used to set mount
143 Work is in progress to add the support in mount ( util-linux package ). 141 states:
144 Till then use the following program.
145 142
146 ------------------------------------------------------------------------ 143 mount --make-shared mountpoint
147 // 144 mount --make-slave mountpoint
148 //this code was developed my Miklos Szeredi <miklos@szeredi.hu> 145 mount --make-private mountpoint
149 //and modified by Ram Pai <linuxram@us.ibm.com> 146 mount --make-unbindable mountpoint
150 // sample usage:
151 // smount /tmp shared
152 //
153 #include <stdio.h>
154 #include <stdlib.h>
155 #include <unistd.h>
156 #include <string.h>
157 #include <sys/mount.h>
158 #include <sys/fsuid.h>
159
160 #ifndef MS_REC
161 #define MS_REC 0x4000 /* 16384: Recursive loopback */
162 #endif
163
164 #ifndef MS_SHARED
165 #define MS_SHARED 1<<20 /* Shared */
166 #endif
167
168 #ifndef MS_PRIVATE
169 #define MS_PRIVATE 1<<18 /* Private */
170 #endif
171
172 #ifndef MS_SLAVE
173 #define MS_SLAVE 1<<19 /* Slave */
174 #endif
175
176 #ifndef MS_UNBINDABLE
177 #define MS_UNBINDABLE 1<<17 /* Unbindable */
178 #endif
179
180 int main(int argc, char *argv[])
181 {
182 int type;
183 if(argc != 3) {
184 fprintf(stderr, "usage: %s dir "
185 "<rshared|rslave|rprivate|runbindable|shared|slave"
186 "|private|unbindable>\n" , argv[0]);
187 return 1;
188 }
189
190 fprintf(stdout, "%s %s %s\n", argv[0], argv[1], argv[2]);
191
192 if (strcmp(argv[2],"rshared")==0)
193 type=(MS_SHARED|MS_REC);
194 else if (strcmp(argv[2],"rslave")==0)
195 type=(MS_SLAVE|MS_REC);
196 else if (strcmp(argv[2],"rprivate")==0)
197 type=(MS_PRIVATE|MS_REC);
198 else if (strcmp(argv[2],"runbindable")==0)
199 type=(MS_UNBINDABLE|MS_REC);
200 else if (strcmp(argv[2],"shared")==0)
201 type=MS_SHARED;
202 else if (strcmp(argv[2],"slave")==0)
203 type=MS_SLAVE;
204 else if (strcmp(argv[2],"private")==0)
205 type=MS_PRIVATE;
206 else if (strcmp(argv[2],"unbindable")==0)
207 type=MS_UNBINDABLE;
208 else {
209 fprintf(stderr, "invalid operation: %s\n", argv[2]);
210 return 1;
211 }
212 setfsuid(getuid());
213
214 if(mount("", argv[1], "dontcare", type, "") == -1) {
215 perror("mount");
216 return 1;
217 }
218 return 0;
219 }
220 -----------------------------------------------------------------------
221
222 Copy the above code snippet into smount.c
223 gcc -o smount smount.c
224
225
226 (i) To mark all the mounts under /mnt as shared execute the following
227 command:
228
229 smount /mnt rshared
230 the corresponding syntax planned for mount command is
231 mount --make-rshared /mnt
232
233 just to mark a mount /mnt as shared, execute the following
234 command:
235 smount /mnt shared
236 the corresponding syntax planned for mount command is
237 mount --make-shared /mnt
238
239 (ii) To mark all the shared mounts under /mnt as slave execute the
240 following
241
242 command:
243 smount /mnt rslave
244 the corresponding syntax planned for mount command is
245 mount --make-rslave /mnt
246
247 just to mark a mount /mnt as slave, execute the following
248 command:
249 smount /mnt slave
250 the corresponding syntax planned for mount command is
251 mount --make-slave /mnt
252
253 (iii) To mark all the mounts under /mnt as private execute the
254 following command:
255
256 smount /mnt rprivate
257 the corresponding syntax planned for mount command is
258 mount --make-rprivate /mnt
259
260 just to mark a mount /mnt as private, execute the following
261 command:
262 smount /mnt private
263 the corresponding syntax planned for mount command is
264 mount --make-private /mnt
265
266 NOTE: by default all the mounts are created as private. But if
267 you want to change some shared/slave/unbindable mount as
268 private at a later point in time, this command can help.
269
270 (iv) To mark all the mounts under /mnt as unbindable execute the
271 following
272
273 command:
274 smount /mnt runbindable
275 the corresponding syntax planned for mount command is
276 mount --make-runbindable /mnt
277
278 just to mark a mount /mnt as unbindable, execute the following
279 command:
280 smount /mnt unbindable
281 the corresponding syntax planned for mount command is
282 mount --make-unbindable /mnt
283 147
284 148
2854) Use cases 1494) Use cases
@@ -350,7 +214,7 @@ replicas continue to be exactly same.
350 mount --rbind / /view/v3 214 mount --rbind / /view/v3
351 mount --rbind / /view/v4 215 mount --rbind / /view/v4
352 216
353 and if /usr has a versioning filesystem mounted, than that 217 and if /usr has a versioning filesystem mounted, then that
354 mount appears at /view/v1/usr, /view/v2/usr, /view/v3/usr and 218 mount appears at /view/v1/usr, /view/v2/usr, /view/v3/usr and
355 /view/v4/usr too 219 /view/v4/usr too
356 220
@@ -390,7 +254,7 @@ replicas continue to be exactly same.
390 254
391 For example: 255 For example:
392 mount --make-shared /mnt 256 mount --make-shared /mnt
393 mount --bin /mnt /tmp 257 mount --bind /mnt /tmp
394 258
395 The mount at /mnt and that at /tmp are both shared and belong 259 The mount at /mnt and that at /tmp are both shared and belong
396 to the same peer group. Anything mounted or unmounted under 260 to the same peer group. Anything mounted or unmounted under
@@ -558,7 +422,7 @@ replicas continue to be exactly same.
558 then the subtree under the unbindable mount is pruned in the new 422 then the subtree under the unbindable mount is pruned in the new
559 location. 423 location.
560 424
561 eg: lets say we have the following mount tree. 425 eg: let's say we have the following mount tree.
562 426
563 A 427 A
564 / \ 428 / \
@@ -566,7 +430,7 @@ replicas continue to be exactly same.
566 / \ / \ 430 / \ / \
567 D E F G 431 D E F G
568 432
569 Lets say all the mount except the mount C in the tree are 433 Let's say all the mount except the mount C in the tree are
570 of a type other than unbindable. 434 of a type other than unbindable.
571 435
572 If this tree is rbound to say Z 436 If this tree is rbound to say Z
@@ -683,13 +547,13 @@ replicas continue to be exactly same.
683 'b' on mounts that receive propagation from mount 'B' and does not have 547 'b' on mounts that receive propagation from mount 'B' and does not have
684 sub-mounts within them are unmounted. 548 sub-mounts within them are unmounted.
685 549
686 Example: Lets say 'B1', 'B2', 'B3' are shared mounts that propagate to 550 Example: Let's say 'B1', 'B2', 'B3' are shared mounts that propagate to
687 each other. 551 each other.
688 552
689 lets say 'A1', 'A2', 'A3' are first mounted at dentry 'b' on mount 553 let's say 'A1', 'A2', 'A3' are first mounted at dentry 'b' on mount
690 'B1', 'B2' and 'B3' respectively. 554 'B1', 'B2' and 'B3' respectively.
691 555
692 lets say 'C1', 'C2', 'C3' are next mounted at the same dentry 'b' on 556 let's say 'C1', 'C2', 'C3' are next mounted at the same dentry 'b' on
693 mount 'B1', 'B2' and 'B3' respectively. 557 mount 'B1', 'B2' and 'B3' respectively.
694 558
695 if 'C1' is unmounted, all the mounts that are most-recently-mounted on 559 if 'C1' is unmounted, all the mounts that are most-recently-mounted on
@@ -710,7 +574,7 @@ replicas continue to be exactly same.
710 A cloned namespace contains all the mounts as that of the parent 574 A cloned namespace contains all the mounts as that of the parent
711 namespace. 575 namespace.
712 576
713 Lets say 'A' and 'B' are the corresponding mounts in the parent and the 577 Let's say 'A' and 'B' are the corresponding mounts in the parent and the
714 child namespace. 578 child namespace.
715 579
716 If 'A' is shared, then 'B' is also shared and 'A' and 'B' propagate to 580 If 'A' is shared, then 'B' is also shared and 'A' and 'B' propagate to
@@ -759,11 +623,11 @@ replicas continue to be exactly same.
759 mount --make-slave /mnt 623 mount --make-slave /mnt
760 624
761 At this point we have the first mount at /tmp and 625 At this point we have the first mount at /tmp and
762 its root dentry is 1. Lets call this mount 'A' 626 its root dentry is 1. Let's call this mount 'A'
763 And then we have a second mount at /tmp1 with root 627 And then we have a second mount at /tmp1 with root
764 dentry 2. Lets call this mount 'B' 628 dentry 2. Let's call this mount 'B'
765 Next we have a third mount at /mnt with root dentry 629 Next we have a third mount at /mnt with root dentry
766 mnt. Lets call this mount 'C' 630 mnt. Let's call this mount 'C'
767 631
768 'B' is the slave of 'A' and 'C' is a slave of 'B' 632 'B' is the slave of 'A' and 'C' is a slave of 'B'
769 A -> B -> C 633 A -> B -> C
@@ -794,7 +658,7 @@ replicas continue to be exactly same.
794 658
795 Q3 Why is unbindable mount needed? 659 Q3 Why is unbindable mount needed?
796 660
797 Lets say we want to replicate the mount tree at multiple 661 Let's say we want to replicate the mount tree at multiple
798 locations within the same subtree. 662 locations within the same subtree.
799 663
800 if one rbind mounts a tree within the same subtree 'n' times 664 if one rbind mounts a tree within the same subtree 'n' times
@@ -803,7 +667,7 @@ replicas continue to be exactly same.
803 mounts. Here is a example. 667 mounts. Here is a example.
804 668
805 step 1: 669 step 1:
806 lets say the root tree has just two directories with 670 let's say the root tree has just two directories with
807 one vfsmount. 671 one vfsmount.
808 root 672 root
809 / \ 673 / \
@@ -875,7 +739,7 @@ replicas continue to be exactly same.
875 Unclonable mounts come in handy here. 739 Unclonable mounts come in handy here.
876 740
877 step 1: 741 step 1:
878 lets say the root tree has just two directories with 742 let's say the root tree has just two directories with
879 one vfsmount. 743 one vfsmount.
880 root 744 root
881 / \ 745 / \
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt
index b58b84b50fa2..eed520fd0c8e 100644
--- a/Documentation/filesystems/vfat.txt
+++ b/Documentation/filesystems/vfat.txt
@@ -102,7 +102,7 @@ shortname=lower|win95|winnt|mixed
102 winnt: emulate the Windows NT rule for display/create. 102 winnt: emulate the Windows NT rule for display/create.
103 mixed: emulate the Windows NT rule for display, 103 mixed: emulate the Windows NT rule for display,
104 emulate the Windows 95 rule for create. 104 emulate the Windows 95 rule for create.
105 Default setting is `lower'. 105 Default setting is `mixed'.
106 106
107tz=UTC -- Interpret timestamps as UTC rather than local time. 107tz=UTC -- Interpret timestamps as UTC rather than local time.
108 This option disables the conversion of timestamps 108 This option disables the conversion of timestamps
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index f49eecf2e573..623f094c9d8d 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -536,6 +536,7 @@ struct address_space_operations {
536 /* migrate the contents of a page to the specified target */ 536 /* migrate the contents of a page to the specified target */
537 int (*migratepage) (struct page *, struct page *); 537 int (*migratepage) (struct page *, struct page *);
538 int (*launder_page) (struct page *); 538 int (*launder_page) (struct page *);
539 int (*error_remove_page) (struct mapping *mapping, struct page *page);
539}; 540};
540 541
541 writepage: called by the VM to write a dirty page to backing store. 542 writepage: called by the VM to write a dirty page to backing store.
@@ -694,6 +695,12 @@ struct address_space_operations {
694 prevent redirtying the page, it is kept locked during the whole 695 prevent redirtying the page, it is kept locked during the whole
695 operation. 696 operation.
696 697
698 error_remove_page: normally set to generic_error_remove_page if truncation
699 is ok for this address space. Used for memory failure handling.
700 Setting this implies you deal with pages going away under you,
701 unless you have them locked or reference counts increased.
702
703
697The File Object 704The File Object
698=============== 705===============
699 706
diff --git a/Documentation/flexible-arrays.txt b/Documentation/flexible-arrays.txt
index 84eb26808dee..cb8a3a00cc92 100644
--- a/Documentation/flexible-arrays.txt
+++ b/Documentation/flexible-arrays.txt
@@ -1,5 +1,5 @@
1Using flexible arrays in the kernel 1Using flexible arrays in the kernel
2Last updated for 2.6.31 2Last updated for 2.6.32
3Jonathan Corbet <corbet@lwn.net> 3Jonathan Corbet <corbet@lwn.net>
4 4
5Large contiguous memory allocations can be unreliable in the Linux kernel. 5Large contiguous memory allocations can be unreliable in the Linux kernel.
@@ -40,6 +40,13 @@ argument is passed directly to the internal memory allocation calls. With
40the current code, using flags to ask for high memory is likely to lead to 40the current code, using flags to ask for high memory is likely to lead to
41notably unpleasant side effects. 41notably unpleasant side effects.
42 42
43It is also possible to define flexible arrays at compile time with:
44
45 DEFINE_FLEX_ARRAY(name, element_size, total);
46
47This macro will result in a definition of an array with the given name; the
48element size and total will be checked for validity at compile time.
49
43Storing data into a flexible array is accomplished with a call to: 50Storing data into a flexible array is accomplished with a call to:
44 51
45 int flex_array_put(struct flex_array *array, unsigned int element_nr, 52 int flex_array_put(struct flex_array *array, unsigned int element_nr,
@@ -76,16 +83,30 @@ particular element has never been allocated.
76Note that it is possible to get back a valid pointer for an element which 83Note that it is possible to get back a valid pointer for an element which
77has never been stored in the array. Memory for array elements is allocated 84has never been stored in the array. Memory for array elements is allocated
78one page at a time; a single allocation could provide memory for several 85one page at a time; a single allocation could provide memory for several
79adjacent elements. The flexible array code does not know if a specific 86adjacent elements. Flexible array elements are normally initialized to the
80element has been written; it only knows if the associated memory is 87value FLEX_ARRAY_FREE (defined as 0x6c in <linux/poison.h>), so errors
81present. So a flex_array_get() call on an element which was never stored 88involving that number probably result from use of unstored array entries.
82in the array has the potential to return a pointer to random data. If the 89Note that, if array elements are allocated with __GFP_ZERO, they will be
83caller does not have a separate way to know which elements were actually 90initialized to zero and this poisoning will not happen.
84stored, it might be wise, at least, to add GFP_ZERO to the flags argument 91
85to ensure that all elements are zeroed. 92Individual elements in the array can be cleared with:
86 93
87There is no way to remove a single element from the array. It is possible, 94 int flex_array_clear(struct flex_array *array, unsigned int element_nr);
88though, to remove all elements with a call to: 95
96This function will set the given element to FLEX_ARRAY_FREE and return
97zero. If storage for the indicated element is not allocated for the array,
98flex_array_clear() will return -EINVAL instead. Note that clearing an
99element does not release the storage associated with it; to reduce the
100allocated size of an array, call:
101
102 int flex_array_shrink(struct flex_array *array);
103
104The return value will be the number of pages of memory actually freed.
105This function works by scanning the array for pages containing nothing but
106FLEX_ARRAY_FREE bytes, so (1) it can be expensive, and (2) it will not work
107if the array's pages are allocated with __GFP_ZERO.
108
109It is possible to remove all elements of an array with a call to:
89 110
90 void flex_array_free_parts(struct flex_array *array); 111 void flex_array_free_parts(struct flex_array *array);
91 112
diff --git a/Documentation/hwmon/coretemp b/Documentation/hwmon/coretemp
index dbbe6c7025b0..92267b62db59 100644
--- a/Documentation/hwmon/coretemp
+++ b/Documentation/hwmon/coretemp
@@ -4,7 +4,9 @@ Kernel driver coretemp
4Supported chips: 4Supported chips:
5 * All Intel Core family 5 * All Intel Core family
6 Prefix: 'coretemp' 6 Prefix: 'coretemp'
7 CPUID: family 0x6, models 0xe, 0xf, 0x16, 0x17 7 CPUID: family 0x6, models 0xe (Pentium M DC), 0xf (Core 2 DC 65nm),
8 0x16 (Core 2 SC 65nm), 0x17 (Penryn 45nm),
9 0x1a (Nehalem), 0x1c (Atom), 0x1e (Lynnfield)
8 Datasheet: Intel 64 and IA-32 Architectures Software Developer's Manual 10 Datasheet: Intel 64 and IA-32 Architectures Software Developer's Manual
9 Volume 3A: System Programming Guide 11 Volume 3A: System Programming Guide
10 http://softwarecommunity.intel.com/Wiki/Mobility/720.htm 12 http://softwarecommunity.intel.com/Wiki/Mobility/720.htm
diff --git a/Documentation/hwmon/fscher b/Documentation/hwmon/fscher
deleted file mode 100644
index 64031659aff3..000000000000
--- a/Documentation/hwmon/fscher
+++ /dev/null
@@ -1,169 +0,0 @@
1Kernel driver fscher
2====================
3
4Supported chips:
5 * Fujitsu-Siemens Hermes chip
6 Prefix: 'fscher'
7 Addresses scanned: I2C 0x73
8
9Authors:
10 Reinhard Nissl <rnissl@gmx.de> based on work
11 from Hermann Jung <hej@odn.de>,
12 Frodo Looijaard <frodol@dds.nl>,
13 Philip Edelbrock <phil@netroedge.com>
14
15Description
16-----------
17
18This driver implements support for the Fujitsu-Siemens Hermes chip. It is
19described in the 'Register Set Specification BMC Hermes based Systemboard'
20from Fujitsu-Siemens.
21
22The Hermes chip implements a hardware-based system management, e.g. for
23controlling fan speed and core voltage. There is also a watchdog counter on
24the chip which can trigger an alarm and even shut the system down.
25
26The chip provides three temperature values (CPU, motherboard and
27auxiliary), three voltage values (+12V, +5V and battery) and three fans
28(power supply, CPU and auxiliary).
29
30Temperatures are measured in degrees Celsius. The resolution is 1 degree.
31
32Fan rotation speeds are reported in RPM (rotations per minute). The value
33can be divided by a programmable divider (1, 2 or 4) which is stored on
34the chip.
35
36Voltage sensors (also known as "in" sensors) report their values in volts.
37
38All values are reported as final values from the driver. There is no need
39for further calculations.
40
41
42Detailed description
43--------------------
44
45Below you'll find a single line description of all the bit values. With
46this information, you're able to decode e. g. alarms, wdog, etc. To make
47use of the watchdog, you'll need to set the watchdog time and enable the
48watchdog. After that it is necessary to restart the watchdog time within
49the specified period of time, or a system reset will occur.
50
51* revision
52 READING & 0xff = 0x??: HERMES revision identification
53
54* alarms
55 READING & 0x80 = 0x80: CPU throttling active
56 READING & 0x80 = 0x00: CPU running at full speed
57
58 READING & 0x10 = 0x10: software event (see control:1)
59 READING & 0x10 = 0x00: no software event
60
61 READING & 0x08 = 0x08: watchdog event (see wdog:2)
62 READING & 0x08 = 0x00: no watchdog event
63
64 READING & 0x02 = 0x02: thermal event (see temp*:1)
65 READING & 0x02 = 0x00: no thermal event
66
67 READING & 0x01 = 0x01: fan event (see fan*:1)
68 READING & 0x01 = 0x00: no fan event
69
70 READING & 0x13 ! 0x00: ALERT LED is flashing
71
72* control
73 READING & 0x01 = 0x01: software event
74 READING & 0x01 = 0x00: no software event
75
76 WRITING & 0x01 = 0x01: set software event
77 WRITING & 0x01 = 0x00: clear software event
78
79* watchdog_control
80 READING & 0x80 = 0x80: power off on watchdog event while thermal event
81 READING & 0x80 = 0x00: watchdog power off disabled (just system reset enabled)
82
83 READING & 0x40 = 0x40: watchdog timebase 60 seconds (see also wdog:1)
84 READING & 0x40 = 0x00: watchdog timebase 2 seconds
85
86 READING & 0x10 = 0x10: watchdog enabled
87 READING & 0x10 = 0x00: watchdog disabled
88
89 WRITING & 0x80 = 0x80: enable "power off on watchdog event while thermal event"
90 WRITING & 0x80 = 0x00: disable "power off on watchdog event while thermal event"
91
92 WRITING & 0x40 = 0x40: set watchdog timebase to 60 seconds
93 WRITING & 0x40 = 0x00: set watchdog timebase to 2 seconds
94
95 WRITING & 0x20 = 0x20: disable watchdog
96
97 WRITING & 0x10 = 0x10: enable watchdog / restart watchdog time
98
99* watchdog_state
100 READING & 0x02 = 0x02: watchdog system reset occurred
101 READING & 0x02 = 0x00: no watchdog system reset occurred
102
103 WRITING & 0x02 = 0x02: clear watchdog event
104
105* watchdog_preset
106 READING & 0xff = 0x??: configured watch dog time in units (see wdog:3 0x40)
107
108 WRITING & 0xff = 0x??: configure watch dog time in units
109
110* in* (0: +5V, 1: +12V, 2: onboard 3V battery)
111 READING: actual voltage value
112
113* temp*_status (1: CPU sensor, 2: onboard sensor, 3: auxiliary sensor)
114 READING & 0x02 = 0x02: thermal event (overtemperature)
115 READING & 0x02 = 0x00: no thermal event
116
117 READING & 0x01 = 0x01: sensor is working
118 READING & 0x01 = 0x00: sensor is faulty
119
120 WRITING & 0x02 = 0x02: clear thermal event
121
122* temp*_input (1: CPU sensor, 2: onboard sensor, 3: auxiliary sensor)
123 READING: actual temperature value
124
125* fan*_status (1: power supply fan, 2: CPU fan, 3: auxiliary fan)
126 READING & 0x04 = 0x04: fan event (fan fault)
127 READING & 0x04 = 0x00: no fan event
128
129 WRITING & 0x04 = 0x04: clear fan event
130
131* fan*_div (1: power supply fan, 2: CPU fan, 3: auxiliary fan)
132 Divisors 2,4 and 8 are supported, both for reading and writing
133
134* fan*_pwm (1: power supply fan, 2: CPU fan, 3: auxiliary fan)
135 READING & 0xff = 0x00: fan may be switched off
136 READING & 0xff = 0x01: fan must run at least at minimum speed (supply: 6V)
137 READING & 0xff = 0xff: fan must run at maximum speed (supply: 12V)
138 READING & 0xff = 0x??: fan must run at least at given speed (supply: 6V..12V)
139
140 WRITING & 0xff = 0x00: fan may be switched off
141 WRITING & 0xff = 0x01: fan must run at least at minimum speed (supply: 6V)
142 WRITING & 0xff = 0xff: fan must run at maximum speed (supply: 12V)
143 WRITING & 0xff = 0x??: fan must run at least at given speed (supply: 6V..12V)
144
145* fan*_input (1: power supply fan, 2: CPU fan, 3: auxiliary fan)
146 READING: actual RPM value
147
148
149Limitations
150-----------
151
152* Measuring fan speed
153It seems that the chip counts "ripples" (typical fans produce 2 ripples per
154rotation while VERAX fans produce 18) in a 9-bit register. This register is
155read out every second, then the ripple prescaler (2, 4 or 8) is applied and
156the result is stored in the 8 bit output register. Due to the limitation of
157the counting register to 9 bits, it is impossible to measure a VERAX fan
158properly (even with a prescaler of 8). At its maximum speed of 3500 RPM the
159fan produces 1080 ripples per second which causes the counting register to
160overflow twice, leading to only 186 RPM.
161
162* Measuring input voltages
163in2 ("battery") reports the voltage of the onboard lithium battery and not
164+3.3V from the power supply.
165
166* Undocumented features
167Fujitsu-Siemens Computers has not documented all features of the chip so
168far. Their software, System Guard, shows that there are a still some
169features which cannot be controlled by this implementation.
diff --git a/Documentation/hwmon/ltc4215 b/Documentation/hwmon/ltc4215
index 2e6a21eb656c..c196a1846259 100644
--- a/Documentation/hwmon/ltc4215
+++ b/Documentation/hwmon/ltc4215
@@ -22,12 +22,13 @@ Usage Notes
22----------- 22-----------
23 23
24This driver does not probe for LTC4215 devices, due to the fact that some 24This driver does not probe for LTC4215 devices, due to the fact that some
25of the possible addresses are unfriendly to probing. You will need to use 25of the possible addresses are unfriendly to probing. You will have to
26the "force" parameter to tell the driver where to find the device. 26instantiate the devices explicitly.
27 27
28Example: the following will load the driver for an LTC4215 at address 0x44 28Example: the following will load the driver for an LTC4215 at address 0x44
29on I2C bus #0: 29on I2C bus #0:
30$ modprobe ltc4215 force=0,0x44 30$ modprobe ltc4215
31$ echo ltc4215 0x44 > /sys/bus/i2c/devices/i2c-0/new_device
31 32
32 33
33Sysfs entries 34Sysfs entries
diff --git a/Documentation/hwmon/ltc4245 b/Documentation/hwmon/ltc4245
index bae7a3adc5d8..02838a47d862 100644
--- a/Documentation/hwmon/ltc4245
+++ b/Documentation/hwmon/ltc4245
@@ -23,12 +23,13 @@ Usage Notes
23----------- 23-----------
24 24
25This driver does not probe for LTC4245 devices, due to the fact that some 25This driver does not probe for LTC4245 devices, due to the fact that some
26of the possible addresses are unfriendly to probing. You will need to use 26of the possible addresses are unfriendly to probing. You will have to
27the "force" parameter to tell the driver where to find the device. 27instantiate the devices explicitly.
28 28
29Example: the following will load the driver for an LTC4245 at address 0x23 29Example: the following will load the driver for an LTC4245 at address 0x23
30on I2C bus #1: 30on I2C bus #1:
31$ modprobe ltc4245 force=1,0x23 31$ modprobe ltc4245
32$ echo ltc4245 0x23 > /sys/bus/i2c/devices/i2c-1/new_device
32 33
33 34
34Sysfs entries 35Sysfs entries
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices
index c740b7b41088..e89490270aba 100644
--- a/Documentation/i2c/instantiating-devices
+++ b/Documentation/i2c/instantiating-devices
@@ -188,7 +188,7 @@ segment, the address is sufficient to uniquely identify the device to be
188deleted. 188deleted.
189 189
190Example: 190Example:
191# echo eeprom 0x50 > /sys/class/i2c-adapter/i2c-3/new_device 191# echo eeprom 0x50 > /sys/bus/i2c/devices/i2c-3/new_device
192 192
193While this interface should only be used when in-kernel device declaration 193While this interface should only be used when in-kernel device declaration
194can't be done, there is a variety of cases where it can be helpful: 194can't be done, there is a variety of cases where it can be helpful:
diff --git a/Documentation/infiniband/user_mad.txt b/Documentation/infiniband/user_mad.txt
index 744687dd195b..8a366959f5cc 100644
--- a/Documentation/infiniband/user_mad.txt
+++ b/Documentation/infiniband/user_mad.txt
@@ -128,8 +128,8 @@ Setting IsSM Capability Bit
128 To create the appropriate character device files automatically with 128 To create the appropriate character device files automatically with
129 udev, a rule like 129 udev, a rule like
130 130
131 KERNEL="umad*", NAME="infiniband/%k" 131 KERNEL=="umad*", NAME="infiniband/%k"
132 KERNEL="issm*", NAME="infiniband/%k" 132 KERNEL=="issm*", NAME="infiniband/%k"
133 133
134 can be used. This will create device nodes named 134 can be used. This will create device nodes named
135 135
diff --git a/Documentation/infiniband/user_verbs.txt b/Documentation/infiniband/user_verbs.txt
index f847501e50b5..afe3f8da9018 100644
--- a/Documentation/infiniband/user_verbs.txt
+++ b/Documentation/infiniband/user_verbs.txt
@@ -58,7 +58,7 @@ Memory pinning
58 To create the appropriate character device files automatically with 58 To create the appropriate character device files automatically with
59 udev, a rule like 59 udev, a rule like
60 60
61 KERNEL="uverbs*", NAME="infiniband/%k" 61 KERNEL=="uverbs*", NAME="infiniband/%k"
62 62
63 can be used. This will create device nodes named 63 can be used. This will create device nodes named
64 64
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
index aafca0a8f66a..947374977ca5 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -135,6 +135,7 @@ Code Seq# Include File Comments
135 <http://mikonos.dia.unisa.it/tcfs> 135 <http://mikonos.dia.unisa.it/tcfs>
136'l' 40-7F linux/udf_fs_i.h in development: 136'l' 40-7F linux/udf_fs_i.h in development:
137 <http://sourceforge.net/projects/linux-udf/> 137 <http://sourceforge.net/projects/linux-udf/>
138'm' 00-09 linux/mmtimer.h
138'm' all linux/mtio.h conflict! 139'm' all linux/mtio.h conflict!
139'm' all linux/soundcard.h conflict! 140'm' all linux/soundcard.h conflict!
140'm' all linux/synclink.h conflict! 141'm' all linux/synclink.h conflict!
diff --git a/Documentation/isdn/INTERFACE.CAPI b/Documentation/isdn/INTERFACE.CAPI
index 686e107923ec..5fe8de5cc727 100644
--- a/Documentation/isdn/INTERFACE.CAPI
+++ b/Documentation/isdn/INTERFACE.CAPI
@@ -60,10 +60,9 @@ open() operation on regular files or character devices.
60 60
61After a successful return from register_appl(), CAPI messages from the 61After a successful return from register_appl(), CAPI messages from the
62application may be passed to the driver for the device via calls to the 62application may be passed to the driver for the device via calls to the
63send_message() callback function. The CAPI message to send is stored in the 63send_message() callback function. Conversely, the driver may call Kernel
64data portion of an skb. Conversely, the driver may call Kernel CAPI's 64CAPI's capi_ctr_handle_message() function to pass a received CAPI message to
65capi_ctr_handle_message() function to pass a received CAPI message to Kernel 65Kernel CAPI for forwarding to an application, specifying its ApplID.
66CAPI for forwarding to an application, specifying its ApplID.
67 66
68Deregistration requests (CAPI operation CAPI_RELEASE) from applications are 67Deregistration requests (CAPI operation CAPI_RELEASE) from applications are
69forwarded as calls to the release_appl() callback function, passing the same 68forwarded as calls to the release_appl() callback function, passing the same
@@ -142,6 +141,7 @@ u16 (*send_message)(struct capi_ctr *ctrlr, struct sk_buff *skb)
142 to accepting or queueing the message. Errors occurring during the 141 to accepting or queueing the message. Errors occurring during the
143 actual processing of the message should be signaled with an 142 actual processing of the message should be signaled with an
144 appropriate reply message. 143 appropriate reply message.
144 May be called in process or interrupt context.
145 Calls to this function are not serialized by Kernel CAPI, ie. it must 145 Calls to this function are not serialized by Kernel CAPI, ie. it must
146 be prepared to be re-entered. 146 be prepared to be re-entered.
147 147
@@ -154,7 +154,8 @@ read_proc_t *ctr_read_proc
154 system entry, /proc/capi/controllers/<n>; will be called with a 154 system entry, /proc/capi/controllers/<n>; will be called with a
155 pointer to the device's capi_ctr structure as the last (data) argument 155 pointer to the device's capi_ctr structure as the last (data) argument
156 156
157Note: Callback functions are never called in interrupt context. 157Note: Callback functions except send_message() are never called in interrupt
158context.
158 159
159- to be filled in before calling capi_ctr_ready(): 160- to be filled in before calling capi_ctr_ready():
160 161
@@ -171,14 +172,40 @@ u8 serial[CAPI_SERIAL_LEN]
171 value to return for CAPI_GET_SERIAL 172 value to return for CAPI_GET_SERIAL
172 173
173 174
1744.3 The _cmsg Structure 1754.3 SKBs
176
177CAPI messages are passed between Kernel CAPI and the driver via send_message()
178and capi_ctr_handle_message(), stored in the data portion of a socket buffer
179(skb). Each skb contains a single CAPI message coded according to the CAPI 2.0
180standard.
181
182For the data transfer messages, DATA_B3_REQ and DATA_B3_IND, the actual
183payload data immediately follows the CAPI message itself within the same skb.
184The Data and Data64 parameters are not used for processing. The Data64
185parameter may be omitted by setting the length field of the CAPI message to 22
186instead of 30.
187
188
1894.4 The _cmsg Structure
175 190
176(declared in <linux/isdn/capiutil.h>) 191(declared in <linux/isdn/capiutil.h>)
177 192
178The _cmsg structure stores the contents of a CAPI 2.0 message in an easily 193The _cmsg structure stores the contents of a CAPI 2.0 message in an easily
179accessible form. It contains members for all possible CAPI 2.0 parameters, of 194accessible form. It contains members for all possible CAPI 2.0 parameters,
180which only those appearing in the message type currently being processed are 195including subparameters of the Additional Info and B Protocol structured
181actually used. Unused members should be set to zero. 196parameters, with the following exceptions:
197
198* second Calling party number (CONNECT_IND)
199
200* Data64 (DATA_B3_REQ and DATA_B3_IND)
201
202* Sending complete (subparameter of Additional Info, CONNECT_REQ and INFO_REQ)
203
204* Global Configuration (subparameter of B Protocol, CONNECT_REQ, CONNECT_RESP
205 and SELECT_B_PROTOCOL_REQ)
206
207Only those parameters appearing in the message type currently being processed
208are actually used. Unused members should be set to zero.
182 209
183Members are named after the CAPI 2.0 standard names of the parameters they 210Members are named after the CAPI 2.0 standard names of the parameters they
184represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data 211represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data
@@ -190,18 +217,19 @@ u16 for CAPI parameters of type 'word'
190 217
191u32 for CAPI parameters of type 'dword' 218u32 for CAPI parameters of type 'dword'
192 219
193_cstruct for CAPI parameters of type 'struct' not containing any 220_cstruct for CAPI parameters of type 'struct'
194 variably-sized (struct) subparameters (eg. 'Called Party Number')
195 The member is a pointer to a buffer containing the parameter in 221 The member is a pointer to a buffer containing the parameter in
196 CAPI encoding (length + content). It may also be NULL, which will 222 CAPI encoding (length + content). It may also be NULL, which will
197 be taken to represent an empty (zero length) parameter. 223 be taken to represent an empty (zero length) parameter.
224 Subparameters are stored in encoded form within the content part.
198 225
199_cmstruct for CAPI parameters of type 'struct' containing 'struct' 226_cmstruct alternative representation for CAPI parameters of type 'struct'
200 subparameters ('Additional Info' and 'B Protocol') 227 (used only for the 'Additional Info' and 'B Protocol' parameters)
201 The representation is a single byte containing one of the values: 228 The representation is a single byte containing one of the values:
202 CAPI_DEFAULT: the parameter is empty 229 CAPI_DEFAULT: The parameter is empty/absent.
203 CAPI_COMPOSE: the values of the subparameters are stored 230 CAPI_COMPOSE: The parameter is present.
204 individually in the corresponding _cmsg structure members 231 Subparameter values are stored individually in the corresponding
232 _cmsg structure members.
205 233
206Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert 234Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert
207messages between their transport encoding described in the CAPI 2.0 standard 235messages between their transport encoding described in the CAPI 2.0 standard
@@ -297,3 +325,26 @@ char *capi_cmd2str(u8 Command, u8 Subcommand)
297 be NULL if the command/subcommand is not one of those defined in the 325 be NULL if the command/subcommand is not one of those defined in the
298 CAPI 2.0 standard. 326 CAPI 2.0 standard.
299 327
328
3297. Debugging
330
331The module kernelcapi has a module parameter showcapimsgs controlling some
332debugging output produced by the module. It can only be set when the module is
333loaded, via a parameter "showcapimsgs=<n>" to the modprobe command, either on
334the command line or in the configuration file.
335
336If the lowest bit of showcapimsgs is set, kernelcapi logs controller and
337application up and down events.
338
339In addition, every registered CAPI controller has an associated traceflag
340parameter controlling how CAPI messages sent from and to tha controller are
341logged. The traceflag parameter is initialized with the value of the
342showcapimsgs parameter when the controller is registered, but can later be
343changed via the MANUFACTURER_REQ command KCAPI_CMD_TRACE.
344
345If the value of traceflag is non-zero, CAPI messages are logged.
346DATA_B3 messages are only logged if the value of traceflag is > 2.
347
348If the lowest bit of traceflag is set, only the command/subcommand and message
349length are logged. Otherwise, kernelcapi logs a readable representation of
350the entire message.
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index f3355b6812df..bb3bf38f03da 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -65,6 +65,22 @@ INSTALL_PATH
65INSTALL_PATH specifies where to place the updated kernel and system map 65INSTALL_PATH specifies where to place the updated kernel and system map
66images. Default is /boot, but you can set it to other values. 66images. Default is /boot, but you can set it to other values.
67 67
68INSTALLKERNEL
69--------------------------------------------------
70Install script called when using "make install".
71The default name is "installkernel".
72
73The script will be called with the following arguments:
74 $1 - kernel version
75 $2 - kernel image file
76 $3 - kernel map file
77 $4 - default install path (use root directory if blank)
78
79The implmentation of "make install" is architecture specific
80and it may differ from the above.
81
82INSTALLKERNEL is provided to enable the possibility to
83specify a custom installer when cross compiling a kernel.
68 84
69MODLIB 85MODLIB
70-------------------------------------------------- 86--------------------------------------------------
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index d76cfd8712e1..71c602d61680 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -18,6 +18,7 @@ This document describes the Linux kernel Makefiles.
18 --- 3.9 Dependency tracking 18 --- 3.9 Dependency tracking
19 --- 3.10 Special Rules 19 --- 3.10 Special Rules
20 --- 3.11 $(CC) support functions 20 --- 3.11 $(CC) support functions
21 --- 3.12 $(LD) support functions
21 22
22 === 4 Host Program support 23 === 4 Host Program support
23 --- 4.1 Simple Host Program 24 --- 4.1 Simple Host Program
@@ -435,14 +436,14 @@ more details, with real examples.
435 The second argument is optional, and if supplied will be used 436 The second argument is optional, and if supplied will be used
436 if first argument is not supported. 437 if first argument is not supported.
437 438
438 ld-option 439 cc-ldoption
439 ld-option is used to check if $(CC) when used to link object files 440 cc-ldoption is used to check if $(CC) when used to link object files
440 supports the given option. An optional second option may be 441 supports the given option. An optional second option may be
441 specified if first option are not supported. 442 specified if first option are not supported.
442 443
443 Example: 444 Example:
444 #arch/i386/kernel/Makefile 445 #arch/i386/kernel/Makefile
445 vsyscall-flags += $(call ld-option, -Wl$(comma)--hash-style=sysv) 446 vsyscall-flags += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
446 447
447 In the above example, vsyscall-flags will be assigned the option 448 In the above example, vsyscall-flags will be assigned the option
448 -Wl$(comma)--hash-style=sysv if it is supported by $(CC). 449 -Wl$(comma)--hash-style=sysv if it is supported by $(CC).
@@ -570,6 +571,19 @@ more details, with real examples.
570 endif 571 endif
571 endif 572 endif
572 573
574--- 3.12 $(LD) support functions
575
576 ld-option
577 ld-option is used to check if $(LD) supports the supplied option.
578 ld-option takes two options as arguments.
579 The second argument is an optional option that can be used if the
580 first option is not supported by $(LD).
581
582 Example:
583 #Makefile
584 LDFLAGS_vmlinux += $(call really-ld-option, -X)
585
586
573=== 4 Host Program support 587=== 4 Host Program support
574 588
575Kbuild supports building executables on the host for use during the 589Kbuild supports building executables on the host for use during the
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 6fa7292947e5..9107b387e91f 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -671,6 +671,7 @@ and is between 256 and 4096 characters. It is defined in the file
671 earlyprintk= [X86,SH,BLACKFIN] 671 earlyprintk= [X86,SH,BLACKFIN]
672 earlyprintk=vga 672 earlyprintk=vga
673 earlyprintk=serial[,ttySn[,baudrate]] 673 earlyprintk=serial[,ttySn[,baudrate]]
674 earlyprintk=ttySn[,baudrate]
674 earlyprintk=dbgp[debugController#] 675 earlyprintk=dbgp[debugController#]
675 676
676 Append ",keep" to not disable it when the real console 677 Append ",keep" to not disable it when the real console
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 6d03487ef1c7..aafcaa634191 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -199,18 +199,22 @@ kind to allow it (and it often doesn't!).
199 199
200Not all bits in the mask can be modified. Not all bits that can be 200Not all bits in the mask can be modified. Not all bits that can be
201modified do anything. Not all hot keys can be individually controlled 201modified do anything. Not all hot keys can be individually controlled
202by the mask. Some models do not support the mask at all, and in those 202by the mask. Some models do not support the mask at all. The behaviour
203models, hot keys cannot be controlled individually. The behaviour of 203of the mask is, therefore, highly dependent on the ThinkPad model.
204the mask is, therefore, highly dependent on the ThinkPad model. 204
205The driver will filter out any unmasked hotkeys, so even if the firmware
206doesn't allow disabling an specific hotkey, the driver will not report
207events for unmasked hotkeys.
205 208
206Note that unmasking some keys prevents their default behavior. For 209Note that unmasking some keys prevents their default behavior. For
207example, if Fn+F5 is unmasked, that key will no longer enable/disable 210example, if Fn+F5 is unmasked, that key will no longer enable/disable
208Bluetooth by itself. 211Bluetooth by itself in firmware.
209 212
210Note also that not all Fn key combinations are supported through ACPI. 213Note also that not all Fn key combinations are supported through ACPI
211For example, on the X40, the brightness, volume and "Access IBM" buttons 214depending on the ThinkPad model and firmware version. On those
212do not generate ACPI events even with this driver. They *can* be used 215ThinkPads, it is still possible to support some extra hotkeys by
213through the "ThinkPad Buttons" utility, see http://www.nongnu.org/tpb/ 216polling the "CMOS NVRAM" at least 10 times per second. The driver
217attempts to enables this functionality automatically when required.
214 218
215procfs notes: 219procfs notes:
216 220
@@ -255,18 +259,11 @@ sysfs notes:
255 1: does nothing 259 1: does nothing
256 260
257 hotkey_mask: 261 hotkey_mask:
258 bit mask to enable driver-handling (and depending on 262 bit mask to enable reporting (and depending on
259 the firmware, ACPI event generation) for each hot key 263 the firmware, ACPI event generation) for each hot key
260 (see above). Returns the current status of the hot keys 264 (see above). Returns the current status of the hot keys
261 mask, and allows one to modify it. 265 mask, and allows one to modify it.
262 266
263 Note: when NVRAM polling is active, the firmware mask
264 will be different from the value returned by
265 hotkey_mask. The driver will retain enabled bits for
266 hotkeys that are under NVRAM polling even if the
267 firmware refuses them, and will not set these bits on
268 the firmware hot key mask.
269
270 hotkey_all_mask: 267 hotkey_all_mask:
271 bit mask that should enable event reporting for all 268 bit mask that should enable event reporting for all
272 supported hot keys, when echoed to hotkey_mask above. 269 supported hot keys, when echoed to hotkey_mask above.
@@ -279,7 +276,8 @@ sysfs notes:
279 bit mask that should enable event reporting for all 276 bit mask that should enable event reporting for all
280 supported hot keys, except those which are always 277 supported hot keys, except those which are always
281 handled by the firmware anyway. Echo it to 278 handled by the firmware anyway. Echo it to
282 hotkey_mask above, to use. 279 hotkey_mask above, to use. This is the default mask
280 used by the driver.
283 281
284 hotkey_source_mask: 282 hotkey_source_mask:
285 bit mask that selects which hot keys will the driver 283 bit mask that selects which hot keys will the driver
@@ -287,9 +285,10 @@ sysfs notes:
287 based on the capabilities reported by the ACPI firmware, 285 based on the capabilities reported by the ACPI firmware,
288 but it can be overridden at runtime. 286 but it can be overridden at runtime.
289 287
290 Hot keys whose bits are set in both hotkey_source_mask 288 Hot keys whose bits are set in hotkey_source_mask are
291 and also on hotkey_mask are polled for in NVRAM. Only a 289 polled for in NVRAM, and reported as hotkey events if
292 few hot keys are available through CMOS NVRAM polling. 290 enabled in hotkey_mask. Only a few hot keys are
291 available through CMOS NVRAM polling.
293 292
294 Warning: when in NVRAM mode, the volume up/down/mute 293 Warning: when in NVRAM mode, the volume up/down/mute
295 keys are synthesized according to changes in the mixer, 294 keys are synthesized according to changes in the mixer,
@@ -525,6 +524,7 @@ compatibility purposes when hotkey_report_mode is set to 1.
5250x2305 System is waking up from suspend to eject bay 5240x2305 System is waking up from suspend to eject bay
5260x2404 System is waking up from hibernation to undock 5250x2404 System is waking up from hibernation to undock
5270x2405 System is waking up from hibernation to eject bay 5260x2405 System is waking up from hibernation to eject bay
5270x5010 Brightness level changed/control event
528 528
529The above events are never propagated by the driver. 529The above events are never propagated by the driver.
530 530
@@ -532,7 +532,6 @@ The above events are never propagated by the driver.
5320x4003 Undocked (see 0x2x04), can sleep again 5320x4003 Undocked (see 0x2x04), can sleep again
5330x500B Tablet pen inserted into its storage bay 5330x500B Tablet pen inserted into its storage bay
5340x500C Tablet pen removed from its storage bay 5340x500C Tablet pen removed from its storage bay
5350x5010 Brightness level changed (newer Lenovo BIOSes)
536 535
537The above events are propagated by the driver. 536The above events are propagated by the driver.
538 537
@@ -621,6 +620,8 @@ For Lenovo models *with* ACPI backlight control:
6212. Do *NOT* load up ACPI video, enable the hotkeys in thinkpad-acpi, 6202. Do *NOT* load up ACPI video, enable the hotkeys in thinkpad-acpi,
622 and map them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN. Process 621 and map them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN. Process
623 these keys on userspace somehow (e.g. by calling xbacklight). 622 these keys on userspace somehow (e.g. by calling xbacklight).
623 The driver will do this automatically if it detects that ACPI video
624 has been disabled.
624 625
625 626
626Bluetooth 627Bluetooth
@@ -1459,3 +1460,8 @@ Sysfs interface changelog:
14590x020400: Marker for 16 LEDs support. Also, LEDs that are known 14600x020400: Marker for 16 LEDs support. Also, LEDs that are known
1460 to not exist in a given model are not registered with 1461 to not exist in a given model are not registered with
1461 the LED sysfs class anymore. 1462 the LED sysfs class anymore.
1463
14640x020500: Updated hotkey driver, hotkey_mask is always available
1465 and it is always able to disable hot keys. Very old
1466 thinkpads are properly supported. hotkey_bios_mask
1467 is deprecated and marked for removal.
diff --git a/Documentation/i2c/chips/eeprom b/Documentation/misc-devices/eeprom
index f7e8104b5764..f7e8104b5764 100644
--- a/Documentation/i2c/chips/eeprom
+++ b/Documentation/misc-devices/eeprom
diff --git a/Documentation/i2c/chips/max6875 b/Documentation/misc-devices/max6875
index 10ca43cd1a72..1e89ee3ccc1b 100644
--- a/Documentation/i2c/chips/max6875
+++ b/Documentation/misc-devices/max6875
@@ -42,10 +42,12 @@ General Remarks
42 42
43Valid addresses for the MAX6875 are 0x50 and 0x52. 43Valid addresses for the MAX6875 are 0x50 and 0x52.
44Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56. 44Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56.
45The driver does not probe any address, so you must force the address. 45The driver does not probe any address, so you explicitly instantiate the
46devices.
46 47
47Example: 48Example:
48$ modprobe max6875 force=0,0x50 49$ modprobe max6875
50$ echo max6875 0x50 > /sys/bus/i2c/devices/i2c-0/new_device
49 51
50The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple 52The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
51addresses. For example, for address 0x50, it also reserves 0x51. 53addresses. For example, for address 0x50, it also reserves 0x51.
diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt
index c6cf4a3c16e0..61bb645d50e0 100644
--- a/Documentation/networking/pktgen.txt
+++ b/Documentation/networking/pktgen.txt
@@ -90,6 +90,11 @@ Examples:
90 pgset "dstmac 00:00:00:00:00:00" sets MAC destination address 90 pgset "dstmac 00:00:00:00:00:00" sets MAC destination address
91 pgset "srcmac 00:00:00:00:00:00" sets MAC source address 91 pgset "srcmac 00:00:00:00:00:00" sets MAC source address
92 92
93 pgset "queue_map_min 0" Sets the min value of tx queue interval
94 pgset "queue_map_max 7" Sets the max value of tx queue interval, for multiqueue devices
95 To select queue 1 of a given device,
96 use queue_map_min=1 and queue_map_max=1
97
93 pgset "src_mac_count 1" Sets the number of MACs we'll range through. 98 pgset "src_mac_count 1" Sets the number of MACs we'll range through.
94 The 'minimum' MAC is what you set with srcmac. 99 The 'minimum' MAC is what you set with srcmac.
95 100
@@ -101,6 +106,9 @@ Examples:
101 IPDST_RND, UDPSRC_RND, 106 IPDST_RND, UDPSRC_RND,
102 UDPDST_RND, MACSRC_RND, MACDST_RND 107 UDPDST_RND, MACSRC_RND, MACDST_RND
103 MPLS_RND, VID_RND, SVID_RND 108 MPLS_RND, VID_RND, SVID_RND
109 QUEUE_MAP_RND # queue map random
110 QUEUE_MAP_CPU # queue map mirrors smp_processor_id()
111
104 112
105 pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then 113 pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then
106 cycle through the port range. 114 cycle through the port range.
diff --git a/Documentation/networking/timestamping/timestamping.c b/Documentation/networking/timestamping/timestamping.c
index 43d143104210..a7936fe8444a 100644
--- a/Documentation/networking/timestamping/timestamping.c
+++ b/Documentation/networking/timestamping/timestamping.c
@@ -381,7 +381,7 @@ int main(int argc, char **argv)
381 memset(&hwtstamp, 0, sizeof(hwtstamp)); 381 memset(&hwtstamp, 0, sizeof(hwtstamp));
382 strncpy(hwtstamp.ifr_name, interface, sizeof(hwtstamp.ifr_name)); 382 strncpy(hwtstamp.ifr_name, interface, sizeof(hwtstamp.ifr_name));
383 hwtstamp.ifr_data = (void *)&hwconfig; 383 hwtstamp.ifr_data = (void *)&hwconfig;
384 memset(&hwconfig, 0, sizeof(&hwconfig)); 384 memset(&hwconfig, 0, sizeof(hwconfig));
385 hwconfig.tx_type = 385 hwconfig.tx_type =
386 (so_timestamping_flags & SOF_TIMESTAMPING_TX_HARDWARE) ? 386 (so_timestamping_flags & SOF_TIMESTAMPING_TX_HARDWARE) ?
387 HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF; 387 HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF;
diff --git a/Documentation/scsi/hptiop.txt b/Documentation/scsi/hptiop.txt
index a6eb4add1be6..9605179711f4 100644
--- a/Documentation/scsi/hptiop.txt
+++ b/Documentation/scsi/hptiop.txt
@@ -3,6 +3,25 @@ HIGHPOINT ROCKETRAID 3xxx/4xxx ADAPTER DRIVER (hptiop)
3Controller Register Map 3Controller Register Map
4------------------------- 4-------------------------
5 5
6For RR44xx Intel IOP based adapters, the controller IOP is accessed via PCI BAR0 and BAR2:
7
8 BAR0 offset Register
9 0x11C5C Link Interface IRQ Set
10 0x11C60 Link Interface IRQ Clear
11
12 BAR2 offset Register
13 0x10 Inbound Message Register 0
14 0x14 Inbound Message Register 1
15 0x18 Outbound Message Register 0
16 0x1C Outbound Message Register 1
17 0x20 Inbound Doorbell Register
18 0x24 Inbound Interrupt Status Register
19 0x28 Inbound Interrupt Mask Register
20 0x30 Outbound Interrupt Status Register
21 0x34 Outbound Interrupt Mask Register
22 0x40 Inbound Queue Port
23 0x44 Outbound Queue Port
24
6For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0: 25For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0:
7 26
8 BAR0 offset Register 27 BAR0 offset Register
@@ -93,7 +112,7 @@ The driver exposes following sysfs attributes:
93 112
94 113
95----------------------------------------------------------------------------- 114-----------------------------------------------------------------------------
96Copyright (C) 2006-2007 HighPoint Technologies, Inc. All Rights Reserved. 115Copyright (C) 2006-2009 HighPoint Technologies, Inc. All Rights Reserved.
97 116
98 This file is distributed in the hope that it will be useful, 117 This file is distributed in the hope that it will be useful,
99 but WITHOUT ANY WARRANTY; without even the implied warranty of 118 but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index f1708b79f963..4c7f9aee5c4e 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -209,6 +209,7 @@ AD1884A / AD1883 / AD1984A / AD1984B
209 laptop laptop with HP jack sensing 209 laptop laptop with HP jack sensing
210 mobile mobile devices with HP jack sensing 210 mobile mobile devices with HP jack sensing
211 thinkpad Lenovo Thinkpad X300 211 thinkpad Lenovo Thinkpad X300
212 touchsmart HP Touchsmart
212 213
213AD1884 214AD1884
214====== 215======
@@ -358,6 +359,7 @@ STAC9227/9228/9229/927x
358 5stack-no-fp D965 5stack without front panel 359 5stack-no-fp D965 5stack without front panel
359 dell-3stack Dell Dimension E520 360 dell-3stack Dell Dimension E520
360 dell-bios Fixes with Dell BIOS setup 361 dell-bios Fixes with Dell BIOS setup
362 volknob Fixes with volume-knob widget 0x24
361 auto BIOS setup (default) 363 auto BIOS setup (default)
362 364
363STAC92HD71B* 365STAC92HD71B*
diff --git a/Documentation/sysctl/fs.txt b/Documentation/sysctl/fs.txt
index 1458448436cc..62682500878a 100644
--- a/Documentation/sysctl/fs.txt
+++ b/Documentation/sysctl/fs.txt
@@ -96,13 +96,16 @@ handles that the Linux kernel will allocate. When you get lots
96of error messages about running out of file handles, you might 96of error messages about running out of file handles, you might
97want to increase this limit. 97want to increase this limit.
98 98
99The three values in file-nr denote the number of allocated 99Historically, the three values in file-nr denoted the number of
100file handles, the number of unused file handles and the maximum 100allocated file handles, the number of allocated but unused file
101number of file handles. When the allocated file handles come 101handles, and the maximum number of file handles. Linux 2.6 always
102close to the maximum, but the number of unused file handles is 102reports 0 as the number of free file handles -- this is not an
103significantly greater than 0, you've encountered a peak in your 103error, it just means that the number of allocated file handles
104usage of file handles and you don't need to increase the maximum. 104exactly matches the number of used file handles.
105 105
106Attempts to allocate more file descriptors than file-max are
107reported with printk, look for "VFS: file-max limit <number>
108reached".
106============================================================== 109==============================================================
107 110
108nr_open: 111nr_open:
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index b3d8b4922740..a028b92001ed 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -22,6 +22,7 @@ show up in /proc/sys/kernel:
22- callhome [ S390 only ] 22- callhome [ S390 only ]
23- auto_msgmni 23- auto_msgmni
24- core_pattern 24- core_pattern
25- core_pipe_limit
25- core_uses_pid 26- core_uses_pid
26- ctrl-alt-del 27- ctrl-alt-del
27- dentry-state 28- dentry-state
@@ -135,6 +136,27 @@ core_pattern is used to specify a core dumpfile pattern name.
135 136
136============================================================== 137==============================================================
137 138
139core_pipe_limit:
140
141This sysctl is only applicable when core_pattern is configured to pipe core
142files to user space helper a (when the first character of core_pattern is a '|',
143see above). When collecting cores via a pipe to an application, it is
144occasionally usefull for the collecting application to gather data about the
145crashing process from its /proc/pid directory. In order to do this safely, the
146kernel must wait for the collecting process to exit, so as not to remove the
147crashing processes proc files prematurely. This in turn creates the possibility
148that a misbehaving userspace collecting process can block the reaping of a
149crashed process simply by never exiting. This sysctl defends against that. It
150defines how many concurrent crashing processes may be piped to user space
151applications in parallel. If this value is exceeded, then those crashing
152processes above that value are noted via the kernel log and their cores are
153skipped. 0 is a special value, indicating that unlimited processes may be
154captured in parallel, but that no waiting will take place (i.e. the collecting
155process is not guaranteed access to /proc/<crahing pid>/). This value defaults
156to 0.
157
158==============================================================
159
138core_uses_pid: 160core_uses_pid:
139 161
140The default coredump filename is "core". By setting 162The default coredump filename is "core". By setting
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index e6fb1ec2744b..a6e360d2055c 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -32,6 +32,8 @@ Currently, these files are in /proc/sys/vm:
32- legacy_va_layout 32- legacy_va_layout
33- lowmem_reserve_ratio 33- lowmem_reserve_ratio
34- max_map_count 34- max_map_count
35- memory_failure_early_kill
36- memory_failure_recovery
35- min_free_kbytes 37- min_free_kbytes
36- min_slab_ratio 38- min_slab_ratio
37- min_unmapped_ratio 39- min_unmapped_ratio
@@ -53,7 +55,6 @@ Currently, these files are in /proc/sys/vm:
53- vfs_cache_pressure 55- vfs_cache_pressure
54- zone_reclaim_mode 56- zone_reclaim_mode
55 57
56
57============================================================== 58==============================================================
58 59
59block_dump 60block_dump
@@ -275,6 +276,44 @@ e.g., up to one or two maps per allocation.
275 276
276The default value is 65536. 277The default value is 65536.
277 278
279=============================================================
280
281memory_failure_early_kill:
282
283Control how to kill processes when uncorrected memory error (typically
284a 2bit error in a memory module) is detected in the background by hardware
285that cannot be handled by the kernel. In some cases (like the page
286still having a valid copy on disk) the kernel will handle the failure
287transparently without affecting any applications. But if there is
288no other uptodate copy of the data it will kill to prevent any data
289corruptions from propagating.
290
2911: Kill all processes that have the corrupted and not reloadable page mapped
292as soon as the corruption is detected. Note this is not supported
293for a few types of pages, like kernel internally allocated data or
294the swap cache, but works for the majority of user pages.
295
2960: Only unmap the corrupted page from all processes and only kill a process
297who tries to access it.
298
299The kill is done using a catchable SIGBUS with BUS_MCEERR_AO, so processes can
300handle this if they want to.
301
302This is only active on architectures/platforms with advanced machine
303check handling and depends on the hardware capabilities.
304
305Applications can override this setting individually with the PR_MCE_KILL prctl
306
307==============================================================
308
309memory_failure_recovery
310
311Enable memory failure recovery (when supported by the platform)
312
3131: Attempt recovery.
314
3150: Always panic on a memory failure.
316
278============================================================== 317==============================================================
279 318
280min_free_kbytes: 319min_free_kbytes:
diff --git a/Documentation/vm/.gitignore b/Documentation/vm/.gitignore
index 33e8a023df02..09b164a5700f 100644
--- a/Documentation/vm/.gitignore
+++ b/Documentation/vm/.gitignore
@@ -1 +1,2 @@
1page-types
1slabinfo 2slabinfo
diff --git a/Documentation/vm/ksm.txt b/Documentation/vm/ksm.txt
index 72a22f65960e..262d8e6793a3 100644
--- a/Documentation/vm/ksm.txt
+++ b/Documentation/vm/ksm.txt
@@ -52,15 +52,15 @@ The KSM daemon is controlled by sysfs files in /sys/kernel/mm/ksm/,
52readable by all but writable only by root: 52readable by all but writable only by root:
53 53
54max_kernel_pages - set to maximum number of kernel pages that KSM may use 54max_kernel_pages - set to maximum number of kernel pages that KSM may use
55 e.g. "echo 2000 > /sys/kernel/mm/ksm/max_kernel_pages" 55 e.g. "echo 100000 > /sys/kernel/mm/ksm/max_kernel_pages"
56 Value 0 imposes no limit on the kernel pages KSM may use; 56 Value 0 imposes no limit on the kernel pages KSM may use;
57 but note that any process using MADV_MERGEABLE can cause 57 but note that any process using MADV_MERGEABLE can cause
58 KSM to allocate these pages, unswappable until it exits. 58 KSM to allocate these pages, unswappable until it exits.
59 Default: 2000 (chosen for demonstration purposes) 59 Default: quarter of memory (chosen to not pin too much)
60 60
61pages_to_scan - how many present pages to scan before ksmd goes to sleep 61pages_to_scan - how many present pages to scan before ksmd goes to sleep
62 e.g. "echo 200 > /sys/kernel/mm/ksm/pages_to_scan" 62 e.g. "echo 100 > /sys/kernel/mm/ksm/pages_to_scan"
63 Default: 200 (chosen for demonstration purposes) 63 Default: 100 (chosen for demonstration purposes)
64 64
65sleep_millisecs - how many milliseconds ksmd should sleep before next scan 65sleep_millisecs - how many milliseconds ksmd should sleep before next scan
66 e.g. "echo 20 > /sys/kernel/mm/ksm/sleep_millisecs" 66 e.g. "echo 20 > /sys/kernel/mm/ksm/sleep_millisecs"
@@ -70,7 +70,8 @@ run - set 0 to stop ksmd from running but keep merged pages,
70 set 1 to run ksmd e.g. "echo 1 > /sys/kernel/mm/ksm/run", 70 set 1 to run ksmd e.g. "echo 1 > /sys/kernel/mm/ksm/run",
71 set 2 to stop ksmd and unmerge all pages currently merged, 71 set 2 to stop ksmd and unmerge all pages currently merged,
72 but leave mergeable areas registered for next run 72 but leave mergeable areas registered for next run
73 Default: 1 (for immediate use by apps which register) 73 Default: 0 (must be changed to 1 to activate KSM,
74 except if CONFIG_SYSFS is disabled)
74 75
75The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/: 76The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/:
76 77
@@ -86,4 +87,4 @@ pages_volatile embraces several different kinds of activity, but a high
86proportion there would also indicate poor use of madvise MADV_MERGEABLE. 87proportion there would also indicate poor use of madvise MADV_MERGEABLE.
87 88
88Izik Eidus, 89Izik Eidus,
89Hugh Dickins, 30 July 2009 90Hugh Dickins, 24 Sept 2009
diff --git a/Documentation/vm/locking b/Documentation/vm/locking
index f366fa956179..25fadb448760 100644
--- a/Documentation/vm/locking
+++ b/Documentation/vm/locking
@@ -80,7 +80,7 @@ Note: PTL can also be used to guarantee that no new clones using the
80mm start up ... this is a loose form of stability on mm_users. For 80mm start up ... this is a loose form of stability on mm_users. For
81example, it is used in copy_mm to protect against a racing tlb_gather_mmu 81example, it is used in copy_mm to protect against a racing tlb_gather_mmu
82single address space optimization, so that the zap_page_range (from 82single address space optimization, so that the zap_page_range (from
83vmtruncate) does not lose sending ipi's to cloned threads that might 83truncate) does not lose sending ipi's to cloned threads that might
84be spawned underneath it and go to user mode to drag in pte's into tlbs. 84be spawned underneath it and go to user mode to drag in pte's into tlbs.
85 85
86swap_lock 86swap_lock
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
index 3eda8ea00852..3ec4f2a22585 100644
--- a/Documentation/vm/page-types.c
+++ b/Documentation/vm/page-types.c
@@ -2,9 +2,13 @@
2 * page-types: Tool for querying page flags 2 * page-types: Tool for querying page flags
3 * 3 *
4 * Copyright (C) 2009 Intel corporation 4 * Copyright (C) 2009 Intel corporation
5 * Copyright (C) 2009 Wu Fengguang <fengguang.wu@intel.com> 5 *
6 * Authors: Wu Fengguang <fengguang.wu@intel.com>
7 *
8 * Released under the General Public License (GPL).
6 */ 9 */
7 10
11#define _LARGEFILE64_SOURCE
8#include <stdio.h> 12#include <stdio.h>
9#include <stdlib.h> 13#include <stdlib.h>
10#include <unistd.h> 14#include <unistd.h>
@@ -13,12 +17,33 @@
13#include <string.h> 17#include <string.h>
14#include <getopt.h> 18#include <getopt.h>
15#include <limits.h> 19#include <limits.h>
20#include <assert.h>
16#include <sys/types.h> 21#include <sys/types.h>
17#include <sys/errno.h> 22#include <sys/errno.h>
18#include <sys/fcntl.h> 23#include <sys/fcntl.h>
19 24
20 25
21/* 26/*
27 * pagemap kernel ABI bits
28 */
29
30#define PM_ENTRY_BYTES sizeof(uint64_t)
31#define PM_STATUS_BITS 3
32#define PM_STATUS_OFFSET (64 - PM_STATUS_BITS)
33#define PM_STATUS_MASK (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET)
34#define PM_STATUS(nr) (((nr) << PM_STATUS_OFFSET) & PM_STATUS_MASK)
35#define PM_PSHIFT_BITS 6
36#define PM_PSHIFT_OFFSET (PM_STATUS_OFFSET - PM_PSHIFT_BITS)
37#define PM_PSHIFT_MASK (((1LL << PM_PSHIFT_BITS) - 1) << PM_PSHIFT_OFFSET)
38#define PM_PSHIFT(x) (((u64) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK)
39#define PM_PFRAME_MASK ((1LL << PM_PSHIFT_OFFSET) - 1)
40#define PM_PFRAME(x) ((x) & PM_PFRAME_MASK)
41
42#define PM_PRESENT PM_STATUS(4LL)
43#define PM_SWAP PM_STATUS(2LL)
44
45
46/*
22 * kernel page flags 47 * kernel page flags
23 */ 48 */
24 49
@@ -47,7 +72,9 @@
47#define KPF_COMPOUND_TAIL 16 72#define KPF_COMPOUND_TAIL 16
48#define KPF_HUGE 17 73#define KPF_HUGE 17
49#define KPF_UNEVICTABLE 18 74#define KPF_UNEVICTABLE 18
75#define KPF_HWPOISON 19
50#define KPF_NOPAGE 20 76#define KPF_NOPAGE 20
77#define KPF_KSM 21
51 78
52/* [32-] kernel hacking assistances */ 79/* [32-] kernel hacking assistances */
53#define KPF_RESERVED 32 80#define KPF_RESERVED 32
@@ -94,7 +121,9 @@ static char *page_flag_names[] = {
94 [KPF_COMPOUND_TAIL] = "T:compound_tail", 121 [KPF_COMPOUND_TAIL] = "T:compound_tail",
95 [KPF_HUGE] = "G:huge", 122 [KPF_HUGE] = "G:huge",
96 [KPF_UNEVICTABLE] = "u:unevictable", 123 [KPF_UNEVICTABLE] = "u:unevictable",
124 [KPF_HWPOISON] = "X:hwpoison",
97 [KPF_NOPAGE] = "n:nopage", 125 [KPF_NOPAGE] = "n:nopage",
126 [KPF_KSM] = "x:ksm",
98 127
99 [KPF_RESERVED] = "r:reserved", 128 [KPF_RESERVED] = "r:reserved",
100 [KPF_MLOCKED] = "m:mlocked", 129 [KPF_MLOCKED] = "m:mlocked",
@@ -126,6 +155,11 @@ static int nr_addr_ranges;
126static unsigned long opt_offset[MAX_ADDR_RANGES]; 155static unsigned long opt_offset[MAX_ADDR_RANGES];
127static unsigned long opt_size[MAX_ADDR_RANGES]; 156static unsigned long opt_size[MAX_ADDR_RANGES];
128 157
158#define MAX_VMAS 10240
159static int nr_vmas;
160static unsigned long pg_start[MAX_VMAS];
161static unsigned long pg_end[MAX_VMAS];
162
129#define MAX_BIT_FILTERS 64 163#define MAX_BIT_FILTERS 64
130static int nr_bit_filters; 164static int nr_bit_filters;
131static uint64_t opt_mask[MAX_BIT_FILTERS]; 165static uint64_t opt_mask[MAX_BIT_FILTERS];
@@ -133,9 +167,15 @@ static uint64_t opt_bits[MAX_BIT_FILTERS];
133 167
134static int page_size; 168static int page_size;
135 169
136#define PAGES_BATCH (64 << 10) /* 64k pages */ 170static int pagemap_fd;
137static int kpageflags_fd; 171static int kpageflags_fd;
138static uint64_t kpageflags_buf[KPF_BYTES * PAGES_BATCH]; 172
173static int opt_hwpoison;
174static int opt_unpoison;
175
176static char *hwpoison_debug_fs = "/debug/hwpoison";
177static int hwpoison_inject_fd;
178static int hwpoison_forget_fd;
139 179
140#define HASH_SHIFT 13 180#define HASH_SHIFT 13
141#define HASH_SIZE (1 << HASH_SHIFT) 181#define HASH_SIZE (1 << HASH_SHIFT)
@@ -158,6 +198,11 @@ static uint64_t page_flags[HASH_SIZE];
158 type __min2 = (y); \ 198 type __min2 = (y); \
159 __min1 < __min2 ? __min1 : __min2; }) 199 __min1 < __min2 ? __min1 : __min2; })
160 200
201#define max_t(type, x, y) ({ \
202 type __max1 = (x); \
203 type __max2 = (y); \
204 __max1 > __max2 ? __max1 : __max2; })
205
161static unsigned long pages2mb(unsigned long pages) 206static unsigned long pages2mb(unsigned long pages)
162{ 207{
163 return (pages * page_size) >> 20; 208 return (pages * page_size) >> 20;
@@ -173,6 +218,74 @@ static void fatal(const char *x, ...)
173 exit(EXIT_FAILURE); 218 exit(EXIT_FAILURE);
174} 219}
175 220
221int checked_open(const char *pathname, int flags)
222{
223 int fd = open(pathname, flags);
224
225 if (fd < 0) {
226 perror(pathname);
227 exit(EXIT_FAILURE);
228 }
229
230 return fd;
231}
232
233/*
234 * pagemap/kpageflags routines
235 */
236
237static unsigned long do_u64_read(int fd, char *name,
238 uint64_t *buf,
239 unsigned long index,
240 unsigned long count)
241{
242 long bytes;
243
244 if (index > ULONG_MAX / 8)
245 fatal("index overflow: %lu\n", index);
246
247 if (lseek(fd, index * 8, SEEK_SET) < 0) {
248 perror(name);
249 exit(EXIT_FAILURE);
250 }
251
252 bytes = read(fd, buf, count * 8);
253 if (bytes < 0) {
254 perror(name);
255 exit(EXIT_FAILURE);
256 }
257 if (bytes % 8)
258 fatal("partial read: %lu bytes\n", bytes);
259
260 return bytes / 8;
261}
262
263static unsigned long kpageflags_read(uint64_t *buf,
264 unsigned long index,
265 unsigned long pages)
266{
267 return do_u64_read(kpageflags_fd, PROC_KPAGEFLAGS, buf, index, pages);
268}
269
270static unsigned long pagemap_read(uint64_t *buf,
271 unsigned long index,
272 unsigned long pages)
273{
274 return do_u64_read(pagemap_fd, "/proc/pid/pagemap", buf, index, pages);
275}
276
277static unsigned long pagemap_pfn(uint64_t val)
278{
279 unsigned long pfn;
280
281 if (val & PM_PRESENT)
282 pfn = PM_PFRAME(val);
283 else
284 pfn = 0;
285
286 return pfn;
287}
288
176 289
177/* 290/*
178 * page flag names 291 * page flag names
@@ -221,29 +334,39 @@ static char *page_flag_longname(uint64_t flags)
221 * page list and summary 334 * page list and summary
222 */ 335 */
223 336
224static void show_page_range(unsigned long offset, uint64_t flags) 337static void show_page_range(unsigned long voffset,
338 unsigned long offset, uint64_t flags)
225{ 339{
226 static uint64_t flags0; 340 static uint64_t flags0;
341 static unsigned long voff;
227 static unsigned long index; 342 static unsigned long index;
228 static unsigned long count; 343 static unsigned long count;
229 344
230 if (flags == flags0 && offset == index + count) { 345 if (flags == flags0 && offset == index + count &&
346 (!opt_pid || voffset == voff + count)) {
231 count++; 347 count++;
232 return; 348 return;
233 } 349 }
234 350
235 if (count) 351 if (count) {
236 printf("%lu\t%lu\t%s\n", 352 if (opt_pid)
353 printf("%lx\t", voff);
354 printf("%lx\t%lx\t%s\n",
237 index, count, page_flag_name(flags0)); 355 index, count, page_flag_name(flags0));
356 }
238 357
239 flags0 = flags; 358 flags0 = flags;
240 index = offset; 359 index = offset;
360 voff = voffset;
241 count = 1; 361 count = 1;
242} 362}
243 363
244static void show_page(unsigned long offset, uint64_t flags) 364static void show_page(unsigned long voffset,
365 unsigned long offset, uint64_t flags)
245{ 366{
246 printf("%lu\t%s\n", offset, page_flag_name(flags)); 367 if (opt_pid)
368 printf("%lx\t", voffset);
369 printf("%lx\t%s\n", offset, page_flag_name(flags));
247} 370}
248 371
249static void show_summary(void) 372static void show_summary(void)
@@ -320,6 +443,62 @@ static uint64_t well_known_flags(uint64_t flags)
320 return flags; 443 return flags;
321} 444}
322 445
446static uint64_t kpageflags_flags(uint64_t flags)
447{
448 flags = expand_overloaded_flags(flags);
449
450 if (!opt_raw)
451 flags = well_known_flags(flags);
452
453 return flags;
454}
455
456/*
457 * page actions
458 */
459
460static void prepare_hwpoison_fd(void)
461{
462 char buf[100];
463
464 if (opt_hwpoison && !hwpoison_inject_fd) {
465 sprintf(buf, "%s/corrupt-pfn", hwpoison_debug_fs);
466 hwpoison_inject_fd = checked_open(buf, O_WRONLY);
467 }
468
469 if (opt_unpoison && !hwpoison_forget_fd) {
470 sprintf(buf, "%s/renew-pfn", hwpoison_debug_fs);
471 hwpoison_forget_fd = checked_open(buf, O_WRONLY);
472 }
473}
474
475static int hwpoison_page(unsigned long offset)
476{
477 char buf[100];
478 int len;
479
480 len = sprintf(buf, "0x%lx\n", offset);
481 len = write(hwpoison_inject_fd, buf, len);
482 if (len < 0) {
483 perror("hwpoison inject");
484 return len;
485 }
486 return 0;
487}
488
489static int unpoison_page(unsigned long offset)
490{
491 char buf[100];
492 int len;
493
494 len = sprintf(buf, "0x%lx\n", offset);
495 len = write(hwpoison_forget_fd, buf, len);
496 if (len < 0) {
497 perror("hwpoison forget");
498 return len;
499 }
500 return 0;
501}
323 502
324/* 503/*
325 * page frame walker 504 * page frame walker
@@ -352,73 +531,124 @@ static int hash_slot(uint64_t flags)
352 exit(EXIT_FAILURE); 531 exit(EXIT_FAILURE);
353} 532}
354 533
355static void add_page(unsigned long offset, uint64_t flags) 534static void add_page(unsigned long voffset,
535 unsigned long offset, uint64_t flags)
356{ 536{
357 flags = expand_overloaded_flags(flags); 537 flags = kpageflags_flags(flags);
358
359 if (!opt_raw)
360 flags = well_known_flags(flags);
361 538
362 if (!bit_mask_ok(flags)) 539 if (!bit_mask_ok(flags))
363 return; 540 return;
364 541
542 if (opt_hwpoison)
543 hwpoison_page(offset);
544 if (opt_unpoison)
545 unpoison_page(offset);
546
365 if (opt_list == 1) 547 if (opt_list == 1)
366 show_page_range(offset, flags); 548 show_page_range(voffset, offset, flags);
367 else if (opt_list == 2) 549 else if (opt_list == 2)
368 show_page(offset, flags); 550 show_page(voffset, offset, flags);
369 551
370 nr_pages[hash_slot(flags)]++; 552 nr_pages[hash_slot(flags)]++;
371 total_pages++; 553 total_pages++;
372} 554}
373 555
374static void walk_pfn(unsigned long index, unsigned long count) 556#define KPAGEFLAGS_BATCH (64 << 10) /* 64k pages */
557static void walk_pfn(unsigned long voffset,
558 unsigned long index,
559 unsigned long count)
375{ 560{
561 uint64_t buf[KPAGEFLAGS_BATCH];
376 unsigned long batch; 562 unsigned long batch;
377 unsigned long n; 563 unsigned long pages;
378 unsigned long i; 564 unsigned long i;
379 565
380 if (index > ULONG_MAX / KPF_BYTES) 566 while (count) {
381 fatal("index overflow: %lu\n", index); 567 batch = min_t(unsigned long, count, KPAGEFLAGS_BATCH);
568 pages = kpageflags_read(buf, index, batch);
569 if (pages == 0)
570 break;
571
572 for (i = 0; i < pages; i++)
573 add_page(voffset + i, index + i, buf[i]);
574
575 index += pages;
576 count -= pages;
577 }
578}
382 579
383 lseek(kpageflags_fd, index * KPF_BYTES, SEEK_SET); 580#define PAGEMAP_BATCH (64 << 10)
581static void walk_vma(unsigned long index, unsigned long count)
582{
583 uint64_t buf[PAGEMAP_BATCH];
584 unsigned long batch;
585 unsigned long pages;
586 unsigned long pfn;
587 unsigned long i;
384 588
385 while (count) { 589 while (count) {
386 batch = min_t(unsigned long, count, PAGES_BATCH); 590 batch = min_t(unsigned long, count, PAGEMAP_BATCH);
387 n = read(kpageflags_fd, kpageflags_buf, batch * KPF_BYTES); 591 pages = pagemap_read(buf, index, batch);
388 if (n == 0) 592 if (pages == 0)
389 break; 593 break;
390 if (n < 0) { 594
391 perror(PROC_KPAGEFLAGS); 595 for (i = 0; i < pages; i++) {
392 exit(EXIT_FAILURE); 596 pfn = pagemap_pfn(buf[i]);
597 if (pfn)
598 walk_pfn(index + i, pfn, 1);
393 } 599 }
394 600
395 if (n % KPF_BYTES != 0) 601 index += pages;
396 fatal("partial read: %lu bytes\n", n); 602 count -= pages;
397 n = n / KPF_BYTES; 603 }
604}
605
606static void walk_task(unsigned long index, unsigned long count)
607{
608 const unsigned long end = index + count;
609 unsigned long start;
610 int i = 0;
611
612 while (index < end) {
398 613
399 for (i = 0; i < n; i++) 614 while (pg_end[i] <= index)
400 add_page(index + i, kpageflags_buf[i]); 615 if (++i >= nr_vmas)
616 return;
617 if (pg_start[i] >= end)
618 return;
401 619
402 index += batch; 620 start = max_t(unsigned long, pg_start[i], index);
403 count -= batch; 621 index = min_t(unsigned long, pg_end[i], end);
622
623 assert(start < index);
624 walk_vma(start, index - start);
404 } 625 }
405} 626}
406 627
628static void add_addr_range(unsigned long offset, unsigned long size)
629{
630 if (nr_addr_ranges >= MAX_ADDR_RANGES)
631 fatal("too many addr ranges\n");
632
633 opt_offset[nr_addr_ranges] = offset;
634 opt_size[nr_addr_ranges] = min_t(unsigned long, size, ULONG_MAX-offset);
635 nr_addr_ranges++;
636}
637
407static void walk_addr_ranges(void) 638static void walk_addr_ranges(void)
408{ 639{
409 int i; 640 int i;
410 641
411 kpageflags_fd = open(PROC_KPAGEFLAGS, O_RDONLY); 642 kpageflags_fd = checked_open(PROC_KPAGEFLAGS, O_RDONLY);
412 if (kpageflags_fd < 0) {
413 perror(PROC_KPAGEFLAGS);
414 exit(EXIT_FAILURE);
415 }
416 643
417 if (!nr_addr_ranges) 644 if (!nr_addr_ranges)
418 walk_pfn(0, ULONG_MAX); 645 add_addr_range(0, ULONG_MAX);
419 646
420 for (i = 0; i < nr_addr_ranges; i++) 647 for (i = 0; i < nr_addr_ranges; i++)
421 walk_pfn(opt_offset[i], opt_size[i]); 648 if (!opt_pid)
649 walk_pfn(0, opt_offset[i], opt_size[i]);
650 else
651 walk_task(opt_offset[i], opt_size[i]);
422 652
423 close(kpageflags_fd); 653 close(kpageflags_fd);
424} 654}
@@ -446,20 +676,22 @@ static void usage(void)
446" -r|--raw Raw mode, for kernel developers\n" 676" -r|--raw Raw mode, for kernel developers\n"
447" -a|--addr addr-spec Walk a range of pages\n" 677" -a|--addr addr-spec Walk a range of pages\n"
448" -b|--bits bits-spec Walk pages with specified bits\n" 678" -b|--bits bits-spec Walk pages with specified bits\n"
449#if 0 /* planned features */
450" -p|--pid pid Walk process address space\n" 679" -p|--pid pid Walk process address space\n"
680#if 0 /* planned features */
451" -f|--file filename Walk file address space\n" 681" -f|--file filename Walk file address space\n"
452#endif 682#endif
453" -l|--list Show page details in ranges\n" 683" -l|--list Show page details in ranges\n"
454" -L|--list-each Show page details one by one\n" 684" -L|--list-each Show page details one by one\n"
455" -N|--no-summary Don't show summay info\n" 685" -N|--no-summary Don't show summay info\n"
686" -X|--hwpoison hwpoison pages\n"
687" -x|--unpoison unpoison pages\n"
456" -h|--help Show this usage message\n" 688" -h|--help Show this usage message\n"
457"addr-spec:\n" 689"addr-spec:\n"
458" N one page at offset N (unit: pages)\n" 690" N one page at offset N (unit: pages)\n"
459" N+M pages range from N to N+M-1\n" 691" N+M pages range from N to N+M-1\n"
460" N,M pages range from N to M-1\n" 692" N,M pages range from N to M-1\n"
461" N, pages range from N to end\n" 693" N, pages range from N to end\n"
462" ,M pages range from 0 to M\n" 694" ,M pages range from 0 to M-1\n"
463"bits-spec:\n" 695"bits-spec:\n"
464" bit1,bit2 (flags & (bit1|bit2)) != 0\n" 696" bit1,bit2 (flags & (bit1|bit2)) != 0\n"
465" bit1,bit2=bit1 (flags & (bit1|bit2)) == bit1\n" 697" bit1,bit2=bit1 (flags & (bit1|bit2)) == bit1\n"
@@ -496,21 +728,53 @@ static unsigned long long parse_number(const char *str)
496 728
497static void parse_pid(const char *str) 729static void parse_pid(const char *str)
498{ 730{
731 FILE *file;
732 char buf[5000];
733
499 opt_pid = parse_number(str); 734 opt_pid = parse_number(str);
500}
501 735
502static void parse_file(const char *name) 736 sprintf(buf, "/proc/%d/pagemap", opt_pid);
503{ 737 pagemap_fd = checked_open(buf, O_RDONLY);
738
739 sprintf(buf, "/proc/%d/maps", opt_pid);
740 file = fopen(buf, "r");
741 if (!file) {
742 perror(buf);
743 exit(EXIT_FAILURE);
744 }
745
746 while (fgets(buf, sizeof(buf), file) != NULL) {
747 unsigned long vm_start;
748 unsigned long vm_end;
749 unsigned long long pgoff;
750 int major, minor;
751 char r, w, x, s;
752 unsigned long ino;
753 int n;
754
755 n = sscanf(buf, "%lx-%lx %c%c%c%c %llx %x:%x %lu",
756 &vm_start,
757 &vm_end,
758 &r, &w, &x, &s,
759 &pgoff,
760 &major, &minor,
761 &ino);
762 if (n < 10) {
763 fprintf(stderr, "unexpected line: %s\n", buf);
764 continue;
765 }
766 pg_start[nr_vmas] = vm_start / page_size;
767 pg_end[nr_vmas] = vm_end / page_size;
768 if (++nr_vmas >= MAX_VMAS) {
769 fprintf(stderr, "too many VMAs\n");
770 break;
771 }
772 }
773 fclose(file);
504} 774}
505 775
506static void add_addr_range(unsigned long offset, unsigned long size) 776static void parse_file(const char *name)
507{ 777{
508 if (nr_addr_ranges >= MAX_ADDR_RANGES)
509 fatal("too much addr ranges\n");
510
511 opt_offset[nr_addr_ranges] = offset;
512 opt_size[nr_addr_ranges] = size;
513 nr_addr_ranges++;
514} 778}
515 779
516static void parse_addr_range(const char *optarg) 780static void parse_addr_range(const char *optarg)
@@ -630,6 +894,8 @@ static struct option opts[] = {
630 { "list" , 0, NULL, 'l' }, 894 { "list" , 0, NULL, 'l' },
631 { "list-each" , 0, NULL, 'L' }, 895 { "list-each" , 0, NULL, 'L' },
632 { "no-summary", 0, NULL, 'N' }, 896 { "no-summary", 0, NULL, 'N' },
897 { "hwpoison" , 0, NULL, 'X' },
898 { "unpoison" , 0, NULL, 'x' },
633 { "help" , 0, NULL, 'h' }, 899 { "help" , 0, NULL, 'h' },
634 { NULL , 0, NULL, 0 } 900 { NULL , 0, NULL, 0 }
635}; 901};
@@ -641,7 +907,7 @@ int main(int argc, char *argv[])
641 page_size = getpagesize(); 907 page_size = getpagesize();
642 908
643 while ((c = getopt_long(argc, argv, 909 while ((c = getopt_long(argc, argv,
644 "rp:f:a:b:lLNh", opts, NULL)) != -1) { 910 "rp:f:a:b:lLNXxh", opts, NULL)) != -1) {
645 switch (c) { 911 switch (c) {
646 case 'r': 912 case 'r':
647 opt_raw = 1; 913 opt_raw = 1;
@@ -667,6 +933,14 @@ int main(int argc, char *argv[])
667 case 'N': 933 case 'N':
668 opt_no_summary = 1; 934 opt_no_summary = 1;
669 break; 935 break;
936 case 'X':
937 opt_hwpoison = 1;
938 prepare_hwpoison_fd();
939 break;
940 case 'x':
941 opt_unpoison = 1;
942 prepare_hwpoison_fd();
943 break;
670 case 'h': 944 case 'h':
671 usage(); 945 usage();
672 exit(0); 946 exit(0);
@@ -676,15 +950,17 @@ int main(int argc, char *argv[])
676 } 950 }
677 } 951 }
678 952
953 if (opt_list && opt_pid)
954 printf("voffset\t");
679 if (opt_list == 1) 955 if (opt_list == 1)
680 printf("offset\tcount\tflags\n"); 956 printf("offset\tlen\tflags\n");
681 if (opt_list == 2) 957 if (opt_list == 2)
682 printf("offset\tflags\n"); 958 printf("offset\tflags\n");
683 959
684 walk_addr_ranges(); 960 walk_addr_ranges();
685 961
686 if (opt_list == 1) 962 if (opt_list == 1)
687 show_page_range(0, 0); /* drain the buffer */ 963 show_page_range(0, 0, 0); /* drain the buffer */
688 964
689 if (opt_no_summary) 965 if (opt_no_summary)
690 return 0; 966 return 0;
diff --git a/Documentation/vm/pagemap.txt b/Documentation/vm/pagemap.txt
index 600a304a828c..df09b9650a81 100644
--- a/Documentation/vm/pagemap.txt
+++ b/Documentation/vm/pagemap.txt
@@ -57,7 +57,9 @@ There are three components to pagemap:
57 16. COMPOUND_TAIL 57 16. COMPOUND_TAIL
58 16. HUGE 58 16. HUGE
59 18. UNEVICTABLE 59 18. UNEVICTABLE
60 19. HWPOISON
60 20. NOPAGE 61 20. NOPAGE
62 21. KSM
61 63
62Short descriptions to the page flags: 64Short descriptions to the page flags:
63 65
@@ -86,9 +88,15 @@ Short descriptions to the page flags:
8617. HUGE 8817. HUGE
87 this is an integral part of a HugeTLB page 89 this is an integral part of a HugeTLB page
88 90
9119. HWPOISON
92 hardware detected memory corruption on this page: don't touch the data!
93
8920. NOPAGE 9420. NOPAGE
90 no page frame exists at the requested address 95 no page frame exists at the requested address
91 96
9721. KSM
98 identical memory pages dynamically shared between one or more processes
99
92 [IO related page flags] 100 [IO related page flags]
93 1. ERROR IO error occurred 101 1. ERROR IO error occurred
94 3. UPTODATE page has up-to-date data 102 3. UPTODATE page has up-to-date data
diff --git a/Documentation/w1/masters/ds2482 b/Documentation/w1/masters/ds2482
index 9210d6fa5024..299b91c7609f 100644
--- a/Documentation/w1/masters/ds2482
+++ b/Documentation/w1/masters/ds2482
@@ -24,8 +24,8 @@ General Remarks
24 24
25Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. 25Valid addresses are 0x18, 0x19, 0x1a, and 0x1b.
26However, the device cannot be detected without writing to the i2c bus, so no 26However, the device cannot be detected without writing to the i2c bus, so no
27detection is done. 27detection is done. You should instantiate the device explicitly.
28You should force the device address.
29 28
30$ modprobe ds2482 force=0,0x18 29$ modprobe ds2482
30$ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device
31 31