diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/sysfs-bus-pci-devices-cciss | 28 | ||||
-rw-r--r-- | Documentation/SubmittingPatches | 2 | ||||
-rw-r--r-- | Documentation/arm/tcm.txt | 147 | ||||
-rw-r--r-- | Documentation/cgroups/cgroups.txt | 11 | ||||
-rw-r--r-- | Documentation/filesystems/ext4.txt | 13 | ||||
-rw-r--r-- | Documentation/filesystems/proc.txt | 1 | ||||
-rw-r--r-- | Documentation/filesystems/vfat.txt | 2 | ||||
-rw-r--r-- | Documentation/hwmon/ltc4215 | 7 | ||||
-rw-r--r-- | Documentation/hwmon/ltc4245 | 7 | ||||
-rw-r--r-- | Documentation/i2c/instantiating-devices | 2 | ||||
-rw-r--r-- | Documentation/kernel-parameters.txt | 1 | ||||
-rw-r--r-- | Documentation/laptops/thinkpad-acpi.txt | 48 | ||||
-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/sound/alsa/HD-Audio-Models.txt | 1 | ||||
-rw-r--r-- | Documentation/vm/ksm.txt | 13 | ||||
-rw-r--r-- | Documentation/vm/page-types.c | 304 | ||||
-rw-r--r-- | Documentation/vm/pagemap.txt | 8 | ||||
-rw-r--r-- | Documentation/w1/masters/ds2482 | 6 |
19 files changed, 466 insertions, 141 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 | |||
31 | Kernel Version: 2.6.30 | 31 | Kernel Version: 2.6.30 |
32 | Contact: iss_storagedev@hp.com | 32 | Contact: iss_storagedev@hp.com |
33 | Description: A symbolic link to /sys/block/cciss!cXdY | 33 | Description: A symbolic link to /sys/block/cciss!cXdY |
34 | |||
35 | Where: /sys/bus/pci/devices/<dev>/ccissX/rescan | ||
36 | Date: August 2009 | ||
37 | Kernel Version: 2.6.31 | ||
38 | Contact: iss_storagedev@hp.com | ||
39 | Description: Kicks of a rescan of the controller to discover logical | ||
40 | drive topology changes. | ||
41 | |||
42 | Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/lunid | ||
43 | Date: August 2009 | ||
44 | Kernel Version: 2.6.31 | ||
45 | Contact: iss_storagedev@hp.com | ||
46 | Description: Displays the 8-byte LUN ID used to address logical | ||
47 | drive Y of controller X. | ||
48 | |||
49 | Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/raid_level | ||
50 | Date: August 2009 | ||
51 | Kernel Version: 2.6.31 | ||
52 | Contact: iss_storagedev@hp.com | ||
53 | Description: Displays the RAID level of logical drive Y of | ||
54 | controller X. | ||
55 | |||
56 | Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/usage_count | ||
57 | Date: August 2009 | ||
58 | Kernel Version: 2.6.31 | ||
59 | Contact: iss_storagedev@hp.com | ||
60 | Description: Displays the usage count (number of opens) of logical drive Y | ||
61 | of controller X. | ||
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. | |||
232 | When sending patches to Linus, always follow step #7. | 232 | When sending patches to Linus, always follow step #7. |
233 | 233 | ||
234 | Large changes are not appropriate for mailing lists, and some | 234 | Large changes are not appropriate for mailing lists, and some |
235 | maintainers. If your patch, uncompressed, exceeds 40 kB in size, | 235 | maintainers. If your patch, uncompressed, exceeds 300 kB in size, |
236 | it is preferred that you store your patch on an Internet-accessible | 236 | it is preferred that you store your patch on an Internet-accessible |
237 | server, and provide instead a URL (link) pointing to your patch. | 237 | server, 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 @@ | |||
1 | ARM TCM (Tightly-Coupled Memory) handling in Linux | ||
2 | ---- | ||
3 | Written by Linus Walleij <linus.walleij@stericsson.com> | ||
4 | |||
5 | Some ARM SoC:s have a so-called TCM (Tightly-Coupled Memory). | ||
6 | This is usually just a few (4-64) KiB of RAM inside the ARM | ||
7 | processor. | ||
8 | |||
9 | Due to being embedded inside the CPU The TCM has a | ||
10 | Harvard-architecture, so there is an ITCM (instruction TCM) | ||
11 | and a DTCM (data TCM). The DTCM can not contain any | ||
12 | instructions, but the ITCM can actually contain data. | ||
13 | The size of DTCM or ITCM is minimum 4KiB so the typical | ||
14 | minimum configuration is 4KiB ITCM and 4KiB DTCM. | ||
15 | |||
16 | ARM CPU:s have special registers to read out status, physical | ||
17 | location and size of TCM memories. arch/arm/include/asm/cputype.h | ||
18 | defines a CPUID_TCM register that you can read out from the | ||
19 | system control coprocessor. Documentation from ARM can be found | ||
20 | at http://infocenter.arm.com, search for "TCM Status Register" | ||
21 | to see documents for all CPUs. Reading this register you can | ||
22 | determine if ITCM (bit 0) and/or DTCM (bit 16) is present in the | ||
23 | machine. | ||
24 | |||
25 | There is further a TCM region register (search for "TCM Region | ||
26 | Registers" at the ARM site) that can report and modify the location | ||
27 | size of TCM memories at runtime. This is used to read out and modify | ||
28 | TCM location and size. Notice that this is not a MMU table: you | ||
29 | actually move the physical location of the TCM around. At the | ||
30 | place you put it, it will mask any underlying RAM from the | ||
31 | CPU so it is usually wise not to overlap any physical RAM with | ||
32 | the TCM. | ||
33 | |||
34 | The TCM memory can then be remapped to another address again using | ||
35 | the MMU, but notice that the TCM if often used in situations where | ||
36 | the MMU is turned off. To avoid confusion the current Linux | ||
37 | implementation will map the TCM 1 to 1 from physical to virtual | ||
38 | memory in the location specified by the machine. | ||
39 | |||
40 | TCM 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 | |||
53 | There is an interface for using TCM on the ARM architecture | ||
54 | in <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 | |||
68 | A machine that has TCM memory shall select HAVE_TCM in | ||
69 | arch/arm/Kconfig for itself, and then the | ||
70 | rest of the functionality will depend on the physical | ||
71 | location and size of ITCM and DTCM to be defined in | ||
72 | mach/memory.h for the machine. Code that needs to use | ||
73 | TCM shall #include <asm/tcm.h> If the TCM is not located | ||
74 | at the place given in memory.h it will be moved using | ||
75 | the TCM Region registers. | ||
76 | |||
77 | Functions to go into itcm can be tagged like this: | ||
78 | int __tcmfunc foo(int bar); | ||
79 | |||
80 | Variables to go into dtcm can be tagged like this: | ||
81 | int __tcmdata foo; | ||
82 | |||
83 | Constants can be tagged like this: | ||
84 | int __tcmconst foo; | ||
85 | |||
86 | To put assembler into TCM just use | ||
87 | .section ".tcm.text" or .section ".tcm.data" | ||
88 | respectively. | ||
89 | |||
90 | Example code: | ||
91 | |||
92 | #include <asm/tcm.h> | ||
93 | |||
94 | /* Uninitialized data */ | ||
95 | static u32 __tcmdata tcmvar; | ||
96 | /* Initialized data */ | ||
97 | static u32 __tcmdata tcmassigned = 0x2BADBABEU; | ||
98 | /* Constant */ | ||
99 | static const u32 __tcmconst tcmconst = 0xCAFEBABEU; | ||
100 | |||
101 | static void __tcmlocalfunc tcm_to_tcm(void) | ||
102 | { | ||
103 | int i; | ||
104 | for (i = 0; i < 100; i++) | ||
105 | tcmvar ++; | ||
106 | } | ||
107 | |||
108 | static 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 | |||
118 | static 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/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index 455d4e6d346d..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. | |||
227 | Each cgroup is represented by a directory in the cgroup file system | 227 | Each cgroup is represented by a directory in the cgroup file system |
228 | containing the following files describing that cgroup: | 228 | containing 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 | ||
375 | In this directory you can find several files: | 382 | In this directory you can find several files: |
376 | # ls | 383 | # ls |
377 | notify_on_release tasks | 384 | cgroup.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 | ||
380 | Now attach your shell to this cgroup: | 387 | Now attach your shell to this cgroup: |
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. |
285 | delalloc (*) Deferring block allocation until write-out time. | 285 | |
286 | nodelalloc Disable delayed allocation. Blocks are allocation | 286 | delalloc (*) 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. | ||
290 | nodelalloc 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 | ||
289 | max_batch_time=usec Maximum amount of time ext4 should wait for | 296 | max_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/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 | ||
107 | tz=UTC -- Interpret timestamps as UTC rather than local time. | 107 | tz=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/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 | ||
24 | This driver does not probe for LTC4215 devices, due to the fact that some | 24 | This driver does not probe for LTC4215 devices, due to the fact that some |
25 | of the possible addresses are unfriendly to probing. You will need to use | 25 | of the possible addresses are unfriendly to probing. You will have to |
26 | the "force" parameter to tell the driver where to find the device. | 26 | instantiate the devices explicitly. |
27 | 27 | ||
28 | Example: the following will load the driver for an LTC4215 at address 0x44 | 28 | Example: the following will load the driver for an LTC4215 at address 0x44 |
29 | on I2C bus #0: | 29 | on 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 | ||
33 | Sysfs entries | 34 | Sysfs 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 | ||
25 | This driver does not probe for LTC4245 devices, due to the fact that some | 25 | This driver does not probe for LTC4245 devices, due to the fact that some |
26 | of the possible addresses are unfriendly to probing. You will need to use | 26 | of the possible addresses are unfriendly to probing. You will have to |
27 | the "force" parameter to tell the driver where to find the device. | 27 | instantiate the devices explicitly. |
28 | 28 | ||
29 | Example: the following will load the driver for an LTC4245 at address 0x23 | 29 | Example: the following will load the driver for an LTC4245 at address 0x23 |
30 | on I2C bus #1: | 30 | on 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 | ||
34 | Sysfs entries | 35 | Sysfs 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 | |||
188 | deleted. | 188 | deleted. |
189 | 189 | ||
190 | Example: | 190 | Example: |
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 | ||
193 | While this interface should only be used when in-kernel device declaration | 193 | While this interface should only be used when in-kernel device declaration |
194 | can't be done, there is a variety of cases where it can be helpful: | 194 | can't be done, there is a variety of cases where it can be helpful: |
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 | ||
200 | Not all bits in the mask can be modified. Not all bits that can be | 200 | Not all bits in the mask can be modified. Not all bits that can be |
201 | modified do anything. Not all hot keys can be individually controlled | 201 | modified do anything. Not all hot keys can be individually controlled |
202 | by the mask. Some models do not support the mask at all, and in those | 202 | by the mask. Some models do not support the mask at all. The behaviour |
203 | models, hot keys cannot be controlled individually. The behaviour of | 203 | of the mask is, therefore, highly dependent on the ThinkPad model. |
204 | the mask is, therefore, highly dependent on the ThinkPad model. | 204 | |
205 | The driver will filter out any unmasked hotkeys, so even if the firmware | ||
206 | doesn't allow disabling an specific hotkey, the driver will not report | ||
207 | events for unmasked hotkeys. | ||
205 | 208 | ||
206 | Note that unmasking some keys prevents their default behavior. For | 209 | Note that unmasking some keys prevents their default behavior. For |
207 | example, if Fn+F5 is unmasked, that key will no longer enable/disable | 210 | example, if Fn+F5 is unmasked, that key will no longer enable/disable |
208 | Bluetooth by itself. | 211 | Bluetooth by itself in firmware. |
209 | 212 | ||
210 | Note also that not all Fn key combinations are supported through ACPI. | 213 | Note also that not all Fn key combinations are supported through ACPI |
211 | For example, on the X40, the brightness, volume and "Access IBM" buttons | 214 | depending on the ThinkPad model and firmware version. On those |
212 | do not generate ACPI events even with this driver. They *can* be used | 215 | ThinkPads, it is still possible to support some extra hotkeys by |
213 | through the "ThinkPad Buttons" utility, see http://www.nongnu.org/tpb/ | 216 | polling the "CMOS NVRAM" at least 10 times per second. The driver |
217 | attempts to enables this functionality automatically when required. | ||
214 | 218 | ||
215 | procfs notes: | 219 | procfs 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. | |||
525 | 0x2305 System is waking up from suspend to eject bay | 524 | 0x2305 System is waking up from suspend to eject bay |
526 | 0x2404 System is waking up from hibernation to undock | 525 | 0x2404 System is waking up from hibernation to undock |
527 | 0x2405 System is waking up from hibernation to eject bay | 526 | 0x2405 System is waking up from hibernation to eject bay |
527 | 0x5010 Brightness level changed/control event | ||
528 | 528 | ||
529 | The above events are never propagated by the driver. | 529 | The above events are never propagated by the driver. |
530 | 530 | ||
@@ -532,7 +532,6 @@ The above events are never propagated by the driver. | |||
532 | 0x4003 Undocked (see 0x2x04), can sleep again | 532 | 0x4003 Undocked (see 0x2x04), can sleep again |
533 | 0x500B Tablet pen inserted into its storage bay | 533 | 0x500B Tablet pen inserted into its storage bay |
534 | 0x500C Tablet pen removed from its storage bay | 534 | 0x500C Tablet pen removed from its storage bay |
535 | 0x5010 Brightness level changed (newer Lenovo BIOSes) | ||
536 | 535 | ||
537 | The above events are propagated by the driver. | 536 | The above events are propagated by the driver. |
538 | 537 | ||
@@ -621,6 +620,8 @@ For Lenovo models *with* ACPI backlight control: | |||
621 | 2. Do *NOT* load up ACPI video, enable the hotkeys in thinkpad-acpi, | 620 | 2. 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 | ||
626 | Bluetooth | 627 | Bluetooth |
@@ -1459,3 +1460,8 @@ Sysfs interface changelog: | |||
1459 | 0x020400: Marker for 16 LEDs support. Also, LEDs that are known | 1460 | 0x020400: 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 | |||
1464 | 0x020500: 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 | ||
43 | Valid addresses for the MAX6875 are 0x50 and 0x52. | 43 | Valid addresses for the MAX6875 are 0x50 and 0x52. |
44 | Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56. | 44 | Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56. |
45 | The driver does not probe any address, so you must force the address. | 45 | The driver does not probe any address, so you explicitly instantiate the |
46 | devices. | ||
46 | 47 | ||
47 | Example: | 48 | Example: |
48 | $ modprobe max6875 force=0,0x50 | 49 | $ modprobe max6875 |
50 | $ echo max6875 0x50 > /sys/bus/i2c/devices/i2c-0/new_device | ||
49 | 51 | ||
50 | The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple | 52 | The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple |
51 | addresses. For example, for address 0x50, it also reserves 0x51. | 53 | addresses. For example, for address 0x50, it also reserves 0x51. |
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index f1708b79f963..75fddb40f416 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 | ||
213 | AD1884 | 214 | AD1884 |
214 | ====== | 215 | ====== |
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/, | |||
52 | readable by all but writable only by root: | 52 | readable by all but writable only by root: |
53 | 53 | ||
54 | max_kernel_pages - set to maximum number of kernel pages that KSM may use | 54 | max_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 | ||
61 | pages_to_scan - how many present pages to scan before ksmd goes to sleep | 61 | pages_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 | ||
65 | sleep_millisecs - how many milliseconds ksmd should sleep before next scan | 65 | sleep_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 | ||
75 | The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/: | 76 | The 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 | |||
86 | proportion there would also indicate poor use of madvise MADV_MERGEABLE. | 87 | proportion there would also indicate poor use of madvise MADV_MERGEABLE. |
87 | 88 | ||
88 | Izik Eidus, | 89 | Izik Eidus, |
89 | Hugh Dickins, 30 July 2009 | 90 | Hugh Dickins, 24 Sept 2009 |
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c index fa1a30d9e9d5..3ec4f2a22585 100644 --- a/Documentation/vm/page-types.c +++ b/Documentation/vm/page-types.c | |||
@@ -2,7 +2,10 @@ | |||
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 | ||
8 | #define _LARGEFILE64_SOURCE | 11 | #define _LARGEFILE64_SOURCE |
@@ -69,7 +72,9 @@ | |||
69 | #define KPF_COMPOUND_TAIL 16 | 72 | #define KPF_COMPOUND_TAIL 16 |
70 | #define KPF_HUGE 17 | 73 | #define KPF_HUGE 17 |
71 | #define KPF_UNEVICTABLE 18 | 74 | #define KPF_UNEVICTABLE 18 |
75 | #define KPF_HWPOISON 19 | ||
72 | #define KPF_NOPAGE 20 | 76 | #define KPF_NOPAGE 20 |
77 | #define KPF_KSM 21 | ||
73 | 78 | ||
74 | /* [32-] kernel hacking assistances */ | 79 | /* [32-] kernel hacking assistances */ |
75 | #define KPF_RESERVED 32 | 80 | #define KPF_RESERVED 32 |
@@ -116,7 +121,9 @@ static char *page_flag_names[] = { | |||
116 | [KPF_COMPOUND_TAIL] = "T:compound_tail", | 121 | [KPF_COMPOUND_TAIL] = "T:compound_tail", |
117 | [KPF_HUGE] = "G:huge", | 122 | [KPF_HUGE] = "G:huge", |
118 | [KPF_UNEVICTABLE] = "u:unevictable", | 123 | [KPF_UNEVICTABLE] = "u:unevictable", |
124 | [KPF_HWPOISON] = "X:hwpoison", | ||
119 | [KPF_NOPAGE] = "n:nopage", | 125 | [KPF_NOPAGE] = "n:nopage", |
126 | [KPF_KSM] = "x:ksm", | ||
120 | 127 | ||
121 | [KPF_RESERVED] = "r:reserved", | 128 | [KPF_RESERVED] = "r:reserved", |
122 | [KPF_MLOCKED] = "m:mlocked", | 129 | [KPF_MLOCKED] = "m:mlocked", |
@@ -152,9 +159,6 @@ static unsigned long opt_size[MAX_ADDR_RANGES]; | |||
152 | static int nr_vmas; | 159 | static int nr_vmas; |
153 | static unsigned long pg_start[MAX_VMAS]; | 160 | static unsigned long pg_start[MAX_VMAS]; |
154 | static unsigned long pg_end[MAX_VMAS]; | 161 | static unsigned long pg_end[MAX_VMAS]; |
155 | static unsigned long voffset; | ||
156 | |||
157 | static int pagemap_fd; | ||
158 | 162 | ||
159 | #define MAX_BIT_FILTERS 64 | 163 | #define MAX_BIT_FILTERS 64 |
160 | static int nr_bit_filters; | 164 | static int nr_bit_filters; |
@@ -163,9 +167,16 @@ static uint64_t opt_bits[MAX_BIT_FILTERS]; | |||
163 | 167 | ||
164 | static int page_size; | 168 | static int page_size; |
165 | 169 | ||
166 | #define PAGES_BATCH (64 << 10) /* 64k pages */ | 170 | static int pagemap_fd; |
167 | static int kpageflags_fd; | 171 | static int kpageflags_fd; |
168 | 172 | ||
173 | static int opt_hwpoison; | ||
174 | static int opt_unpoison; | ||
175 | |||
176 | static char *hwpoison_debug_fs = "/debug/hwpoison"; | ||
177 | static int hwpoison_inject_fd; | ||
178 | static int hwpoison_forget_fd; | ||
179 | |||
169 | #define HASH_SHIFT 13 | 180 | #define HASH_SHIFT 13 |
170 | #define HASH_SIZE (1 << HASH_SHIFT) | 181 | #define HASH_SIZE (1 << HASH_SHIFT) |
171 | #define HASH_MASK (HASH_SIZE - 1) | 182 | #define HASH_MASK (HASH_SIZE - 1) |
@@ -207,6 +218,74 @@ static void fatal(const char *x, ...) | |||
207 | exit(EXIT_FAILURE); | 218 | exit(EXIT_FAILURE); |
208 | } | 219 | } |
209 | 220 | ||
221 | int 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 | |||
237 | static 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 | |||
263 | static 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 | |||
270 | static 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 | |||
277 | static 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 | |||
210 | 289 | ||
211 | /* | 290 | /* |
212 | * page flag names | 291 | * page flag names |
@@ -255,7 +334,8 @@ static char *page_flag_longname(uint64_t flags) | |||
255 | * page list and summary | 334 | * page list and summary |
256 | */ | 335 | */ |
257 | 336 | ||
258 | static void show_page_range(unsigned long offset, uint64_t flags) | 337 | static void show_page_range(unsigned long voffset, |
338 | unsigned long offset, uint64_t flags) | ||
259 | { | 339 | { |
260 | static uint64_t flags0; | 340 | static uint64_t flags0; |
261 | static unsigned long voff; | 341 | static unsigned long voff; |
@@ -281,7 +361,8 @@ static void show_page_range(unsigned long offset, uint64_t flags) | |||
281 | count = 1; | 361 | count = 1; |
282 | } | 362 | } |
283 | 363 | ||
284 | static void show_page(unsigned long offset, uint64_t flags) | 364 | static void show_page(unsigned long voffset, |
365 | unsigned long offset, uint64_t flags) | ||
285 | { | 366 | { |
286 | if (opt_pid) | 367 | if (opt_pid) |
287 | printf("%lx\t", voffset); | 368 | printf("%lx\t", voffset); |
@@ -362,6 +443,62 @@ static uint64_t well_known_flags(uint64_t flags) | |||
362 | return flags; | 443 | return flags; |
363 | } | 444 | } |
364 | 445 | ||
446 | static 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 | |||
460 | static 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 | |||
475 | static 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 | |||
489 | static 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 | } | ||
365 | 502 | ||
366 | /* | 503 | /* |
367 | * page frame walker | 504 | * page frame walker |
@@ -394,104 +531,83 @@ static int hash_slot(uint64_t flags) | |||
394 | exit(EXIT_FAILURE); | 531 | exit(EXIT_FAILURE); |
395 | } | 532 | } |
396 | 533 | ||
397 | static void add_page(unsigned long offset, uint64_t flags) | 534 | static void add_page(unsigned long voffset, |
535 | unsigned long offset, uint64_t flags) | ||
398 | { | 536 | { |
399 | flags = expand_overloaded_flags(flags); | 537 | flags = kpageflags_flags(flags); |
400 | |||
401 | if (!opt_raw) | ||
402 | flags = well_known_flags(flags); | ||
403 | 538 | ||
404 | if (!bit_mask_ok(flags)) | 539 | if (!bit_mask_ok(flags)) |
405 | return; | 540 | return; |
406 | 541 | ||
542 | if (opt_hwpoison) | ||
543 | hwpoison_page(offset); | ||
544 | if (opt_unpoison) | ||
545 | unpoison_page(offset); | ||
546 | |||
407 | if (opt_list == 1) | 547 | if (opt_list == 1) |
408 | show_page_range(offset, flags); | 548 | show_page_range(voffset, offset, flags); |
409 | else if (opt_list == 2) | 549 | else if (opt_list == 2) |
410 | show_page(offset, flags); | 550 | show_page(voffset, offset, flags); |
411 | 551 | ||
412 | nr_pages[hash_slot(flags)]++; | 552 | nr_pages[hash_slot(flags)]++; |
413 | total_pages++; | 553 | total_pages++; |
414 | } | 554 | } |
415 | 555 | ||
416 | static void walk_pfn(unsigned long index, unsigned long count) | 556 | #define KPAGEFLAGS_BATCH (64 << 10) /* 64k pages */ |
557 | static void walk_pfn(unsigned long voffset, | ||
558 | unsigned long index, | ||
559 | unsigned long count) | ||
417 | { | 560 | { |
561 | uint64_t buf[KPAGEFLAGS_BATCH]; | ||
418 | unsigned long batch; | 562 | unsigned long batch; |
419 | unsigned long n; | 563 | unsigned long pages; |
420 | unsigned long i; | 564 | unsigned long i; |
421 | 565 | ||
422 | if (index > ULONG_MAX / KPF_BYTES) | ||
423 | fatal("index overflow: %lu\n", index); | ||
424 | |||
425 | lseek(kpageflags_fd, index * KPF_BYTES, SEEK_SET); | ||
426 | |||
427 | while (count) { | 566 | while (count) { |
428 | uint64_t kpageflags_buf[KPF_BYTES * PAGES_BATCH]; | 567 | batch = min_t(unsigned long, count, KPAGEFLAGS_BATCH); |
429 | 568 | pages = kpageflags_read(buf, index, batch); | |
430 | batch = min_t(unsigned long, count, PAGES_BATCH); | 569 | if (pages == 0) |
431 | n = read(kpageflags_fd, kpageflags_buf, batch * KPF_BYTES); | ||
432 | if (n == 0) | ||
433 | break; | 570 | break; |
434 | if (n < 0) { | ||
435 | perror(PROC_KPAGEFLAGS); | ||
436 | exit(EXIT_FAILURE); | ||
437 | } | ||
438 | 571 | ||
439 | if (n % KPF_BYTES != 0) | 572 | for (i = 0; i < pages; i++) |
440 | fatal("partial read: %lu bytes\n", n); | 573 | add_page(voffset + i, index + i, buf[i]); |
441 | n = n / KPF_BYTES; | ||
442 | 574 | ||
443 | for (i = 0; i < n; i++) | 575 | index += pages; |
444 | add_page(index + i, kpageflags_buf[i]); | 576 | count -= pages; |
445 | |||
446 | index += batch; | ||
447 | count -= batch; | ||
448 | } | 577 | } |
449 | } | 578 | } |
450 | 579 | ||
451 | 580 | #define PAGEMAP_BATCH (64 << 10) | |
452 | #define PAGEMAP_BATCH 4096 | 581 | static void walk_vma(unsigned long index, unsigned long count) |
453 | static unsigned long task_pfn(unsigned long pgoff) | ||
454 | { | 582 | { |
455 | static uint64_t buf[PAGEMAP_BATCH]; | 583 | uint64_t buf[PAGEMAP_BATCH]; |
456 | static unsigned long start; | 584 | unsigned long batch; |
457 | static long count; | 585 | unsigned long pages; |
458 | uint64_t pfn; | 586 | unsigned long pfn; |
587 | unsigned long i; | ||
459 | 588 | ||
460 | if (pgoff < start || pgoff >= start + count) { | 589 | while (count) { |
461 | if (lseek64(pagemap_fd, | 590 | batch = min_t(unsigned long, count, PAGEMAP_BATCH); |
462 | (uint64_t)pgoff * PM_ENTRY_BYTES, | 591 | pages = pagemap_read(buf, index, batch); |
463 | SEEK_SET) < 0) { | 592 | if (pages == 0) |
464 | perror("pagemap seek"); | 593 | break; |
465 | exit(EXIT_FAILURE); | ||
466 | } | ||
467 | count = read(pagemap_fd, buf, sizeof(buf)); | ||
468 | if (count == 0) | ||
469 | return 0; | ||
470 | if (count < 0) { | ||
471 | perror("pagemap read"); | ||
472 | exit(EXIT_FAILURE); | ||
473 | } | ||
474 | if (count % PM_ENTRY_BYTES) { | ||
475 | fatal("pagemap read not aligned.\n"); | ||
476 | exit(EXIT_FAILURE); | ||
477 | } | ||
478 | count /= PM_ENTRY_BYTES; | ||
479 | start = pgoff; | ||
480 | } | ||
481 | 594 | ||
482 | pfn = buf[pgoff - start]; | 595 | for (i = 0; i < pages; i++) { |
483 | if (pfn & PM_PRESENT) | 596 | pfn = pagemap_pfn(buf[i]); |
484 | pfn = PM_PFRAME(pfn); | 597 | if (pfn) |
485 | else | 598 | walk_pfn(index + i, pfn, 1); |
486 | pfn = 0; | 599 | } |
487 | 600 | ||
488 | return pfn; | 601 | index += pages; |
602 | count -= pages; | ||
603 | } | ||
489 | } | 604 | } |
490 | 605 | ||
491 | static void walk_task(unsigned long index, unsigned long count) | 606 | static void walk_task(unsigned long index, unsigned long count) |
492 | { | 607 | { |
493 | int i = 0; | ||
494 | const unsigned long end = index + count; | 608 | const unsigned long end = index + count; |
609 | unsigned long start; | ||
610 | int i = 0; | ||
495 | 611 | ||
496 | while (index < end) { | 612 | while (index < end) { |
497 | 613 | ||
@@ -501,15 +617,11 @@ static void walk_task(unsigned long index, unsigned long count) | |||
501 | if (pg_start[i] >= end) | 617 | if (pg_start[i] >= end) |
502 | return; | 618 | return; |
503 | 619 | ||
504 | voffset = max_t(unsigned long, pg_start[i], index); | 620 | start = max_t(unsigned long, pg_start[i], index); |
505 | index = min_t(unsigned long, pg_end[i], end); | 621 | index = min_t(unsigned long, pg_end[i], end); |
506 | 622 | ||
507 | assert(voffset < index); | 623 | assert(start < index); |
508 | for (; voffset < index; voffset++) { | 624 | walk_vma(start, index - start); |
509 | unsigned long pfn = task_pfn(voffset); | ||
510 | if (pfn) | ||
511 | walk_pfn(pfn, 1); | ||
512 | } | ||
513 | } | 625 | } |
514 | } | 626 | } |
515 | 627 | ||
@@ -527,18 +639,14 @@ static void walk_addr_ranges(void) | |||
527 | { | 639 | { |
528 | int i; | 640 | int i; |
529 | 641 | ||
530 | kpageflags_fd = open(PROC_KPAGEFLAGS, O_RDONLY); | 642 | kpageflags_fd = checked_open(PROC_KPAGEFLAGS, O_RDONLY); |
531 | if (kpageflags_fd < 0) { | ||
532 | perror(PROC_KPAGEFLAGS); | ||
533 | exit(EXIT_FAILURE); | ||
534 | } | ||
535 | 643 | ||
536 | if (!nr_addr_ranges) | 644 | if (!nr_addr_ranges) |
537 | add_addr_range(0, ULONG_MAX); | 645 | add_addr_range(0, ULONG_MAX); |
538 | 646 | ||
539 | for (i = 0; i < nr_addr_ranges; i++) | 647 | for (i = 0; i < nr_addr_ranges; i++) |
540 | if (!opt_pid) | 648 | if (!opt_pid) |
541 | walk_pfn(opt_offset[i], opt_size[i]); | 649 | walk_pfn(0, opt_offset[i], opt_size[i]); |
542 | else | 650 | else |
543 | walk_task(opt_offset[i], opt_size[i]); | 651 | walk_task(opt_offset[i], opt_size[i]); |
544 | 652 | ||
@@ -575,6 +683,8 @@ static void usage(void) | |||
575 | " -l|--list Show page details in ranges\n" | 683 | " -l|--list Show page details in ranges\n" |
576 | " -L|--list-each Show page details one by one\n" | 684 | " -L|--list-each Show page details one by one\n" |
577 | " -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" | ||
578 | " -h|--help Show this usage message\n" | 688 | " -h|--help Show this usage message\n" |
579 | "addr-spec:\n" | 689 | "addr-spec:\n" |
580 | " N one page at offset N (unit: pages)\n" | 690 | " N one page at offset N (unit: pages)\n" |
@@ -624,11 +734,7 @@ static void parse_pid(const char *str) | |||
624 | opt_pid = parse_number(str); | 734 | opt_pid = parse_number(str); |
625 | 735 | ||
626 | sprintf(buf, "/proc/%d/pagemap", opt_pid); | 736 | sprintf(buf, "/proc/%d/pagemap", opt_pid); |
627 | pagemap_fd = open(buf, O_RDONLY); | 737 | pagemap_fd = checked_open(buf, O_RDONLY); |
628 | if (pagemap_fd < 0) { | ||
629 | perror(buf); | ||
630 | exit(EXIT_FAILURE); | ||
631 | } | ||
632 | 738 | ||
633 | sprintf(buf, "/proc/%d/maps", opt_pid); | 739 | sprintf(buf, "/proc/%d/maps", opt_pid); |
634 | file = fopen(buf, "r"); | 740 | file = fopen(buf, "r"); |
@@ -788,6 +894,8 @@ static struct option opts[] = { | |||
788 | { "list" , 0, NULL, 'l' }, | 894 | { "list" , 0, NULL, 'l' }, |
789 | { "list-each" , 0, NULL, 'L' }, | 895 | { "list-each" , 0, NULL, 'L' }, |
790 | { "no-summary", 0, NULL, 'N' }, | 896 | { "no-summary", 0, NULL, 'N' }, |
897 | { "hwpoison" , 0, NULL, 'X' }, | ||
898 | { "unpoison" , 0, NULL, 'x' }, | ||
791 | { "help" , 0, NULL, 'h' }, | 899 | { "help" , 0, NULL, 'h' }, |
792 | { NULL , 0, NULL, 0 } | 900 | { NULL , 0, NULL, 0 } |
793 | }; | 901 | }; |
@@ -799,7 +907,7 @@ int main(int argc, char *argv[]) | |||
799 | page_size = getpagesize(); | 907 | page_size = getpagesize(); |
800 | 908 | ||
801 | while ((c = getopt_long(argc, argv, | 909 | while ((c = getopt_long(argc, argv, |
802 | "rp:f:a:b:lLNh", opts, NULL)) != -1) { | 910 | "rp:f:a:b:lLNXxh", opts, NULL)) != -1) { |
803 | switch (c) { | 911 | switch (c) { |
804 | case 'r': | 912 | case 'r': |
805 | opt_raw = 1; | 913 | opt_raw = 1; |
@@ -825,6 +933,14 @@ int main(int argc, char *argv[]) | |||
825 | case 'N': | 933 | case 'N': |
826 | opt_no_summary = 1; | 934 | opt_no_summary = 1; |
827 | 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; | ||
828 | case 'h': | 944 | case 'h': |
829 | usage(); | 945 | usage(); |
830 | exit(0); | 946 | exit(0); |
@@ -844,7 +960,7 @@ int main(int argc, char *argv[]) | |||
844 | walk_addr_ranges(); | 960 | walk_addr_ranges(); |
845 | 961 | ||
846 | if (opt_list == 1) | 962 | if (opt_list == 1) |
847 | show_page_range(0, 0); /* drain the buffer */ | 963 | show_page_range(0, 0, 0); /* drain the buffer */ |
848 | 964 | ||
849 | if (opt_no_summary) | 965 | if (opt_no_summary) |
850 | 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 | ||
62 | Short descriptions to the page flags: | 64 | Short descriptions to the page flags: |
63 | 65 | ||
@@ -86,9 +88,15 @@ Short descriptions to the page flags: | |||
86 | 17. HUGE | 88 | 17. HUGE |
87 | this is an integral part of a HugeTLB page | 89 | this is an integral part of a HugeTLB page |
88 | 90 | ||
91 | 19. HWPOISON | ||
92 | hardware detected memory corruption on this page: don't touch the data! | ||
93 | |||
89 | 20. NOPAGE | 94 | 20. NOPAGE |
90 | no page frame exists at the requested address | 95 | no page frame exists at the requested address |
91 | 96 | ||
97 | 21. 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 | ||
25 | Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. | 25 | Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. |
26 | However, the device cannot be detected without writing to the i2c bus, so no | 26 | However, the device cannot be detected without writing to the i2c bus, so no |
27 | detection is done. | 27 | detection is done. You should instantiate the device explicitly. |
28 | You 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 | ||