diff options
Diffstat (limited to 'Documentation')
27 files changed, 1813 insertions, 550 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-i2c-devices-hm6352 b/Documentation/ABI/testing/sysfs-bus-i2c-devices-hm6352 new file mode 100644 index 000000000000..feb2e4a87075 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-i2c-devices-hm6352 | |||
@@ -0,0 +1,21 @@ | |||
1 | Where: /sys/bus/i2c/devices/.../heading0_input | ||
2 | Date: April 2010 | ||
3 | Kernel Version: 2.6.36? | ||
4 | Contact: alan.cox@intel.com | ||
5 | Description: Reports the current heading from the compass as a floating | ||
6 | point value in degrees. | ||
7 | |||
8 | Where: /sys/bus/i2c/devices/.../power_state | ||
9 | Date: April 2010 | ||
10 | Kernel Version: 2.6.36? | ||
11 | Contact: alan.cox@intel.com | ||
12 | Description: Sets the power state of the device. 0 sets the device into | ||
13 | sleep mode, 1 wakes it up. | ||
14 | |||
15 | Where: /sys/bus/i2c/devices/.../calibration | ||
16 | Date: April 2010 | ||
17 | Kernel Version: 2.6.36? | ||
18 | Contact: alan.cox@intel.com | ||
19 | Description: Sets the calibration on or off (1 = on, 0 = off). See the | ||
20 | chip data sheet. | ||
21 | |||
diff --git a/Documentation/ABI/testing/sysfs-devices-platform-_UDC_-gadget b/Documentation/ABI/testing/sysfs-devices-platform-_UDC_-gadget index 34034027b13c..d548eaac230a 100644 --- a/Documentation/ABI/testing/sysfs-devices-platform-_UDC_-gadget +++ b/Documentation/ABI/testing/sysfs-devices-platform-_UDC_-gadget | |||
@@ -7,3 +7,15 @@ Description: | |||
7 | 0 -> resumed | 7 | 0 -> resumed |
8 | 8 | ||
9 | (_UDC_ is the name of the USB Device Controller driver) | 9 | (_UDC_ is the name of the USB Device Controller driver) |
10 | |||
11 | What: /sys/devices/platform/_UDC_/gadget/gadget-lunX/nofua | ||
12 | Date: July 2010 | ||
13 | Contact: Andy Shevchenko <andy.shevchenko@gmail.com> | ||
14 | Description: | ||
15 | Show or set the reaction on the FUA (Force Unit Access) bit in | ||
16 | the SCSI WRITE(10,12) commands when a gadget in USB Mass | ||
17 | Storage mode. | ||
18 | |||
19 | Possible values are: | ||
20 | 1 -> ignore the FUA flag | ||
21 | 0 -> obey the FUA flag | ||
diff --git a/Documentation/ABI/testing/sysfs-i2c-bmp085 b/Documentation/ABI/testing/sysfs-i2c-bmp085 new file mode 100644 index 000000000000..585962ad0465 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-i2c-bmp085 | |||
@@ -0,0 +1,31 @@ | |||
1 | What: /sys/bus/i2c/devices/<busnum>-<devaddr>/pressure0_input | ||
2 | Date: June 2010 | ||
3 | Contact: Christoph Mair <christoph.mair@gmail.com> | ||
4 | Description: Start a pressure measurement and read the result. Values | ||
5 | represent the ambient air pressure in pascal (0.01 millibar). | ||
6 | |||
7 | Reading: returns the current air pressure. | ||
8 | |||
9 | |||
10 | What: /sys/bus/i2c/devices/<busnum>-<devaddr>/temp0_input | ||
11 | Date: June 2010 | ||
12 | Contact: Christoph Mair <christoph.mair@gmail.com> | ||
13 | Description: Measure the ambient temperature. The returned value represents | ||
14 | the ambient temperature in units of 0.1 degree celsius. | ||
15 | |||
16 | Reading: returns the current temperature. | ||
17 | |||
18 | |||
19 | What: /sys/bus/i2c/devices/<busnum>-<devaddr>/oversampling | ||
20 | Date: June 2010 | ||
21 | Contact: Christoph Mair <christoph.mair@gmail.com> | ||
22 | Description: Tell the bmp085 to use more samples to calculate a pressure | ||
23 | value. When writing to this file the chip will use 2^x samples | ||
24 | to calculate the next pressure value with x being the value | ||
25 | written. Using this feature will decrease RMS noise and | ||
26 | increase the measurement time. | ||
27 | |||
28 | Reading: returns the current oversampling setting. | ||
29 | |||
30 | Writing: sets a new oversampling setting. | ||
31 | Accepted values: 0..3. | ||
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 72651f788f4e..689e2371095c 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -98,6 +98,17 @@ system, git, as a "commit log". See #15, below. | |||
98 | If your description starts to get long, that's a sign that you probably | 98 | If your description starts to get long, that's a sign that you probably |
99 | need to split up your patch. See #3, next. | 99 | need to split up your patch. See #3, next. |
100 | 100 | ||
101 | When you submit or resubmit a patch or patch series, include the | ||
102 | complete patch description and justification for it. Don't just | ||
103 | say that this is version N of the patch (series). Don't expect the | ||
104 | patch merger to refer back to earlier patch versions or referenced | ||
105 | URLs to find the patch description and put that into the patch. | ||
106 | I.e., the patch (series) and its description should be self-contained. | ||
107 | This benefits both the patch merger(s) and reviewers. Some reviewers | ||
108 | probably didn't even receive earlier versions of the patch. | ||
109 | |||
110 | If the patch fixes a logged bug entry, refer to that bug entry by | ||
111 | number and URL. | ||
101 | 112 | ||
102 | 113 | ||
103 | 3) Separate your changes. | 114 | 3) Separate your changes. |
diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-INDEX index c34e12440fec..2df0365f2dff 100644 --- a/Documentation/blackfin/00-INDEX +++ b/Documentation/blackfin/00-INDEX | |||
@@ -1,11 +1,8 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - This file | 2 | - This file |
3 | 3 | ||
4 | cachefeatures.txt | 4 | bfin-gpio-notes.txt |
5 | - Supported cache features. | ||
6 | |||
7 | Filesystems | ||
8 | - Requirements for mounting the root file system. | ||
9 | |||
10 | bfin-gpio-note.txt | ||
11 | - Notes in developing/using bfin-gpio driver. | 5 | - Notes in developing/using bfin-gpio driver. |
6 | |||
7 | bfin-spi-notes.txt | ||
8 | - Notes for using bfin spi bus driver. | ||
diff --git a/Documentation/blackfin/Filesystems b/Documentation/blackfin/Filesystems deleted file mode 100644 index 51260a1b8032..000000000000 --- a/Documentation/blackfin/Filesystems +++ /dev/null | |||
@@ -1,169 +0,0 @@ | |||
1 | /* | ||
2 | * File: Documentation/blackfin/Filesystems | ||
3 | * Based on: | ||
4 | * Author: | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: This file contains the simple DMA Implementation for Blackfin | ||
8 | * | ||
9 | * Rev: $Id: Filesystems 2384 2006-11-01 04:12:43Z magicyang $ | ||
10 | * | ||
11 | * Modified: | ||
12 | * Copyright 2004-2006 Analog Devices Inc. | ||
13 | * | ||
14 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | How to mount the root file system in uClinux/Blackfin | ||
19 | ----------------------------------------------------- | ||
20 | |||
21 | 1 Mounting EXT3 File system. | ||
22 | ------------------------ | ||
23 | |||
24 | Creating an EXT3 File system for uClinux/Blackfin: | ||
25 | |||
26 | |||
27 | Please follow the steps to form the EXT3 File system and mount the same as root | ||
28 | file system. | ||
29 | |||
30 | a Make an ext3 file system as large as you want the final root file | ||
31 | system. | ||
32 | |||
33 | mkfs.ext3 /dev/ram0 <your-rootfs-size-in-1k-blocks> | ||
34 | |||
35 | b Mount this Empty file system on a free directory as: | ||
36 | |||
37 | mount -t ext3 /dev/ram0 ./test | ||
38 | where ./test is the empty directory. | ||
39 | |||
40 | c Copy your root fs directory that you have so carefully made over. | ||
41 | |||
42 | cp -af /tmp/my_final_rootfs_files/* ./test | ||
43 | |||
44 | (For ex: cp -af uClinux-dist/romfs/* ./test) | ||
45 | |||
46 | d If you have done everything right till now you should be able to see | ||
47 | the required "root" dir's (that's etc, root, bin, lib, sbin...) | ||
48 | |||
49 | e Now unmount the file system | ||
50 | |||
51 | umount ./test | ||
52 | |||
53 | f Create the root file system image. | ||
54 | |||
55 | dd if=/dev/ram0 bs=1k count=<your-rootfs-size-in-1k-blocks> \ | ||
56 | > ext3fs.img | ||
57 | |||
58 | |||
59 | Now you have to tell the kernel that will be mounting this file system as | ||
60 | rootfs. | ||
61 | So do a make menuconfig under kernel and select the Ext3 journaling file system | ||
62 | support under File system --> submenu. | ||
63 | |||
64 | |||
65 | 2. Mounting EXT2 File system. | ||
66 | ------------------------- | ||
67 | |||
68 | By default the ext2 file system image will be created if you invoke make from | ||
69 | the top uClinux-dist directory. | ||
70 | |||
71 | |||
72 | 3. Mounting CRAMFS File System | ||
73 | ---------------------------- | ||
74 | |||
75 | To create a CRAMFS file system image execute the command | ||
76 | |||
77 | mkfs.cramfs ./test cramfs.img | ||
78 | |||
79 | where ./test is the target directory. | ||
80 | |||
81 | |||
82 | 4. Mounting ROMFS File System | ||
83 | -------------------------- | ||
84 | |||
85 | To create a ROMFS file system image execute the command | ||
86 | |||
87 | genromfs -v -V "ROMdisk" -f romfs.img -d ./test | ||
88 | |||
89 | where ./test is the target directory | ||
90 | |||
91 | |||
92 | 5. Mounting the JFFS2 Filesystem | ||
93 | ----------------------------- | ||
94 | |||
95 | To create a compressed JFFS filesystem (JFFS2), please execute the command | ||
96 | |||
97 | mkfs.jffs2 -d ./test -o jffs2.img | ||
98 | |||
99 | where ./test is the target directory. | ||
100 | |||
101 | However, please make sure the following is in your kernel config. | ||
102 | |||
103 | /* | ||
104 | * RAM/ROM/Flash chip drivers | ||
105 | */ | ||
106 | #define CONFIG_MTD_CFI 1 | ||
107 | #define CONFIG_MTD_ROM 1 | ||
108 | /* | ||
109 | * Mapping drivers for chip access | ||
110 | */ | ||
111 | #define CONFIG_MTD_COMPLEX_MAPPINGS 1 | ||
112 | #define CONFIG_MTD_BF533 1 | ||
113 | #undef CONFIG_MTD_UCLINUX | ||
114 | |||
115 | Through the u-boot boot loader, use the jffs2.img in the corresponding | ||
116 | partition made in linux-2.6.x/drivers/mtd/maps/bf533_flash.c. | ||
117 | |||
118 | NOTE - Currently the Flash driver is available only for EZKIT. Watch out for a | ||
119 | STAMP driver soon. | ||
120 | |||
121 | |||
122 | 6. Mounting the NFS File system | ||
123 | ----------------------------- | ||
124 | |||
125 | For mounting the NFS please do the following in the kernel config. | ||
126 | |||
127 | In Networking Support --> Networking options --> TCP/IP networking --> | ||
128 | IP: kernel level autoconfiguration | ||
129 | |||
130 | Enable BOOTP Support. | ||
131 | |||
132 | In Kernel hacking --> Compiled-in kernel boot parameter add the following | ||
133 | |||
134 | root=/dev/nfs rw ip=bootp | ||
135 | |||
136 | In File system --> Network File system, Enable | ||
137 | |||
138 | NFS file system support --> NFSv3 client support | ||
139 | Root File system on NFS | ||
140 | |||
141 | in uClibc menuconfig, do the following | ||
142 | In Networking Support | ||
143 | enable Remote Procedure Call (RPC) support | ||
144 | Full RPC Support | ||
145 | |||
146 | On the Host side, ensure that /etc/dhcpd.conf looks something like this | ||
147 | |||
148 | ddns-update-style ad-hoc; | ||
149 | allow bootp; | ||
150 | subnet 10.100.4.0 netmask 255.255.255.0 { | ||
151 | default-lease-time 122209600; | ||
152 | max-lease-time 31557600; | ||
153 | group { | ||
154 | host bf533 { | ||
155 | hardware ethernet 00:CF:52:49:C3:01; | ||
156 | fixed-address 10.100.4.50; | ||
157 | option root-path "/home/nfsmount"; | ||
158 | } | ||
159 | } | ||
160 | |||
161 | ensure that /etc/exports looks something like this | ||
162 | /home/nfsmount *(rw,no_root_squash,no_all_squash) | ||
163 | |||
164 | run the following commands as root (may differ depending on your | ||
165 | distribution) : | ||
166 | - service nfs start | ||
167 | - service portmap start | ||
168 | - service dhcpd start | ||
169 | - /usr/sbin/exportfs | ||
diff --git a/Documentation/blackfin/bfin-spi-notes.txt b/Documentation/blackfin/bfin-spi-notes.txt new file mode 100644 index 000000000000..556fa877f2e8 --- /dev/null +++ b/Documentation/blackfin/bfin-spi-notes.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | SPI Chip Select behavior: | ||
2 | |||
3 | With the Blackfin on-chip SPI peripheral, there is some logic tied to the CPHA | ||
4 | bit whether the Slave Select Line is controlled by hardware (CPHA=0) or | ||
5 | controlled by software (CPHA=1). However, the Linux SPI bus driver assumes that | ||
6 | the Slave Select is always under software control and being asserted during | ||
7 | the entire SPI transfer. - And not just bits_per_word duration. | ||
8 | |||
9 | In most cases you can utilize SPI MODE_3 instead of MODE_0 to work-around this | ||
10 | behavior. If your SPI slave device in question requires SPI MODE_0 or MODE_2 | ||
11 | timing, you can utilize the GPIO controlled SPI Slave Select option instead. | ||
12 | |||
13 | You can even use the same pin whose peripheral role is a SSEL, | ||
14 | but use it as a GPIO instead. | ||
diff --git a/Documentation/blackfin/cachefeatures.txt b/Documentation/blackfin/cachefeatures.txt deleted file mode 100644 index 75de51f94515..000000000000 --- a/Documentation/blackfin/cachefeatures.txt +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* | ||
2 | * File: Documentation/blackfin/cachefeatures.txt | ||
3 | * Based on: | ||
4 | * Author: | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: This file contains the simple DMA Implementation for Blackfin | ||
8 | * | ||
9 | * Rev: $Id: cachefeatures.txt 2384 2006-11-01 04:12:43Z magicyang $ | ||
10 | * | ||
11 | * Modified: | ||
12 | * Copyright 2004-2006 Analog Devices Inc. | ||
13 | * | ||
14 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | - Instruction and Data cache initialization. | ||
19 | icache_init(); | ||
20 | dcache_init(); | ||
21 | |||
22 | - Instruction and Data cache Invalidation Routines, when flushing the | ||
23 | same is not required. | ||
24 | _icache_invalidate(); | ||
25 | _dcache_invalidate(); | ||
26 | |||
27 | Also, for invalidating the entire instruction and data cache, the below | ||
28 | routines are provided (another method for invalidation, refer page no 267 and 287 of | ||
29 | ADSP-BF533 Hardware Reference manual) | ||
30 | |||
31 | invalidate_entire_dcache(); | ||
32 | invalidate_entire_icache(); | ||
33 | |||
34 | -External Flushing of Instruction and data cache routines. | ||
35 | |||
36 | flush_instruction_cache(); | ||
37 | flush_data_cache(); | ||
38 | |||
39 | - Internal Flushing of Instruction and Data Cache. | ||
40 | |||
41 | icplb_flush(); | ||
42 | dcplb_flush(); | ||
43 | |||
44 | - Miscellaneous cache functions. | ||
45 | |||
46 | flush_cache_all(); | ||
47 | flush_cache_mm(); | ||
48 | invalidate_dcache_range(); | ||
49 | flush_dcache_range(); | ||
50 | flush_dcache_page(); | ||
51 | flush_cache_range(); | ||
52 | flush_cache_page(); | ||
53 | invalidate_dcache_range(); | ||
54 | flush_page_to_ram(); | ||
55 | |||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 71f0fea1058f..b16cbe4152ea 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -151,6 +151,31 @@ Who: Eric Biederman <ebiederm@xmission.com> | |||
151 | 151 | ||
152 | --------------------------- | 152 | --------------------------- |
153 | 153 | ||
154 | What: /proc/<pid>/oom_adj | ||
155 | When: August 2012 | ||
156 | Why: /proc/<pid>/oom_adj allows userspace to influence the oom killer's | ||
157 | badness heuristic used to determine which task to kill when the kernel | ||
158 | is out of memory. | ||
159 | |||
160 | The badness heuristic has since been rewritten since the introduction of | ||
161 | this tunable such that its meaning is deprecated. The value was | ||
162 | implemented as a bitshift on a score generated by the badness() | ||
163 | function that did not have any precise units of measure. With the | ||
164 | rewrite, the score is given as a proportion of available memory to the | ||
165 | task allocating pages, so using a bitshift which grows the score | ||
166 | exponentially is, thus, impossible to tune with fine granularity. | ||
167 | |||
168 | A much more powerful interface, /proc/<pid>/oom_score_adj, was | ||
169 | introduced with the oom killer rewrite that allows users to increase or | ||
170 | decrease the badness() score linearly. This interface will replace | ||
171 | /proc/<pid>/oom_adj. | ||
172 | |||
173 | A warning will be emitted to the kernel log if an application uses this | ||
174 | deprecated interface. After it is printed once, future warnings will be | ||
175 | suppressed until the kernel is rebooted. | ||
176 | |||
177 | --------------------------- | ||
178 | |||
154 | What: remove EXPORT_SYMBOL(kernel_thread) | 179 | What: remove EXPORT_SYMBOL(kernel_thread) |
155 | When: August 2006 | 180 | When: August 2006 |
156 | Files: arch/*/kernel/*_ksyms.c | 181 | Files: arch/*/kernel/*_ksyms.c |
@@ -335,14 +360,6 @@ When: 2.6.33 | |||
335 | Why: Should be implemented in userspace, policy daemon. | 360 | Why: Should be implemented in userspace, policy daemon. |
336 | Who: Johannes Berg <johannes@sipsolutions.net> | 361 | Who: Johannes Berg <johannes@sipsolutions.net> |
337 | 362 | ||
338 | --------------------------- | ||
339 | |||
340 | What: CONFIG_INOTIFY | ||
341 | When: 2.6.33 | ||
342 | Why: last user (audit) will be converted to the newer more generic | ||
343 | and more easily maintained fsnotify subsystem | ||
344 | Who: Eric Paris <eparis@redhat.com> | ||
345 | |||
346 | ---------------------------- | 363 | ---------------------------- |
347 | 364 | ||
348 | What: sound-slot/service-* module aliases and related clutters in | 365 | What: sound-slot/service-* module aliases and related clutters in |
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 96d4293607ec..bbcc15651a21 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -92,8 +92,8 @@ prototypes: | |||
92 | void (*destroy_inode)(struct inode *); | 92 | void (*destroy_inode)(struct inode *); |
93 | void (*dirty_inode) (struct inode *); | 93 | void (*dirty_inode) (struct inode *); |
94 | int (*write_inode) (struct inode *, int); | 94 | int (*write_inode) (struct inode *, int); |
95 | void (*drop_inode) (struct inode *); | 95 | int (*drop_inode) (struct inode *); |
96 | void (*delete_inode) (struct inode *); | 96 | void (*evict_inode) (struct inode *); |
97 | void (*put_super) (struct super_block *); | 97 | void (*put_super) (struct super_block *); |
98 | void (*write_super) (struct super_block *); | 98 | void (*write_super) (struct super_block *); |
99 | int (*sync_fs)(struct super_block *sb, int wait); | 99 | int (*sync_fs)(struct super_block *sb, int wait); |
@@ -101,14 +101,13 @@ prototypes: | |||
101 | int (*unfreeze_fs) (struct super_block *); | 101 | int (*unfreeze_fs) (struct super_block *); |
102 | int (*statfs) (struct dentry *, struct kstatfs *); | 102 | int (*statfs) (struct dentry *, struct kstatfs *); |
103 | int (*remount_fs) (struct super_block *, int *, char *); | 103 | int (*remount_fs) (struct super_block *, int *, char *); |
104 | void (*clear_inode) (struct inode *); | ||
105 | void (*umount_begin) (struct super_block *); | 104 | void (*umount_begin) (struct super_block *); |
106 | int (*show_options)(struct seq_file *, struct vfsmount *); | 105 | int (*show_options)(struct seq_file *, struct vfsmount *); |
107 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 106 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
108 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 107 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
109 | 108 | ||
110 | locking rules: | 109 | locking rules: |
111 | All may block. | 110 | All may block [not true, see below] |
112 | None have BKL | 111 | None have BKL |
113 | s_umount | 112 | s_umount |
114 | alloc_inode: | 113 | alloc_inode: |
@@ -116,22 +115,25 @@ destroy_inode: | |||
116 | dirty_inode: (must not sleep) | 115 | dirty_inode: (must not sleep) |
117 | write_inode: | 116 | write_inode: |
118 | drop_inode: !!!inode_lock!!! | 117 | drop_inode: !!!inode_lock!!! |
119 | delete_inode: | 118 | evict_inode: |
120 | put_super: write | 119 | put_super: write |
121 | write_super: read | 120 | write_super: read |
122 | sync_fs: read | 121 | sync_fs: read |
123 | freeze_fs: read | 122 | freeze_fs: read |
124 | unfreeze_fs: read | 123 | unfreeze_fs: read |
125 | statfs: no | 124 | statfs: maybe(read) (see below) |
126 | remount_fs: maybe (see below) | 125 | remount_fs: write |
127 | clear_inode: | ||
128 | umount_begin: no | 126 | umount_begin: no |
129 | show_options: no (namespace_sem) | 127 | show_options: no (namespace_sem) |
130 | quota_read: no (see below) | 128 | quota_read: no (see below) |
131 | quota_write: no (see below) | 129 | quota_write: no (see below) |
132 | 130 | ||
133 | ->remount_fs() will have the s_umount exclusive lock if it's already mounted. | 131 | ->statfs() has s_umount (shared) when called by ustat(2) (native or |
134 | When called from get_sb_single, it does NOT have the s_umount lock. | 132 | compat), but that's an accident of bad API; s_umount is used to pin |
133 | the superblock down when we only have dev_t given us by userland to | ||
134 | identify the superblock. Everything else (statfs(), fstatfs(), etc.) | ||
135 | doesn't hold it when calling ->statfs() - superblock is pinned down | ||
136 | by resolving the pathname passed to syscall. | ||
135 | ->quota_read() and ->quota_write() functions are both guaranteed to | 137 | ->quota_read() and ->quota_write() functions are both guaranteed to |
136 | be the only ones operating on the quota file by the quota code (via | 138 | be the only ones operating on the quota file by the quota code (via |
137 | dqio_sem) (unless an admin really wants to screw up something and | 139 | dqio_sem) (unless an admin really wants to screw up something and |
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index a7e9746ee7ea..b12c89538680 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -273,3 +273,48 @@ it's safe to remove it. If you don't need it, remove it. | |||
273 | deliberate; as soon as struct block_device * is propagated in a reasonable | 273 | deliberate; as soon as struct block_device * is propagated in a reasonable |
274 | way by that code fixing will become trivial; until then nothing can be | 274 | way by that code fixing will become trivial; until then nothing can be |
275 | done. | 275 | done. |
276 | |||
277 | [mandatory] | ||
278 | |||
279 | block truncatation on error exit from ->write_begin, and ->direct_IO | ||
280 | moved from generic methods (block_write_begin, cont_write_begin, | ||
281 | nobh_write_begin, blockdev_direct_IO*) to callers. Take a look at | ||
282 | ext2_write_failed and callers for an example. | ||
283 | |||
284 | [mandatory] | ||
285 | |||
286 | ->truncate is going away. The whole truncate sequence needs to be | ||
287 | implemented in ->setattr, which is now mandatory for filesystems | ||
288 | implementing on-disk size changes. Start with a copy of the old inode_setattr | ||
289 | and vmtruncate, and the reorder the vmtruncate + foofs_vmtruncate sequence to | ||
290 | be in order of zeroing blocks using block_truncate_page or similar helpers, | ||
291 | size update and on finally on-disk truncation which should not fail. | ||
292 | inode_change_ok now includes the size checks for ATTR_SIZE and must be called | ||
293 | in the beginning of ->setattr unconditionally. | ||
294 | |||
295 | [mandatory] | ||
296 | |||
297 | ->clear_inode() and ->delete_inode() are gone; ->evict_inode() should | ||
298 | be used instead. It gets called whenever the inode is evicted, whether it has | ||
299 | remaining links or not. Caller does *not* evict the pagecache or inode-associated | ||
300 | metadata buffers; getting rid of those is responsibility of method, as it had | ||
301 | been for ->delete_inode(). | ||
302 | ->drop_inode() returns int now; it's called on final iput() with inode_lock | ||
303 | held and it returns true if filesystems wants the inode to be dropped. As before, | ||
304 | generic_drop_inode() is still the default and it's been updated appropriately. | ||
305 | generic_delete_inode() is also alive and it consists simply of return 1. Note that | ||
306 | all actual eviction work is done by caller after ->drop_inode() returns. | ||
307 | clear_inode() is gone; use end_writeback() instead. As before, it must | ||
308 | be called exactly once on each call of ->evict_inode() (as it used to be for | ||
309 | each call of ->delete_inode()). Unlike before, if you are using inode-associated | ||
310 | metadata buffers (i.e. mark_buffer_dirty_inode()), it's your responsibility to | ||
311 | call invalidate_inode_buffers() before end_writeback(). | ||
312 | No async writeback (and thus no calls of ->write_inode()) will happen | ||
313 | after end_writeback() returns, so actions that should not overlap with ->write_inode() | ||
314 | (e.g. freeing on-disk inode if i_nlink is 0) ought to be done after that call. | ||
315 | |||
316 | NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out | ||
317 | if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput() | ||
318 | may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly | ||
319 | free the on-disk inode, you may end up doing that while ->write_inode() is writing | ||
320 | to it. | ||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 8fe8895894d8..a6aca8740883 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -33,7 +33,8 @@ Table of Contents | |||
33 | 2 Modifying System Parameters | 33 | 2 Modifying System Parameters |
34 | 34 | ||
35 | 3 Per-Process Parameters | 35 | 3 Per-Process Parameters |
36 | 3.1 /proc/<pid>/oom_adj - Adjust the oom-killer score | 36 | 3.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj - Adjust the oom-killer |
37 | score | ||
37 | 3.2 /proc/<pid>/oom_score - Display current oom-killer score | 38 | 3.2 /proc/<pid>/oom_score - Display current oom-killer score |
38 | 3.3 /proc/<pid>/io - Display the IO accounting fields | 39 | 3.3 /proc/<pid>/io - Display the IO accounting fields |
39 | 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings | 40 | 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings |
@@ -1234,42 +1235,64 @@ of the kernel. | |||
1234 | CHAPTER 3: PER-PROCESS PARAMETERS | 1235 | CHAPTER 3: PER-PROCESS PARAMETERS |
1235 | ------------------------------------------------------------------------------ | 1236 | ------------------------------------------------------------------------------ |
1236 | 1237 | ||
1237 | 3.1 /proc/<pid>/oom_adj - Adjust the oom-killer score | 1238 | 3.1 /proc/<pid>/oom_adj & /proc/<pid>/oom_score_adj- Adjust the oom-killer score |
1238 | ------------------------------------------------------ | 1239 | -------------------------------------------------------------------------------- |
1239 | 1240 | ||
1240 | This file can be used to adjust the score used to select which processes | 1241 | These file can be used to adjust the badness heuristic used to select which |
1241 | should be killed in an out-of-memory situation. Giving it a high score will | 1242 | process gets killed in out of memory conditions. |
1242 | increase the likelihood of this process being killed by the oom-killer. Valid | 1243 | |
1243 | values are in the range -16 to +15, plus the special value -17, which disables | 1244 | The badness heuristic assigns a value to each candidate task ranging from 0 |
1244 | oom-killing altogether for this process. | 1245 | (never kill) to 1000 (always kill) to determine which process is targeted. The |
1245 | 1246 | units are roughly a proportion along that range of allowed memory the process | |
1246 | The process to be killed in an out-of-memory situation is selected among all others | 1247 | may allocate from based on an estimation of its current memory and swap use. |
1247 | based on its badness score. This value equals the original memory size of the process | 1248 | For example, if a task is using all allowed memory, its badness score will be |
1248 | and is then updated according to its CPU time (utime + stime) and the | 1249 | 1000. If it is using half of its allowed memory, its score will be 500. |
1249 | run time (uptime - start time). The longer it runs the smaller is the score. | 1250 | |
1250 | Badness score is divided by the square root of the CPU time and then by | 1251 | There is an additional factor included in the badness score: root |
1251 | the double square root of the run time. | 1252 | processes are given 3% extra memory over other tasks. |
1252 | 1253 | ||
1253 | Swapped out tasks are killed first. Half of each child's memory size is added to | 1254 | The amount of "allowed" memory depends on the context in which the oom killer |
1254 | the parent's score if they do not share the same memory. Thus forking servers | 1255 | was called. If it is due to the memory assigned to the allocating task's cpuset |
1255 | are the prime candidates to be killed. Having only one 'hungry' child will make | 1256 | being exhausted, the allowed memory represents the set of mems assigned to that |
1256 | parent less preferable than the child. | 1257 | cpuset. If it is due to a mempolicy's node(s) being exhausted, the allowed |
1257 | 1258 | memory represents the set of mempolicy nodes. If it is due to a memory | |
1258 | /proc/<pid>/oom_score shows process' current badness score. | 1259 | limit (or swap limit) being reached, the allowed memory is that configured |
1259 | 1260 | limit. Finally, if it is due to the entire system being out of memory, the | |
1260 | The following heuristics are then applied: | 1261 | allowed memory represents all allocatable resources. |
1261 | * if the task was reniced, its score doubles | 1262 | |
1262 | * superuser or direct hardware access tasks (CAP_SYS_ADMIN, CAP_SYS_RESOURCE | 1263 | The value of /proc/<pid>/oom_score_adj is added to the badness score before it |
1263 | or CAP_SYS_RAWIO) have their score divided by 4 | 1264 | is used to determine which task to kill. Acceptable values range from -1000 |
1264 | * if oom condition happened in one cpuset and checked process does not belong | 1265 | (OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX). This allows userspace to |
1265 | to it, its score is divided by 8 | 1266 | polarize the preference for oom killing either by always preferring a certain |
1266 | * the resulting score is multiplied by two to the power of oom_adj, i.e. | 1267 | task or completely disabling it. The lowest possible value, -1000, is |
1267 | points <<= oom_adj when it is positive and | 1268 | equivalent to disabling oom killing entirely for that task since it will always |
1268 | points >>= -(oom_adj) otherwise | 1269 | report a badness score of 0. |
1269 | 1270 | ||
1270 | The task with the highest badness score is then selected and its children | 1271 | Consequently, it is very simple for userspace to define the amount of memory to |
1271 | are killed, process itself will be killed in an OOM situation when it does | 1272 | consider for each task. Setting a /proc/<pid>/oom_score_adj value of +500, for |
1272 | not have children or some of them disabled oom like described above. | 1273 | example, is roughly equivalent to allowing the remainder of tasks sharing the |
1274 | same system, cpuset, mempolicy, or memory controller resources to use at least | ||
1275 | 50% more memory. A value of -500, on the other hand, would be roughly | ||
1276 | equivalent to discounting 50% of the task's allowed memory from being considered | ||
1277 | as scoring against the task. | ||
1278 | |||
1279 | For backwards compatibility with previous kernels, /proc/<pid>/oom_adj may also | ||
1280 | be used to tune the badness score. Its acceptable values range from -16 | ||
1281 | (OOM_ADJUST_MIN) to +15 (OOM_ADJUST_MAX) and a special value of -17 | ||
1282 | (OOM_DISABLE) to disable oom killing entirely for that task. Its value is | ||
1283 | scaled linearly with /proc/<pid>/oom_score_adj. | ||
1284 | |||
1285 | Writing to /proc/<pid>/oom_score_adj or /proc/<pid>/oom_adj will change the | ||
1286 | other with its scaled value. | ||
1287 | |||
1288 | NOTICE: /proc/<pid>/oom_adj is deprecated and will be removed, please see | ||
1289 | Documentation/feature-removal-schedule.txt. | ||
1290 | |||
1291 | Caveat: when a parent task is selected, the oom killer will sacrifice any first | ||
1292 | generation children with seperate address spaces instead, if possible. This | ||
1293 | avoids servers and important system daemons from being killed and loses the | ||
1294 | minimal amount of work. | ||
1295 | |||
1273 | 1296 | ||
1274 | 3.2 /proc/<pid>/oom_score - Display current oom-killer score | 1297 | 3.2 /proc/<pid>/oom_score - Display current oom-killer score |
1275 | ------------------------------------------------------------- | 1298 | ------------------------------------------------------------- |
diff --git a/Documentation/hwmon/coretemp b/Documentation/hwmon/coretemp index 92267b62db59..25568f844804 100644 --- a/Documentation/hwmon/coretemp +++ b/Documentation/hwmon/coretemp | |||
@@ -21,8 +21,8 @@ Temperature is measured in degrees Celsius and measurement resolution is | |||
21 | 1 degree C. Valid temperatures are from 0 to TjMax degrees C, because | 21 | 1 degree C. Valid temperatures are from 0 to TjMax degrees C, because |
22 | the actual value of temperature register is in fact a delta from TjMax. | 22 | the actual value of temperature register is in fact a delta from TjMax. |
23 | 23 | ||
24 | Temperature known as TjMax is the maximum junction temperature of processor. | 24 | Temperature known as TjMax is the maximum junction temperature of processor, |
25 | Intel defines this temperature as 85C or 100C. At this temperature, protection | 25 | which depends on the CPU model. See table below. At this temperature, protection |
26 | mechanism will perform actions to forcibly cool down the processor. Alarm | 26 | mechanism will perform actions to forcibly cool down the processor. Alarm |
27 | may be raised, if the temperature grows enough (more than TjMax) to trigger | 27 | may be raised, if the temperature grows enough (more than TjMax) to trigger |
28 | the Out-Of-Spec bit. Following table summarizes the exported sysfs files: | 28 | the Out-Of-Spec bit. Following table summarizes the exported sysfs files: |
@@ -38,3 +38,104 @@ temp1_label - Contains string "Core X", where X is processor | |||
38 | The TjMax temperature is set to 85 degrees C if undocumented model specific | 38 | The TjMax temperature is set to 85 degrees C if undocumented model specific |
39 | register (UMSR) 0xee has bit 30 set. If not the TjMax is 100 degrees C as | 39 | register (UMSR) 0xee has bit 30 set. If not the TjMax is 100 degrees C as |
40 | (sometimes) documented in processor datasheet. | 40 | (sometimes) documented in processor datasheet. |
41 | |||
42 | Appendix A. Known TjMax lists (TBD): | ||
43 | Some information comes from ark.intel.com | ||
44 | |||
45 | Process Processor TjMax(C) | ||
46 | |||
47 | 32nm Core i3/i5/i7 Processors | ||
48 | i7 660UM/640/620, 640LM/620, 620M, 610E 105 | ||
49 | i5 540UM/520/430, 540M/520/450/430 105 | ||
50 | i3 330E, 370M/350/330 90 rPGA, 105 BGA | ||
51 | i3 330UM 105 | ||
52 | |||
53 | 32nm Core i7 Extreme Processors | ||
54 | 980X 100 | ||
55 | |||
56 | 32nm Celeron Processors | ||
57 | U3400 105 | ||
58 | P4505/P4500 90 | ||
59 | |||
60 | 45nm Xeon Processors 5400 Quad-Core | ||
61 | X5492, X5482, X5472, X5470, X5460, X5450 85 | ||
62 | E5472, E5462, E5450/40/30/20/10/05 85 | ||
63 | L5408 95 | ||
64 | L5430, L5420, L5410 70 | ||
65 | |||
66 | 45nm Xeon Processors 5200 Dual-Core | ||
67 | X5282, X5272, X5270, X5260 90 | ||
68 | E5240 90 | ||
69 | E5205, E5220 70, 90 | ||
70 | L5240 70 | ||
71 | L5238, L5215 95 | ||
72 | |||
73 | 45nm Atom Processors | ||
74 | D525/510/425/410 100 | ||
75 | Z560/550/540/530P/530/520PT/520/515/510PT/510P 90 | ||
76 | Z510/500 90 | ||
77 | N475/470/455/450 100 | ||
78 | N280/270 90 | ||
79 | 330/230 125 | ||
80 | |||
81 | 45nm Core2 Processors | ||
82 | Solo ULV SU3500/3300 100 | ||
83 | T9900/9800/9600/9550/9500/9400/9300/8300/8100 105 | ||
84 | T6670/6500/6400 105 | ||
85 | T6600 90 | ||
86 | SU9600/9400/9300 105 | ||
87 | SP9600/9400 105 | ||
88 | SL9600/9400/9380/9300 105 | ||
89 | P9700/9600/9500/8800/8700/8600/8400/7570 105 | ||
90 | P7550/7450 90 | ||
91 | |||
92 | 45nm Core2 Quad Processors | ||
93 | Q9100/9000 100 | ||
94 | |||
95 | 45nm Core2 Extreme Processors | ||
96 | X9100/9000 105 | ||
97 | QX9300 100 | ||
98 | |||
99 | 45nm Core i3/i5/i7 Processors | ||
100 | i7 940XM/920 100 | ||
101 | i7 840QM/820/740/720 100 | ||
102 | |||
103 | 45nm Celeron Processors | ||
104 | SU2300 100 | ||
105 | 900 105 | ||
106 | |||
107 | 65nm Core2 Duo Processors | ||
108 | Solo U2200, U2100 100 | ||
109 | U7700/7600/7500 100 | ||
110 | T7800/7700/7600/7500/7400/7300/7250/7200/7100 100 | ||
111 | T5870/5670/5600/5550/5500/5470/5450/5300/5270 100 | ||
112 | T5250 100 | ||
113 | T5800/5750/5200 85 | ||
114 | L7700/7500/7400/7300/7200 100 | ||
115 | |||
116 | 65nm Core2 Extreme Processors | ||
117 | X7900/7800 100 | ||
118 | |||
119 | 65nm Core Duo Processors | ||
120 | U2500/2400 100 | ||
121 | T2700/2600/2450/2400/2350/2300E/2300/2250/2050 100 | ||
122 | L2500/2400/2300 100 | ||
123 | |||
124 | 65nm Core Solo Processors | ||
125 | U1500/1400/1300 100 | ||
126 | T1400/1350/1300/1250 100 | ||
127 | |||
128 | 65nm Xeon Processors 5000 Quad-Core | ||
129 | X5000 90-95 | ||
130 | E5000 80 | ||
131 | L5000 70 | ||
132 | L5318 95 | ||
133 | |||
134 | 65nm Xeon Processors 5000 Dual-Core | ||
135 | 5080, 5063, 5060, 5050, 5030 80-90 | ||
136 | 5160, 5150, 5148, 5140, 5130, 5120, 5110 80 | ||
137 | L5138 100 | ||
138 | |||
139 | 65nm Celeron Processors | ||
140 | T1700/1600 100 | ||
141 | 560/550/540/530 100 | ||
diff --git a/Documentation/hwmon/f71882fg b/Documentation/hwmon/f71882fg index a7952c2bd959..1a07fd674cd0 100644 --- a/Documentation/hwmon/f71882fg +++ b/Documentation/hwmon/f71882fg | |||
@@ -2,6 +2,10 @@ Kernel driver f71882fg | |||
2 | ====================== | 2 | ====================== |
3 | 3 | ||
4 | Supported chips: | 4 | Supported chips: |
5 | * Fintek F71808E | ||
6 | Prefix: 'f71808fg' | ||
7 | Addresses scanned: none, address read from Super I/O config space | ||
8 | Datasheet: Not public | ||
5 | * Fintek F71858FG | 9 | * Fintek F71858FG |
6 | Prefix: 'f71858fg' | 10 | Prefix: 'f71858fg' |
7 | Addresses scanned: none, address read from Super I/O config space | 11 | Addresses scanned: none, address read from Super I/O config space |
diff --git a/Documentation/hwmon/jc42 b/Documentation/hwmon/jc42 new file mode 100644 index 000000000000..0e76ef12e4c6 --- /dev/null +++ b/Documentation/hwmon/jc42 | |||
@@ -0,0 +1,97 @@ | |||
1 | Kernel driver jc42 | ||
2 | ================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Analog Devices ADT7408 | ||
6 | Prefix: 'adt7408' | ||
7 | Addresses scanned: I2C 0x18 - 0x1f | ||
8 | Datasheets: | ||
9 | http://www.analog.com/static/imported-files/data_sheets/ADT7408.pdf | ||
10 | * IDT TSE2002B3, TS3000B3 | ||
11 | Prefix: 'tse2002b3', 'ts3000b3' | ||
12 | Addresses scanned: I2C 0x18 - 0x1f | ||
13 | Datasheets: | ||
14 | http://www.idt.com/products/getdoc.cfm?docid=18715691 | ||
15 | http://www.idt.com/products/getdoc.cfm?docid=18715692 | ||
16 | * Maxim MAX6604 | ||
17 | Prefix: 'max6604' | ||
18 | Addresses scanned: I2C 0x18 - 0x1f | ||
19 | Datasheets: | ||
20 | http://datasheets.maxim-ic.com/en/ds/MAX6604.pdf | ||
21 | * Microchip MCP9805, MCP98242, MCP98243, MCP9843 | ||
22 | Prefixes: 'mcp9805', 'mcp98242', 'mcp98243', 'mcp9843' | ||
23 | Addresses scanned: I2C 0x18 - 0x1f | ||
24 | Datasheets: | ||
25 | http://ww1.microchip.com/downloads/en/DeviceDoc/21977b.pdf | ||
26 | http://ww1.microchip.com/downloads/en/DeviceDoc/21996a.pdf | ||
27 | http://ww1.microchip.com/downloads/en/DeviceDoc/22153c.pdf | ||
28 | * NXP Semiconductors SE97, SE97B | ||
29 | Prefix: 'se97' | ||
30 | Addresses scanned: I2C 0x18 - 0x1f | ||
31 | Datasheets: | ||
32 | http://www.nxp.com/documents/data_sheet/SE97.pdf | ||
33 | http://www.nxp.com/documents/data_sheet/SE97B.pdf | ||
34 | * NXP Semiconductors SE98 | ||
35 | Prefix: 'se98' | ||
36 | Addresses scanned: I2C 0x18 - 0x1f | ||
37 | Datasheets: | ||
38 | http://www.nxp.com/documents/data_sheet/SE98.pdf | ||
39 | * ON Semiconductor CAT34TS02, CAT6095 | ||
40 | Prefix: 'cat34ts02', 'cat6095' | ||
41 | Addresses scanned: I2C 0x18 - 0x1f | ||
42 | Datasheet: | ||
43 | http://www.onsemi.com/pub_link/Collateral/CAT34TS02-D.PDF | ||
44 | http://www.onsemi.com/pub/Collateral/CAT6095-D.PDF | ||
45 | * ST Microelectronics STTS424, STTS424E02 | ||
46 | Prefix: 'stts424' | ||
47 | Addresses scanned: I2C 0x18 - 0x1f | ||
48 | Datasheets: | ||
49 | http://www.st.com/stonline/products/literature/ds/13447/stts424.pdf | ||
50 | http://www.st.com/stonline/products/literature/ds/13448/stts424e02.pdf | ||
51 | * JEDEC JC 42.4 compliant temperature sensor chips | ||
52 | Prefix: 'jc42' | ||
53 | Addresses scanned: I2C 0x18 - 0x1f | ||
54 | Datasheet: - | ||
55 | |||
56 | Author: | ||
57 | Guenter Roeck <guenter.roeck@ericsson.com> | ||
58 | |||
59 | |||
60 | Description | ||
61 | ----------- | ||
62 | |||
63 | This driver implements support for JEDEC JC 42.4 compliant temperature sensors. | ||
64 | The driver auto-detects the chips listed above, but can be manually instantiated | ||
65 | to support other JC 42.4 compliant chips. | ||
66 | |||
67 | Example: the following will load the driver for a generic JC 42.4 compliant | ||
68 | temperature sensor at address 0x18 on I2C bus #1: | ||
69 | |||
70 | # modprobe jc42 | ||
71 | # echo jc42 0x18 > /sys/bus/i2c/devices/i2c-1/new_device | ||
72 | |||
73 | A JC 42.4 compliant chip supports a single temperature sensor. Minimum, maximum, | ||
74 | and critical temperature can be configured. There are alarms for high, low, | ||
75 | and critical thresholds. | ||
76 | |||
77 | There is also an hysteresis to control the thresholds for resetting alarms. | ||
78 | Per JC 42.4 specification, the hysteresis threshold can be configured to 0, 1.5, | ||
79 | 3.0, and 6.0 degrees C. Configured hysteresis values will be rounded to those | ||
80 | limits. The chip supports only a single register to configure the hysteresis, | ||
81 | which applies to all limits. This register can be written by writing into | ||
82 | temp1_crit_hyst. Other hysteresis attributes are read-only. | ||
83 | |||
84 | Sysfs entries | ||
85 | ------------- | ||
86 | |||
87 | temp1_input Temperature (RO) | ||
88 | temp1_min Minimum temperature (RW) | ||
89 | temp1_max Maximum temperature (RW) | ||
90 | temp1_crit Critical high temperature (RW) | ||
91 | |||
92 | temp1_crit_hyst Critical hysteresis temperature (RW) | ||
93 | temp1_max_hyst Maximum hysteresis temperature (RO) | ||
94 | |||
95 | temp1_min_alarm Temperature low alarm | ||
96 | temp1_max_alarm Temperature high alarm | ||
97 | temp1_crit_alarm Temperature critical alarm | ||
diff --git a/Documentation/hwmon/smm665 b/Documentation/hwmon/smm665 new file mode 100644 index 000000000000..3820fc9ca52d --- /dev/null +++ b/Documentation/hwmon/smm665 | |||
@@ -0,0 +1,157 @@ | |||
1 | Kernel driver smm665 | ||
2 | ==================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Summit Microelectronics SMM465 | ||
6 | Prefix: 'smm465' | ||
7 | Addresses scanned: - | ||
8 | Datasheet: | ||
9 | http://www.summitmicro.com/prod_select/summary/SMM465/SMM465DS.pdf | ||
10 | * Summit Microelectronics SMM665, SMM665B | ||
11 | Prefix: 'smm665' | ||
12 | Addresses scanned: - | ||
13 | Datasheet: | ||
14 | http://www.summitmicro.com/prod_select/summary/SMM665/SMM665B_2089_20.pdf | ||
15 | * Summit Microelectronics SMM665C | ||
16 | Prefix: 'smm665c' | ||
17 | Addresses scanned: - | ||
18 | Datasheet: | ||
19 | http://www.summitmicro.com/prod_select/summary/SMM665C/SMM665C_2125.pdf | ||
20 | * Summit Microelectronics SMM764 | ||
21 | Prefix: 'smm764' | ||
22 | Addresses scanned: - | ||
23 | Datasheet: | ||
24 | http://www.summitmicro.com/prod_select/summary/SMM764/SMM764_2098.pdf | ||
25 | * Summit Microelectronics SMM766, SMM766B | ||
26 | Prefix: 'smm766' | ||
27 | Addresses scanned: - | ||
28 | Datasheets: | ||
29 | http://www.summitmicro.com/prod_select/summary/SMM766/SMM766_2086.pdf | ||
30 | http://www.summitmicro.com/prod_select/summary/SMM766B/SMM766B_2122.pdf | ||
31 | |||
32 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | ||
33 | |||
34 | |||
35 | Module Parameters | ||
36 | ----------------- | ||
37 | |||
38 | * vref: int | ||
39 | Default: 1250 (mV) | ||
40 | Reference voltage on VREF_ADC pin in mV. It should not be necessary to set | ||
41 | this parameter unless a non-default reference voltage is used. | ||
42 | |||
43 | |||
44 | Description | ||
45 | ----------- | ||
46 | |||
47 | [From datasheet] The SMM665 is an Active DC Output power supply Controller | ||
48 | that monitors, margins and cascade sequences power. The part monitors six | ||
49 | power supply channels as well as VDD, 12V input, two general-purpose analog | ||
50 | inputs and an internal temperature sensor using a 10-bit ADC. | ||
51 | |||
52 | Each monitored channel has its own high and low limits, plus a critical | ||
53 | limit. | ||
54 | |||
55 | Support for SMM465, SMM764, and SMM766 has been implemented but is untested. | ||
56 | |||
57 | |||
58 | Usage Notes | ||
59 | ----------- | ||
60 | |||
61 | This driver does not probe for devices, since there is no register which | ||
62 | can be safely used to identify the chip. You will have to instantiate | ||
63 | the devices explicitly. When instantiating the device, you have to specify | ||
64 | its configuration register address. | ||
65 | |||
66 | Example: the following will load the driver for an SMM665 at address 0x57 | ||
67 | on I2C bus #1: | ||
68 | $ modprobe smm665 | ||
69 | $ echo smm665 0x57 > /sys/bus/i2c/devices/i2c-1/new_device | ||
70 | |||
71 | |||
72 | Sysfs entries | ||
73 | ------------- | ||
74 | |||
75 | This driver uses the values in the datasheet to convert ADC register values | ||
76 | into the values specified in the sysfs-interface document. All attributes are | ||
77 | read only. | ||
78 | |||
79 | Min, max, lcrit, and crit values are used by the chip to trigger external signals | ||
80 | and/or other activity. Triggered signals can include HEALTHY, RST, Power Off, | ||
81 | or Fault depending on the chip configuration. The driver reports values as lcrit | ||
82 | or crit if exceeding the limits triggers RST, Power Off, or Fault, and as min or | ||
83 | max otherwise. For details please see the SMM665 datasheet. | ||
84 | |||
85 | For SMM465 and SMM764, values for Channel E and F are reported but undefined. | ||
86 | |||
87 | in1_input 12V input voltage (mV) | ||
88 | in2_input 3.3V (VDD) input voltage (mV) | ||
89 | in3_input Channel A voltage (mV) | ||
90 | in4_input Channel B voltage (mV) | ||
91 | in5_input Channel C voltage (mV) | ||
92 | in6_input Channel D voltage (mV) | ||
93 | in7_input Channel E voltage (mV) | ||
94 | in8_input Channel F voltage (mV) | ||
95 | in9_input AIN1 voltage (mV) | ||
96 | in10_input AIN2 voltage (mV) | ||
97 | |||
98 | in1_min 12v input minimum voltage (mV) | ||
99 | in2_min 3.3V (VDD) input minimum voltage (mV) | ||
100 | in3_min Channel A minimum voltage (mV) | ||
101 | in4_min Channel B minimum voltage (mV) | ||
102 | in5_min Channel C minimum voltage (mV) | ||
103 | in6_min Channel D minimum voltage (mV) | ||
104 | in7_min Channel E minimum voltage (mV) | ||
105 | in8_min Channel F minimum voltage (mV) | ||
106 | in9_min AIN1 minimum voltage (mV) | ||
107 | in10_min AIN2 minimum voltage (mV) | ||
108 | |||
109 | in1_max 12v input maximum voltage (mV) | ||
110 | in2_max 3.3V (VDD) input maximum voltage (mV) | ||
111 | in3_max Channel A maximum voltage (mV) | ||
112 | in4_max Channel B maximum voltage (mV) | ||
113 | in5_max Channel C maximum voltage (mV) | ||
114 | in6_max Channel D maximum voltage (mV) | ||
115 | in7_max Channel E maximum voltage (mV) | ||
116 | in8_max Channel F maximum voltage (mV) | ||
117 | in9_max AIN1 maximum voltage (mV) | ||
118 | in10_max AIN2 maximum voltage (mV) | ||
119 | |||
120 | in1_lcrit 12v input critical minimum voltage (mV) | ||
121 | in2_lcrit 3.3V (VDD) input critical minimum voltage (mV) | ||
122 | in3_lcrit Channel A critical minimum voltage (mV) | ||
123 | in4_lcrit Channel B critical minimum voltage (mV) | ||
124 | in5_lcrit Channel C critical minimum voltage (mV) | ||
125 | in6_lcrit Channel D critical minimum voltage (mV) | ||
126 | in7_lcrit Channel E critical minimum voltage (mV) | ||
127 | in8_lcrit Channel F critical minimum voltage (mV) | ||
128 | in9_lcrit AIN1 critical minimum voltage (mV) | ||
129 | in10_lcrit AIN2 critical minimum voltage (mV) | ||
130 | |||
131 | in1_crit 12v input critical maximum voltage (mV) | ||
132 | in2_crit 3.3V (VDD) input critical maximum voltage (mV) | ||
133 | in3_crit Channel A critical maximum voltage (mV) | ||
134 | in4_crit Channel B critical maximum voltage (mV) | ||
135 | in5_crit Channel C critical maximum voltage (mV) | ||
136 | in6_crit Channel D critical maximum voltage (mV) | ||
137 | in7_crit Channel E critical maximum voltage (mV) | ||
138 | in8_crit Channel F critical maximum voltage (mV) | ||
139 | in9_crit AIN1 critical maximum voltage (mV) | ||
140 | in10_crit AIN2 critical maximum voltage (mV) | ||
141 | |||
142 | in1_crit_alarm 12v input critical alarm | ||
143 | in2_crit_alarm 3.3V (VDD) input critical alarm | ||
144 | in3_crit_alarm Channel A critical alarm | ||
145 | in4_crit_alarm Channel B critical alarm | ||
146 | in5_crit_alarm Channel C critical alarm | ||
147 | in6_crit_alarm Channel D critical alarm | ||
148 | in7_crit_alarm Channel E critical alarm | ||
149 | in8_crit_alarm Channel F critical alarm | ||
150 | in9_crit_alarm AIN1 critical alarm | ||
151 | in10_crit_alarm AIN2 critical alarm | ||
152 | |||
153 | temp1_input Chip tempererature | ||
154 | temp1_min Mimimum chip tempererature | ||
155 | temp1_max Maximum chip tempererature | ||
156 | temp1_crit Critical chip tempererature | ||
157 | temp1_crit_alarm Temperature critical alarm | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 44f6b19c50bb..d529b1363e95 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -681,8 +681,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
681 | earlycon= [KNL] Output early console device and options. | 681 | earlycon= [KNL] Output early console device and options. |
682 | uart[8250],io,<addr>[,options] | 682 | uart[8250],io,<addr>[,options] |
683 | uart[8250],mmio,<addr>[,options] | 683 | uart[8250],mmio,<addr>[,options] |
684 | uart[8250],mmio32,<addr>[,options] | ||
684 | Start an early, polled-mode console on the 8250/16550 | 685 | Start an early, polled-mode console on the 8250/16550 |
685 | UART at the specified I/O port or MMIO address. | 686 | UART at the specified I/O port or MMIO address. |
687 | MMIO inter-register address stride is either 8bit (mmio) | ||
688 | or 32bit (mmio32). | ||
686 | The options are the same as for ttyS, above. | 689 | The options are the same as for ttyS, above. |
687 | 690 | ||
688 | earlyprintk= [X86,SH,BLACKFIN] | 691 | earlyprintk= [X86,SH,BLACKFIN] |
diff --git a/Documentation/networking/igb.txt b/Documentation/networking/igb.txt new file mode 100644 index 000000000000..ab2d71831892 --- /dev/null +++ b/Documentation/networking/igb.txt | |||
@@ -0,0 +1,132 @@ | |||
1 | Linux* Base Driver for Intel(R) Network Connection | ||
2 | ================================================== | ||
3 | |||
4 | Intel Gigabit Linux driver. | ||
5 | Copyright(c) 1999 - 2010 Intel Corporation. | ||
6 | |||
7 | Contents | ||
8 | ======== | ||
9 | |||
10 | - Identifying Your Adapter | ||
11 | - Additional Configurations | ||
12 | - Support | ||
13 | |||
14 | Identifying Your Adapter | ||
15 | ======================== | ||
16 | |||
17 | This driver supports all 82575, 82576 and 82580-based Intel (R) gigabit network | ||
18 | connections. | ||
19 | |||
20 | For specific information on how to identify your adapter, go to the Adapter & | ||
21 | Driver ID Guide at: | ||
22 | |||
23 | http://support.intel.com/support/go/network/adapter/idguide.htm | ||
24 | |||
25 | Command Line Parameters | ||
26 | ======================= | ||
27 | |||
28 | The default value for each parameter is generally the recommended setting, | ||
29 | unless otherwise noted. | ||
30 | |||
31 | max_vfs | ||
32 | ------- | ||
33 | Valid Range: 0-7 | ||
34 | Default Value: 0 | ||
35 | |||
36 | This parameter adds support for SR-IOV. It causes the driver to spawn up to | ||
37 | max_vfs worth of virtual function. | ||
38 | |||
39 | Additional Configurations | ||
40 | ========================= | ||
41 | |||
42 | Jumbo Frames | ||
43 | ------------ | ||
44 | Jumbo Frames support is enabled by changing the MTU to a value larger than | ||
45 | the default of 1500. Use the ifconfig command to increase the MTU size. | ||
46 | For example: | ||
47 | |||
48 | ifconfig eth<x> mtu 9000 up | ||
49 | |||
50 | This setting is not saved across reboots. | ||
51 | |||
52 | Notes: | ||
53 | |||
54 | - The maximum MTU setting for Jumbo Frames is 9216. This value coincides | ||
55 | with the maximum Jumbo Frames size of 9234 bytes. | ||
56 | |||
57 | - Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or | ||
58 | loss of link. | ||
59 | |||
60 | Ethtool | ||
61 | ------- | ||
62 | The driver utilizes the ethtool interface for driver configuration and | ||
63 | diagnostics, as well as displaying statistical information. | ||
64 | |||
65 | http://sourceforge.net/projects/gkernel. | ||
66 | |||
67 | Enabling Wake on LAN* (WoL) | ||
68 | --------------------------- | ||
69 | WoL is configured through the Ethtool* utility. | ||
70 | |||
71 | For instructions on enabling WoL with Ethtool, refer to the Ethtool man page. | ||
72 | |||
73 | WoL will be enabled on the system during the next shut down or reboot. | ||
74 | For this driver version, in order to enable WoL, the igb driver must be | ||
75 | loaded when shutting down or rebooting the system. | ||
76 | |||
77 | Wake On LAN is only supported on port A of multi-port adapters. | ||
78 | |||
79 | Wake On LAN is not supported for the Intel(R) Gigabit VT Quad Port Server | ||
80 | Adapter. | ||
81 | |||
82 | Multiqueue | ||
83 | ---------- | ||
84 | In this mode, a separate MSI-X vector is allocated for each queue and one | ||
85 | for "other" interrupts such as link status change and errors. All | ||
86 | interrupts are throttled via interrupt moderation. Interrupt moderation | ||
87 | must be used to avoid interrupt storms while the driver is processing one | ||
88 | interrupt. The moderation value should be at least as large as the expected | ||
89 | time for the driver to process an interrupt. Multiqueue is off by default. | ||
90 | |||
91 | REQUIREMENTS: MSI-X support is required for Multiqueue. If MSI-X is not | ||
92 | found, the system will fallback to MSI or to Legacy interrupts. | ||
93 | |||
94 | LRO | ||
95 | --- | ||
96 | Large Receive Offload (LRO) is a technique for increasing inbound throughput | ||
97 | of high-bandwidth network connections by reducing CPU overhead. It works by | ||
98 | aggregating multiple incoming packets from a single stream into a larger | ||
99 | buffer before they are passed higher up the networking stack, thus reducing | ||
100 | the number of packets that have to be processed. LRO combines multiple | ||
101 | Ethernet frames into a single receive in the stack, thereby potentially | ||
102 | decreasing CPU utilization for receives. | ||
103 | |||
104 | NOTE: You need to have inet_lro enabled via either the CONFIG_INET_LRO or | ||
105 | CONFIG_INET_LRO_MODULE kernel config option. Additionally, if | ||
106 | CONFIG_INET_LRO_MODULE is used, the inet_lro module needs to be loaded | ||
107 | before the igb driver. | ||
108 | |||
109 | You can verify that the driver is using LRO by looking at these counters in | ||
110 | Ethtool: | ||
111 | |||
112 | lro_aggregated - count of total packets that were combined | ||
113 | lro_flushed - counts the number of packets flushed out of LRO | ||
114 | lro_no_desc - counts the number of times an LRO descriptor was not available | ||
115 | for the LRO packet | ||
116 | |||
117 | NOTE: IPv6 and UDP are not supported by LRO. | ||
118 | |||
119 | Support | ||
120 | ======= | ||
121 | |||
122 | For general information, go to the Intel support website at: | ||
123 | |||
124 | www.intel.com/support/ | ||
125 | |||
126 | or the Intel Wired Networking project hosted by Sourceforge at: | ||
127 | |||
128 | http://sourceforge.net/projects/e1000 | ||
129 | |||
130 | If an issue is identified with the released source code on the supported | ||
131 | kernel with a supported adapter, email the specific information related | ||
132 | to the issue to e1000-devel@lists.sf.net | ||
diff --git a/Documentation/networking/igbvf.txt b/Documentation/networking/igbvf.txt new file mode 100644 index 000000000000..056028138d9c --- /dev/null +++ b/Documentation/networking/igbvf.txt | |||
@@ -0,0 +1,78 @@ | |||
1 | Linux* Base Driver for Intel(R) Network Connection | ||
2 | ================================================== | ||
3 | |||
4 | Intel Gigabit Linux driver. | ||
5 | Copyright(c) 1999 - 2010 Intel Corporation. | ||
6 | |||
7 | Contents | ||
8 | ======== | ||
9 | |||
10 | - Identifying Your Adapter | ||
11 | - Additional Configurations | ||
12 | - Support | ||
13 | |||
14 | This file describes the igbvf Linux* Base Driver for Intel Network Connection. | ||
15 | |||
16 | The igbvf driver supports 82576-based virtual function devices that can only | ||
17 | be activated on kernels that support SR-IOV. SR-IOV requires the correct | ||
18 | platform and OS support. | ||
19 | |||
20 | The igbvf driver requires the igb driver, version 2.0 or later. The igbvf | ||
21 | driver supports virtual functions generated by the igb driver with a max_vfs | ||
22 | value of 1 or greater. For more information on the max_vfs parameter refer | ||
23 | to the README included with the igb driver. | ||
24 | |||
25 | The guest OS loading the igbvf driver must support MSI-X interrupts. | ||
26 | |||
27 | This driver is only supported as a loadable module at this time. Intel is | ||
28 | not supplying patches against the kernel source to allow for static linking | ||
29 | of the driver. For questions related to hardware requirements, refer to the | ||
30 | documentation supplied with your Intel Gigabit adapter. All hardware | ||
31 | requirements listed apply to use with Linux. | ||
32 | |||
33 | Instructions on updating ethtool can be found in the section "Additional | ||
34 | Configurations" later in this document. | ||
35 | |||
36 | VLANs: There is a limit of a total of 32 shared VLANs to 1 or more VFs. | ||
37 | |||
38 | Identifying Your Adapter | ||
39 | ======================== | ||
40 | |||
41 | The igbvf driver supports 82576-based virtual function devices that can only | ||
42 | be activated on kernels that support SR-IOV. | ||
43 | |||
44 | For more information on how to identify your adapter, go to the Adapter & | ||
45 | Driver ID Guide at: | ||
46 | |||
47 | http://support.intel.com/support/go/network/adapter/idguide.htm | ||
48 | |||
49 | For the latest Intel network drivers for Linux, refer to the following | ||
50 | website. In the search field, enter your adapter name or type, or use the | ||
51 | networking link on the left to search for your adapter: | ||
52 | |||
53 | http://downloadcenter.intel.com/scripts-df-external/Support_Intel.aspx | ||
54 | |||
55 | Additional Configurations | ||
56 | ========================= | ||
57 | |||
58 | Ethtool | ||
59 | ------- | ||
60 | The driver utilizes the ethtool interface for driver configuration and | ||
61 | diagnostics, as well as displaying statistical information. | ||
62 | |||
63 | http://sourceforge.net/projects/gkernel. | ||
64 | |||
65 | Support | ||
66 | ======= | ||
67 | |||
68 | For general information, go to the Intel support website at: | ||
69 | |||
70 | http://support.intel.com | ||
71 | |||
72 | or the Intel Wired Networking project hosted by Sourceforge at: | ||
73 | |||
74 | http://sourceforge.net/projects/e1000 | ||
75 | |||
76 | If an issue is identified with the released source code on the supported | ||
77 | kernel with a supported adapter, email the specific information related | ||
78 | to the issue to e1000-devel@lists.sf.net | ||
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index 82b2da18c45d..b606c2c4dd37 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -511,7 +511,7 @@ information may not be desired. | |||
511 | If this is set to non-zero, this information is shown whenever the | 511 | If this is set to non-zero, this information is shown whenever the |
512 | OOM killer actually kills a memory-hogging task. | 512 | OOM killer actually kills a memory-hogging task. |
513 | 513 | ||
514 | The default value is 0. | 514 | The default value is 1 (enabled). |
515 | 515 | ||
516 | ============================================================== | 516 | ============================================================== |
517 | 517 | ||
diff --git a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl new file mode 100644 index 000000000000..1b55146d1c8d --- /dev/null +++ b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl | |||
@@ -0,0 +1,686 @@ | |||
1 | #!/usr/bin/perl | ||
2 | # This is a POC for reading the text representation of trace output related to | ||
3 | # page reclaim. It makes an attempt to extract some high-level information on | ||
4 | # what is going on. The accuracy of the parser may vary | ||
5 | # | ||
6 | # Example usage: trace-vmscan-postprocess.pl < /sys/kernel/debug/tracing/trace_pipe | ||
7 | # other options | ||
8 | # --read-procstat If the trace lacks process info, get it from /proc | ||
9 | # --ignore-pid Aggregate processes of the same name together | ||
10 | # | ||
11 | # Copyright (c) IBM Corporation 2009 | ||
12 | # Author: Mel Gorman <mel@csn.ul.ie> | ||
13 | use strict; | ||
14 | use Getopt::Long; | ||
15 | |||
16 | # Tracepoint events | ||
17 | use constant MM_VMSCAN_DIRECT_RECLAIM_BEGIN => 1; | ||
18 | use constant MM_VMSCAN_DIRECT_RECLAIM_END => 2; | ||
19 | use constant MM_VMSCAN_KSWAPD_WAKE => 3; | ||
20 | use constant MM_VMSCAN_KSWAPD_SLEEP => 4; | ||
21 | use constant MM_VMSCAN_LRU_SHRINK_ACTIVE => 5; | ||
22 | use constant MM_VMSCAN_LRU_SHRINK_INACTIVE => 6; | ||
23 | use constant MM_VMSCAN_LRU_ISOLATE => 7; | ||
24 | use constant MM_VMSCAN_WRITEPAGE_FILE_SYNC => 8; | ||
25 | use constant MM_VMSCAN_WRITEPAGE_ANON_SYNC => 9; | ||
26 | use constant MM_VMSCAN_WRITEPAGE_FILE_ASYNC => 10; | ||
27 | use constant MM_VMSCAN_WRITEPAGE_ANON_ASYNC => 11; | ||
28 | use constant MM_VMSCAN_WRITEPAGE_ASYNC => 12; | ||
29 | use constant EVENT_UNKNOWN => 13; | ||
30 | |||
31 | # Per-order events | ||
32 | use constant MM_VMSCAN_DIRECT_RECLAIM_BEGIN_PERORDER => 11; | ||
33 | use constant MM_VMSCAN_WAKEUP_KSWAPD_PERORDER => 12; | ||
34 | use constant MM_VMSCAN_KSWAPD_WAKE_PERORDER => 13; | ||
35 | use constant HIGH_KSWAPD_REWAKEUP_PERORDER => 14; | ||
36 | |||
37 | # Constants used to track state | ||
38 | use constant STATE_DIRECT_BEGIN => 15; | ||
39 | use constant STATE_DIRECT_ORDER => 16; | ||
40 | use constant STATE_KSWAPD_BEGIN => 17; | ||
41 | use constant STATE_KSWAPD_ORDER => 18; | ||
42 | |||
43 | # High-level events extrapolated from tracepoints | ||
44 | use constant HIGH_DIRECT_RECLAIM_LATENCY => 19; | ||
45 | use constant HIGH_KSWAPD_LATENCY => 20; | ||
46 | use constant HIGH_KSWAPD_REWAKEUP => 21; | ||
47 | use constant HIGH_NR_SCANNED => 22; | ||
48 | use constant HIGH_NR_TAKEN => 23; | ||
49 | use constant HIGH_NR_RECLAIM => 24; | ||
50 | use constant HIGH_NR_CONTIG_DIRTY => 25; | ||
51 | |||
52 | my %perprocesspid; | ||
53 | my %perprocess; | ||
54 | my %last_procmap; | ||
55 | my $opt_ignorepid; | ||
56 | my $opt_read_procstat; | ||
57 | |||
58 | my $total_wakeup_kswapd; | ||
59 | my ($total_direct_reclaim, $total_direct_nr_scanned); | ||
60 | my ($total_direct_latency, $total_kswapd_latency); | ||
61 | my ($total_direct_writepage_file_sync, $total_direct_writepage_file_async); | ||
62 | my ($total_direct_writepage_anon_sync, $total_direct_writepage_anon_async); | ||
63 | my ($total_kswapd_nr_scanned, $total_kswapd_wake); | ||
64 | my ($total_kswapd_writepage_file_sync, $total_kswapd_writepage_file_async); | ||
65 | my ($total_kswapd_writepage_anon_sync, $total_kswapd_writepage_anon_async); | ||
66 | |||
67 | # Catch sigint and exit on request | ||
68 | my $sigint_report = 0; | ||
69 | my $sigint_exit = 0; | ||
70 | my $sigint_pending = 0; | ||
71 | my $sigint_received = 0; | ||
72 | sub sigint_handler { | ||
73 | my $current_time = time; | ||
74 | if ($current_time - 2 > $sigint_received) { | ||
75 | print "SIGINT received, report pending. Hit ctrl-c again to exit\n"; | ||
76 | $sigint_report = 1; | ||
77 | } else { | ||
78 | if (!$sigint_exit) { | ||
79 | print "Second SIGINT received quickly, exiting\n"; | ||
80 | } | ||
81 | $sigint_exit++; | ||
82 | } | ||
83 | |||
84 | if ($sigint_exit > 3) { | ||
85 | print "Many SIGINTs received, exiting now without report\n"; | ||
86 | exit; | ||
87 | } | ||
88 | |||
89 | $sigint_received = $current_time; | ||
90 | $sigint_pending = 1; | ||
91 | } | ||
92 | $SIG{INT} = "sigint_handler"; | ||
93 | |||
94 | # Parse command line options | ||
95 | GetOptions( | ||
96 | 'ignore-pid' => \$opt_ignorepid, | ||
97 | 'read-procstat' => \$opt_read_procstat, | ||
98 | ); | ||
99 | |||
100 | # Defaults for dynamically discovered regex's | ||
101 | my $regex_direct_begin_default = 'order=([0-9]*) may_writepage=([0-9]*) gfp_flags=([A-Z_|]*)'; | ||
102 | my $regex_direct_end_default = 'nr_reclaimed=([0-9]*)'; | ||
103 | my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)'; | ||
104 | my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; | ||
105 | my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)'; | ||
106 | my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)'; | ||
107 | my $regex_lru_shrink_inactive_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*)'; | ||
108 | my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; | ||
109 | my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; | ||
110 | |||
111 | # Dyanically discovered regex | ||
112 | my $regex_direct_begin; | ||
113 | my $regex_direct_end; | ||
114 | my $regex_kswapd_wake; | ||
115 | my $regex_kswapd_sleep; | ||
116 | my $regex_wakeup_kswapd; | ||
117 | my $regex_lru_isolate; | ||
118 | my $regex_lru_shrink_inactive; | ||
119 | my $regex_lru_shrink_active; | ||
120 | my $regex_writepage; | ||
121 | |||
122 | # Static regex used. Specified like this for readability and for use with /o | ||
123 | # (process_pid) (cpus ) ( time ) (tpoint ) (details) | ||
124 | my $regex_traceevent = '\s*([a-zA-Z0-9-]*)\s*(\[[0-9]*\])\s*([0-9.]*):\s*([a-zA-Z_]*):\s*(.*)'; | ||
125 | my $regex_statname = '[-0-9]*\s\((.*)\).*'; | ||
126 | my $regex_statppid = '[-0-9]*\s\(.*\)\s[A-Za-z]\s([0-9]*).*'; | ||
127 | |||
128 | sub generate_traceevent_regex { | ||
129 | my $event = shift; | ||
130 | my $default = shift; | ||
131 | my $regex; | ||
132 | |||
133 | # Read the event format or use the default | ||
134 | if (!open (FORMAT, "/sys/kernel/debug/tracing/events/$event/format")) { | ||
135 | print("WARNING: Event $event format string not found\n"); | ||
136 | return $default; | ||
137 | } else { | ||
138 | my $line; | ||
139 | while (!eof(FORMAT)) { | ||
140 | $line = <FORMAT>; | ||
141 | $line =~ s/, REC->.*//; | ||
142 | if ($line =~ /^print fmt:\s"(.*)".*/) { | ||
143 | $regex = $1; | ||
144 | $regex =~ s/%s/\([0-9a-zA-Z|_]*\)/g; | ||
145 | $regex =~ s/%p/\([0-9a-f]*\)/g; | ||
146 | $regex =~ s/%d/\([-0-9]*\)/g; | ||
147 | $regex =~ s/%ld/\([-0-9]*\)/g; | ||
148 | $regex =~ s/%lu/\([0-9]*\)/g; | ||
149 | } | ||
150 | } | ||
151 | } | ||
152 | |||
153 | # Can't handle the print_flags stuff but in the context of this | ||
154 | # script, it really doesn't matter | ||
155 | $regex =~ s/\(REC.*\) \? __print_flags.*//; | ||
156 | |||
157 | # Verify fields are in the right order | ||
158 | my $tuple; | ||
159 | foreach $tuple (split /\s/, $regex) { | ||
160 | my ($key, $value) = split(/=/, $tuple); | ||
161 | my $expected = shift; | ||
162 | if ($key ne $expected) { | ||
163 | print("WARNING: Format not as expected for event $event '$key' != '$expected'\n"); | ||
164 | $regex =~ s/$key=\((.*)\)/$key=$1/; | ||
165 | } | ||
166 | } | ||
167 | |||
168 | if (defined shift) { | ||
169 | die("Fewer fields than expected in format"); | ||
170 | } | ||
171 | |||
172 | return $regex; | ||
173 | } | ||
174 | |||
175 | $regex_direct_begin = generate_traceevent_regex( | ||
176 | "vmscan/mm_vmscan_direct_reclaim_begin", | ||
177 | $regex_direct_begin_default, | ||
178 | "order", "may_writepage", | ||
179 | "gfp_flags"); | ||
180 | $regex_direct_end = generate_traceevent_regex( | ||
181 | "vmscan/mm_vmscan_direct_reclaim_end", | ||
182 | $regex_direct_end_default, | ||
183 | "nr_reclaimed"); | ||
184 | $regex_kswapd_wake = generate_traceevent_regex( | ||
185 | "vmscan/mm_vmscan_kswapd_wake", | ||
186 | $regex_kswapd_wake_default, | ||
187 | "nid", "order"); | ||
188 | $regex_kswapd_sleep = generate_traceevent_regex( | ||
189 | "vmscan/mm_vmscan_kswapd_sleep", | ||
190 | $regex_kswapd_sleep_default, | ||
191 | "nid"); | ||
192 | $regex_wakeup_kswapd = generate_traceevent_regex( | ||
193 | "vmscan/mm_vmscan_wakeup_kswapd", | ||
194 | $regex_wakeup_kswapd_default, | ||
195 | "nid", "zid", "order"); | ||
196 | $regex_lru_isolate = generate_traceevent_regex( | ||
197 | "vmscan/mm_vmscan_lru_isolate", | ||
198 | $regex_lru_isolate_default, | ||
199 | "isolate_mode", "order", | ||
200 | "nr_requested", "nr_scanned", "nr_taken", | ||
201 | "contig_taken", "contig_dirty", "contig_failed"); | ||
202 | $regex_lru_shrink_inactive = generate_traceevent_regex( | ||
203 | "vmscan/mm_vmscan_lru_shrink_inactive", | ||
204 | $regex_lru_shrink_inactive_default, | ||
205 | "nid", "zid", | ||
206 | "lru", | ||
207 | "nr_scanned", "nr_reclaimed", "priority"); | ||
208 | $regex_lru_shrink_active = generate_traceevent_regex( | ||
209 | "vmscan/mm_vmscan_lru_shrink_active", | ||
210 | $regex_lru_shrink_active_default, | ||
211 | "nid", "zid", | ||
212 | "lru", | ||
213 | "nr_scanned", "nr_rotated", "priority"); | ||
214 | $regex_writepage = generate_traceevent_regex( | ||
215 | "vmscan/mm_vmscan_writepage", | ||
216 | $regex_writepage_default, | ||
217 | "page", "pfn", "flags"); | ||
218 | |||
219 | sub read_statline($) { | ||
220 | my $pid = $_[0]; | ||
221 | my $statline; | ||
222 | |||
223 | if (open(STAT, "/proc/$pid/stat")) { | ||
224 | $statline = <STAT>; | ||
225 | close(STAT); | ||
226 | } | ||
227 | |||
228 | if ($statline eq '') { | ||
229 | $statline = "-1 (UNKNOWN_PROCESS_NAME) R 0"; | ||
230 | } | ||
231 | |||
232 | return $statline; | ||
233 | } | ||
234 | |||
235 | sub guess_process_pid($$) { | ||
236 | my $pid = $_[0]; | ||
237 | my $statline = $_[1]; | ||
238 | |||
239 | if ($pid == 0) { | ||
240 | return "swapper-0"; | ||
241 | } | ||
242 | |||
243 | if ($statline !~ /$regex_statname/o) { | ||
244 | die("Failed to math stat line for process name :: $statline"); | ||
245 | } | ||
246 | return "$1-$pid"; | ||
247 | } | ||
248 | |||
249 | # Convert sec.usec timestamp format | ||
250 | sub timestamp_to_ms($) { | ||
251 | my $timestamp = $_[0]; | ||
252 | |||
253 | my ($sec, $usec) = split (/\./, $timestamp); | ||
254 | return ($sec * 1000) + ($usec / 1000); | ||
255 | } | ||
256 | |||
257 | sub process_events { | ||
258 | my $traceevent; | ||
259 | my $process_pid; | ||
260 | my $cpus; | ||
261 | my $timestamp; | ||
262 | my $tracepoint; | ||
263 | my $details; | ||
264 | my $statline; | ||
265 | |||
266 | # Read each line of the event log | ||
267 | EVENT_PROCESS: | ||
268 | while ($traceevent = <STDIN>) { | ||
269 | if ($traceevent =~ /$regex_traceevent/o) { | ||
270 | $process_pid = $1; | ||
271 | $timestamp = $3; | ||
272 | $tracepoint = $4; | ||
273 | |||
274 | $process_pid =~ /(.*)-([0-9]*)$/; | ||
275 | my $process = $1; | ||
276 | my $pid = $2; | ||
277 | |||
278 | if ($process eq "") { | ||
279 | $process = $last_procmap{$pid}; | ||
280 | $process_pid = "$process-$pid"; | ||
281 | } | ||
282 | $last_procmap{$pid} = $process; | ||
283 | |||
284 | if ($opt_read_procstat) { | ||
285 | $statline = read_statline($pid); | ||
286 | if ($opt_read_procstat && $process eq '') { | ||
287 | $process_pid = guess_process_pid($pid, $statline); | ||
288 | } | ||
289 | } | ||
290 | } else { | ||
291 | next; | ||
292 | } | ||
293 | |||
294 | # Perl Switch() sucks majorly | ||
295 | if ($tracepoint eq "mm_vmscan_direct_reclaim_begin") { | ||
296 | $timestamp = timestamp_to_ms($timestamp); | ||
297 | $perprocesspid{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}++; | ||
298 | $perprocesspid{$process_pid}->{STATE_DIRECT_BEGIN} = $timestamp; | ||
299 | |||
300 | $details = $5; | ||
301 | if ($details !~ /$regex_direct_begin/o) { | ||
302 | print "WARNING: Failed to parse mm_vmscan_direct_reclaim_begin as expected\n"; | ||
303 | print " $details\n"; | ||
304 | print " $regex_direct_begin\n"; | ||
305 | next; | ||
306 | } | ||
307 | my $order = $1; | ||
308 | $perprocesspid{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN_PERORDER}[$order]++; | ||
309 | $perprocesspid{$process_pid}->{STATE_DIRECT_ORDER} = $order; | ||
310 | } elsif ($tracepoint eq "mm_vmscan_direct_reclaim_end") { | ||
311 | # Count the event itself | ||
312 | my $index = $perprocesspid{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_END}; | ||
313 | $perprocesspid{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_END}++; | ||
314 | |||
315 | # Record how long direct reclaim took this time | ||
316 | if (defined $perprocesspid{$process_pid}->{STATE_DIRECT_BEGIN}) { | ||
317 | $timestamp = timestamp_to_ms($timestamp); | ||
318 | my $order = $perprocesspid{$process_pid}->{STATE_DIRECT_ORDER}; | ||
319 | my $latency = ($timestamp - $perprocesspid{$process_pid}->{STATE_DIRECT_BEGIN}); | ||
320 | $perprocesspid{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$index] = "$order-$latency"; | ||
321 | } | ||
322 | } elsif ($tracepoint eq "mm_vmscan_kswapd_wake") { | ||
323 | $details = $5; | ||
324 | if ($details !~ /$regex_kswapd_wake/o) { | ||
325 | print "WARNING: Failed to parse mm_vmscan_kswapd_wake as expected\n"; | ||
326 | print " $details\n"; | ||
327 | print " $regex_kswapd_wake\n"; | ||
328 | next; | ||
329 | } | ||
330 | |||
331 | my $order = $2; | ||
332 | $perprocesspid{$process_pid}->{STATE_KSWAPD_ORDER} = $order; | ||
333 | if (!$perprocesspid{$process_pid}->{STATE_KSWAPD_BEGIN}) { | ||
334 | $timestamp = timestamp_to_ms($timestamp); | ||
335 | $perprocesspid{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}++; | ||
336 | $perprocesspid{$process_pid}->{STATE_KSWAPD_BEGIN} = $timestamp; | ||
337 | $perprocesspid{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE_PERORDER}[$order]++; | ||
338 | } else { | ||
339 | $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP}++; | ||
340 | $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP_PERORDER}[$order]++; | ||
341 | } | ||
342 | } elsif ($tracepoint eq "mm_vmscan_kswapd_sleep") { | ||
343 | |||
344 | # Count the event itself | ||
345 | my $index = $perprocesspid{$process_pid}->{MM_VMSCAN_KSWAPD_SLEEP}; | ||
346 | $perprocesspid{$process_pid}->{MM_VMSCAN_KSWAPD_SLEEP}++; | ||
347 | |||
348 | # Record how long kswapd was awake | ||
349 | $timestamp = timestamp_to_ms($timestamp); | ||
350 | my $order = $perprocesspid{$process_pid}->{STATE_KSWAPD_ORDER}; | ||
351 | my $latency = ($timestamp - $perprocesspid{$process_pid}->{STATE_KSWAPD_BEGIN}); | ||
352 | $perprocesspid{$process_pid}->{HIGH_KSWAPD_LATENCY}[$index] = "$order-$latency"; | ||
353 | $perprocesspid{$process_pid}->{STATE_KSWAPD_BEGIN} = 0; | ||
354 | } elsif ($tracepoint eq "mm_vmscan_wakeup_kswapd") { | ||
355 | $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}++; | ||
356 | |||
357 | $details = $5; | ||
358 | if ($details !~ /$regex_wakeup_kswapd/o) { | ||
359 | print "WARNING: Failed to parse mm_vmscan_wakeup_kswapd as expected\n"; | ||
360 | print " $details\n"; | ||
361 | print " $regex_wakeup_kswapd\n"; | ||
362 | next; | ||
363 | } | ||
364 | my $order = $3; | ||
365 | $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD_PERORDER}[$order]++; | ||
366 | } elsif ($tracepoint eq "mm_vmscan_lru_isolate") { | ||
367 | $details = $5; | ||
368 | if ($details !~ /$regex_lru_isolate/o) { | ||
369 | print "WARNING: Failed to parse mm_vmscan_lru_isolate as expected\n"; | ||
370 | print " $details\n"; | ||
371 | print " $regex_lru_isolate/o\n"; | ||
372 | next; | ||
373 | } | ||
374 | my $nr_scanned = $4; | ||
375 | my $nr_contig_dirty = $7; | ||
376 | $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; | ||
377 | $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; | ||
378 | } elsif ($tracepoint eq "mm_vmscan_writepage") { | ||
379 | $details = $5; | ||
380 | if ($details !~ /$regex_writepage/o) { | ||
381 | print "WARNING: Failed to parse mm_vmscan_writepage as expected\n"; | ||
382 | print " $details\n"; | ||
383 | print " $regex_writepage\n"; | ||
384 | next; | ||
385 | } | ||
386 | |||
387 | my $flags = $3; | ||
388 | my $file = 0; | ||
389 | my $sync_io = 0; | ||
390 | if ($flags =~ /RECLAIM_WB_FILE/) { | ||
391 | $file = 1; | ||
392 | } | ||
393 | if ($flags =~ /RECLAIM_WB_SYNC/) { | ||
394 | $sync_io = 1; | ||
395 | } | ||
396 | if ($sync_io) { | ||
397 | if ($file) { | ||
398 | $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}++; | ||
399 | } else { | ||
400 | $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}++; | ||
401 | } | ||
402 | } else { | ||
403 | if ($file) { | ||
404 | $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}++; | ||
405 | } else { | ||
406 | $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}++; | ||
407 | } | ||
408 | } | ||
409 | } else { | ||
410 | $perprocesspid{$process_pid}->{EVENT_UNKNOWN}++; | ||
411 | } | ||
412 | |||
413 | if ($sigint_pending) { | ||
414 | last EVENT_PROCESS; | ||
415 | } | ||
416 | } | ||
417 | } | ||
418 | |||
419 | sub dump_stats { | ||
420 | my $hashref = shift; | ||
421 | my %stats = %$hashref; | ||
422 | |||
423 | # Dump per-process stats | ||
424 | my $process_pid; | ||
425 | my $max_strlen = 0; | ||
426 | |||
427 | # Get the maximum process name | ||
428 | foreach $process_pid (keys %perprocesspid) { | ||
429 | my $len = length($process_pid); | ||
430 | if ($len > $max_strlen) { | ||
431 | $max_strlen = $len; | ||
432 | } | ||
433 | } | ||
434 | $max_strlen += 2; | ||
435 | |||
436 | # Work out latencies | ||
437 | printf("\n") if !$opt_ignorepid; | ||
438 | printf("Reclaim latencies expressed as order-latency_in_ms\n") if !$opt_ignorepid; | ||
439 | foreach $process_pid (keys %stats) { | ||
440 | |||
441 | if (!$stats{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[0] && | ||
442 | !$stats{$process_pid}->{HIGH_KSWAPD_LATENCY}[0]) { | ||
443 | next; | ||
444 | } | ||
445 | |||
446 | printf "%-" . $max_strlen . "s ", $process_pid if !$opt_ignorepid; | ||
447 | my $index = 0; | ||
448 | while (defined $stats{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$index] || | ||
449 | defined $stats{$process_pid}->{HIGH_KSWAPD_LATENCY}[$index]) { | ||
450 | |||
451 | if ($stats{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$index]) { | ||
452 | printf("%s ", $stats{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$index]) if !$opt_ignorepid; | ||
453 | my ($dummy, $latency) = split(/-/, $stats{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$index]); | ||
454 | $total_direct_latency += $latency; | ||
455 | } else { | ||
456 | printf("%s ", $stats{$process_pid}->{HIGH_KSWAPD_LATENCY}[$index]) if !$opt_ignorepid; | ||
457 | my ($dummy, $latency) = split(/-/, $stats{$process_pid}->{HIGH_KSWAPD_LATENCY}[$index]); | ||
458 | $total_kswapd_latency += $latency; | ||
459 | } | ||
460 | $index++; | ||
461 | } | ||
462 | print "\n" if !$opt_ignorepid; | ||
463 | } | ||
464 | |||
465 | # Print out process activity | ||
466 | printf("\n"); | ||
467 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "Process", "Direct", "Wokeup", "Pages", "Pages", "Pages", "Time"); | ||
468 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "details", "Rclms", "Kswapd", "Scanned", "Sync-IO", "ASync-IO", "Stalled"); | ||
469 | foreach $process_pid (keys %stats) { | ||
470 | |||
471 | if (!$stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}) { | ||
472 | next; | ||
473 | } | ||
474 | |||
475 | $total_direct_reclaim += $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}; | ||
476 | $total_wakeup_kswapd += $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; | ||
477 | $total_direct_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; | ||
478 | $total_direct_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; | ||
479 | $total_direct_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; | ||
480 | $total_direct_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; | ||
481 | |||
482 | $total_direct_writepage_anon_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}; | ||
483 | |||
484 | my $index = 0; | ||
485 | my $this_reclaim_delay = 0; | ||
486 | while (defined $stats{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$index]) { | ||
487 | my ($dummy, $latency) = split(/-/, $stats{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$index]); | ||
488 | $this_reclaim_delay += $latency; | ||
489 | $index++; | ||
490 | } | ||
491 | |||
492 | printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8u %8.3f", | ||
493 | $process_pid, | ||
494 | $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}, | ||
495 | $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}, | ||
496 | $stats{$process_pid}->{HIGH_NR_SCANNED}, | ||
497 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, | ||
498 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}, | ||
499 | $this_reclaim_delay / 1000); | ||
500 | |||
501 | if ($stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}) { | ||
502 | print " "; | ||
503 | for (my $order = 0; $order < 20; $order++) { | ||
504 | my $count = $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN_PERORDER}[$order]; | ||
505 | if ($count != 0) { | ||
506 | print "direct-$order=$count "; | ||
507 | } | ||
508 | } | ||
509 | } | ||
510 | if ($stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}) { | ||
511 | print " "; | ||
512 | for (my $order = 0; $order < 20; $order++) { | ||
513 | my $count = $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD_PERORDER}[$order]; | ||
514 | if ($count != 0) { | ||
515 | print "wakeup-$order=$count "; | ||
516 | } | ||
517 | } | ||
518 | } | ||
519 | if ($stats{$process_pid}->{HIGH_NR_CONTIG_DIRTY}) { | ||
520 | print " "; | ||
521 | my $count = $stats{$process_pid}->{HIGH_NR_CONTIG_DIRTY}; | ||
522 | if ($count != 0) { | ||
523 | print "contig-dirty=$count "; | ||
524 | } | ||
525 | } | ||
526 | |||
527 | print "\n"; | ||
528 | } | ||
529 | |||
530 | # Print out kswapd activity | ||
531 | printf("\n"); | ||
532 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Kswapd", "Kswapd", "Order", "Pages", "Pages", "Pages"); | ||
533 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Instance", "Wakeups", "Re-wakeup", "Scanned", "Sync-IO", "ASync-IO"); | ||
534 | foreach $process_pid (keys %stats) { | ||
535 | |||
536 | if (!$stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}) { | ||
537 | next; | ||
538 | } | ||
539 | |||
540 | $total_kswapd_wake += $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}; | ||
541 | $total_kswapd_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; | ||
542 | $total_kswapd_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; | ||
543 | $total_kswapd_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; | ||
544 | $total_kswapd_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; | ||
545 | $total_kswapd_writepage_anon_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}; | ||
546 | |||
547 | printf("%-" . $max_strlen . "s %8d %10d %8u %8i %8u", | ||
548 | $process_pid, | ||
549 | $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}, | ||
550 | $stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP}, | ||
551 | $stats{$process_pid}->{HIGH_NR_SCANNED}, | ||
552 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, | ||
553 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}); | ||
554 | |||
555 | if ($stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}) { | ||
556 | print " "; | ||
557 | for (my $order = 0; $order < 20; $order++) { | ||
558 | my $count = $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE_PERORDER}[$order]; | ||
559 | if ($count != 0) { | ||
560 | print "wake-$order=$count "; | ||
561 | } | ||
562 | } | ||
563 | } | ||
564 | if ($stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP}) { | ||
565 | print " "; | ||
566 | for (my $order = 0; $order < 20; $order++) { | ||
567 | my $count = $stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP_PERORDER}[$order]; | ||
568 | if ($count != 0) { | ||
569 | print "rewake-$order=$count "; | ||
570 | } | ||
571 | } | ||
572 | } | ||
573 | printf("\n"); | ||
574 | } | ||
575 | |||
576 | # Print out summaries | ||
577 | $total_direct_latency /= 1000; | ||
578 | $total_kswapd_latency /= 1000; | ||
579 | print "\nSummary\n"; | ||
580 | print "Direct reclaims: $total_direct_reclaim\n"; | ||
581 | print "Direct reclaim pages scanned: $total_direct_nr_scanned\n"; | ||
582 | print "Direct reclaim write file sync I/O: $total_direct_writepage_file_sync\n"; | ||
583 | print "Direct reclaim write anon sync I/O: $total_direct_writepage_anon_sync\n"; | ||
584 | print "Direct reclaim write file async I/O: $total_direct_writepage_file_async\n"; | ||
585 | print "Direct reclaim write anon async I/O: $total_direct_writepage_anon_async\n"; | ||
586 | print "Wake kswapd requests: $total_wakeup_kswapd\n"; | ||
587 | printf "Time stalled direct reclaim: %-1.2f seconds\n", $total_direct_latency; | ||
588 | print "\n"; | ||
589 | print "Kswapd wakeups: $total_kswapd_wake\n"; | ||
590 | print "Kswapd pages scanned: $total_kswapd_nr_scanned\n"; | ||
591 | print "Kswapd reclaim write file sync I/O: $total_kswapd_writepage_file_sync\n"; | ||
592 | print "Kswapd reclaim write anon sync I/O: $total_kswapd_writepage_anon_sync\n"; | ||
593 | print "Kswapd reclaim write file async I/O: $total_kswapd_writepage_file_async\n"; | ||
594 | print "Kswapd reclaim write anon async I/O: $total_kswapd_writepage_anon_async\n"; | ||
595 | printf "Time kswapd awake: %-1.2f seconds\n", $total_kswapd_latency; | ||
596 | } | ||
597 | |||
598 | sub aggregate_perprocesspid() { | ||
599 | my $process_pid; | ||
600 | my $process; | ||
601 | undef %perprocess; | ||
602 | |||
603 | foreach $process_pid (keys %perprocesspid) { | ||
604 | $process = $process_pid; | ||
605 | $process =~ s/-([0-9])*$//; | ||
606 | if ($process eq '') { | ||
607 | $process = "NO_PROCESS_NAME"; | ||
608 | } | ||
609 | |||
610 | $perprocess{$process}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN} += $perprocesspid{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}; | ||
611 | $perprocess{$process}->{MM_VMSCAN_KSWAPD_WAKE} += $perprocesspid{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}; | ||
612 | $perprocess{$process}->{MM_VMSCAN_WAKEUP_KSWAPD} += $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; | ||
613 | $perprocess{$process}->{HIGH_KSWAPD_REWAKEUP} += $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP}; | ||
614 | $perprocess{$process}->{HIGH_NR_SCANNED} += $perprocesspid{$process_pid}->{HIGH_NR_SCANNED}; | ||
615 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; | ||
616 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; | ||
617 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; | ||
618 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}; | ||
619 | |||
620 | for (my $order = 0; $order < 20; $order++) { | ||
621 | $perprocess{$process}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN_PERORDER}[$order] += $perprocesspid{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN_PERORDER}[$order]; | ||
622 | $perprocess{$process}->{MM_VMSCAN_WAKEUP_KSWAPD_PERORDER}[$order] += $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD_PERORDER}[$order]; | ||
623 | $perprocess{$process}->{MM_VMSCAN_KSWAPD_WAKE_PERORDER}[$order] += $perprocesspid{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE_PERORDER}[$order]; | ||
624 | |||
625 | } | ||
626 | |||
627 | # Aggregate direct reclaim latencies | ||
628 | my $wr_index = $perprocess{$process}->{MM_VMSCAN_DIRECT_RECLAIM_END}; | ||
629 | my $rd_index = 0; | ||
630 | while (defined $perprocesspid{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$rd_index]) { | ||
631 | $perprocess{$process}->{HIGH_DIRECT_RECLAIM_LATENCY}[$wr_index] = $perprocesspid{$process_pid}->{HIGH_DIRECT_RECLAIM_LATENCY}[$rd_index]; | ||
632 | $rd_index++; | ||
633 | $wr_index++; | ||
634 | } | ||
635 | $perprocess{$process}->{MM_VMSCAN_DIRECT_RECLAIM_END} = $wr_index; | ||
636 | |||
637 | # Aggregate kswapd latencies | ||
638 | my $wr_index = $perprocess{$process}->{MM_VMSCAN_KSWAPD_SLEEP}; | ||
639 | my $rd_index = 0; | ||
640 | while (defined $perprocesspid{$process_pid}->{HIGH_KSWAPD_LATENCY}[$rd_index]) { | ||
641 | $perprocess{$process}->{HIGH_KSWAPD_LATENCY}[$wr_index] = $perprocesspid{$process_pid}->{HIGH_KSWAPD_LATENCY}[$rd_index]; | ||
642 | $rd_index++; | ||
643 | $wr_index++; | ||
644 | } | ||
645 | $perprocess{$process}->{MM_VMSCAN_DIRECT_RECLAIM_END} = $wr_index; | ||
646 | } | ||
647 | } | ||
648 | |||
649 | sub report() { | ||
650 | if (!$opt_ignorepid) { | ||
651 | dump_stats(\%perprocesspid); | ||
652 | } else { | ||
653 | aggregate_perprocesspid(); | ||
654 | dump_stats(\%perprocess); | ||
655 | } | ||
656 | } | ||
657 | |||
658 | # Process events or signals until neither is available | ||
659 | sub signal_loop() { | ||
660 | my $sigint_processed; | ||
661 | do { | ||
662 | $sigint_processed = 0; | ||
663 | process_events(); | ||
664 | |||
665 | # Handle pending signals if any | ||
666 | if ($sigint_pending) { | ||
667 | my $current_time = time; | ||
668 | |||
669 | if ($sigint_exit) { | ||
670 | print "Received exit signal\n"; | ||
671 | $sigint_pending = 0; | ||
672 | } | ||
673 | if ($sigint_report) { | ||
674 | if ($current_time >= $sigint_received + 2) { | ||
675 | report(); | ||
676 | $sigint_report = 0; | ||
677 | $sigint_pending = 0; | ||
678 | $sigint_processed = 1; | ||
679 | } | ||
680 | } | ||
681 | } | ||
682 | } while ($sigint_pending || $sigint_processed); | ||
683 | } | ||
684 | |||
685 | signal_loop(); | ||
686 | report(); | ||
diff --git a/Documentation/usb/ehci.txt b/Documentation/usb/ehci.txt index 1536b7e75134..9dcafa7d930d 100644 --- a/Documentation/usb/ehci.txt +++ b/Documentation/usb/ehci.txt | |||
@@ -9,7 +9,7 @@ compatible with the USB 1.1 standard. It defines three transfer speeds: | |||
9 | - "Low Speed" 1.5 Mbit/sec | 9 | - "Low Speed" 1.5 Mbit/sec |
10 | 10 | ||
11 | USB 1.1 only addressed full speed and low speed. High speed devices | 11 | USB 1.1 only addressed full speed and low speed. High speed devices |
12 | can be used on USB 1.1 systems, but they slow down to USB 1.1 speeds. | 12 | can be used on USB 1.1 systems, but they slow down to USB 1.1 speeds. |
13 | 13 | ||
14 | USB 1.1 devices may also be used on USB 2.0 systems. When plugged | 14 | USB 1.1 devices may also be used on USB 2.0 systems. When plugged |
15 | into an EHCI controller, they are given to a USB 1.1 "companion" | 15 | into an EHCI controller, they are given to a USB 1.1 "companion" |
diff --git a/Documentation/usb/gadget_multi.txt b/Documentation/usb/gadget_multi.txt new file mode 100644 index 000000000000..80f4ef0eb75b --- /dev/null +++ b/Documentation/usb/gadget_multi.txt | |||
@@ -0,0 +1,150 @@ | |||
1 | -*- org -*- | ||
2 | |||
3 | * Overview | ||
4 | |||
5 | The Multifunction Composite Gadget (or g_multi) is a composite gadget | ||
6 | that makes extensive use of the composite framework to provide | ||
7 | a... multifunction gadget. | ||
8 | |||
9 | In it's standard configuration it provides a single USB configuration | ||
10 | with RNDIS[1] (that is Ethernet), USB CDC[2] ACM (that is serial) and | ||
11 | USB Mass Storage functions. | ||
12 | |||
13 | A CDC ECM (Ethernet) function may be turned on via a Kconfig option | ||
14 | and RNDIS can be turned off. If they are both enabled the gadget will | ||
15 | have two configurations -- one with RNDIS and another with CDC ECM[3]. | ||
16 | |||
17 | Please not that if you use non-standard configuration (that is enable | ||
18 | CDC ECM) you may need to change vendor and/or product ID. | ||
19 | |||
20 | * Host drivers | ||
21 | |||
22 | To make use of the gadget one needs to make it work on host side -- | ||
23 | without that there's no hope of achieving anything with the gadget. | ||
24 | As one might expect, things one need to do very from system to system. | ||
25 | |||
26 | ** Linux host drivers | ||
27 | |||
28 | Since the gadget uses standard composite framework and appears as such | ||
29 | to Linux host it does not need any additional drivers on Linux host | ||
30 | side. All the functions are handled by respective drivers developed | ||
31 | for them. | ||
32 | |||
33 | This is also true for two configuration set-up with RNDIS | ||
34 | configuration being the first one. Linux host will use the second | ||
35 | configuration with CDC ECM which should work better under Linux. | ||
36 | |||
37 | ** Windows host drivers | ||
38 | |||
39 | For the gadget two work under Windows two conditions have to be met: | ||
40 | |||
41 | *** Detecting as composite gadget | ||
42 | |||
43 | First of all, Windows need to detect the gadget as an USB composite | ||
44 | gadget which on its own have some conditions[4]. If they are met, | ||
45 | Windows lets USB Generic Parent Driver[5] handle the device which then | ||
46 | tries to much drivers for each individual interface (sort of, don't | ||
47 | get into too many details). | ||
48 | |||
49 | The good news is: you do not have to worry about most of the | ||
50 | conditions! | ||
51 | |||
52 | The only thing to worry is that the gadget has to have a single | ||
53 | configuration so a dual RNDIS and CDC ECM gadget won't work unless you | ||
54 | create a proper INF -- and of course, if you do submit it! | ||
55 | |||
56 | *** Installing drivers for each function | ||
57 | |||
58 | The other, trickier thing is making Windows install drivers for each | ||
59 | individual function. | ||
60 | |||
61 | For mass storage it is trivial since Windows detect it's an interface | ||
62 | implementing USB Mass Storage class and selects appropriate driver. | ||
63 | |||
64 | Things are harder with RDNIS and CDC ACM. | ||
65 | |||
66 | **** RNDIS | ||
67 | |||
68 | To make Windows select RNDIS drivers for the first function in the | ||
69 | gadget, one needs to use the [[file:linux.inf]] file provided with this | ||
70 | document. It "attaches" Window's RNDIS driver to the first interface | ||
71 | of the gadget. | ||
72 | |||
73 | Please note, that while testing we encountered some issues[6] when | ||
74 | RNDIS was not the first interface. You do not need to worry abut it | ||
75 | unless you are trying to develop your own gadget in which case watch | ||
76 | out for this bug. | ||
77 | |||
78 | **** CDC ACM | ||
79 | |||
80 | Similarly, [[file:linux-cdc-acm.inf]] is provided for CDC ACM. | ||
81 | |||
82 | **** Customising the gadget | ||
83 | |||
84 | If you intend to hack the g_multi gadget be advised that rearranging | ||
85 | functions will obviously change interface numbers for each of the | ||
86 | functionality. As an effect provided INFs won't work since they have | ||
87 | interface numbers hard-coded in them (it's not hard to change those | ||
88 | though[7]). | ||
89 | |||
90 | This also means, that after experimenting with g_multi and changing | ||
91 | provided functions one should change gadget's vendor and/or product ID | ||
92 | so there will be no collision with other customised gadgets or the | ||
93 | original gadget. | ||
94 | |||
95 | Failing to comply may cause brain damage after wondering for hours why | ||
96 | things don't work as intended before realising Windows have cached | ||
97 | some drivers information (changing USB port may sometimes help plus | ||
98 | you might try using USBDeview[8] to remove the phantom device). | ||
99 | |||
100 | **** INF testing | ||
101 | |||
102 | Provided INF files have been tested on Windows XP SP3, Windows Vista | ||
103 | and Windows 7, all 32-bit versions. It should work on 64-bit versions | ||
104 | as well. It most likely won't work on Windows prior to Windows XP | ||
105 | SP2. | ||
106 | |||
107 | ** Other systems | ||
108 | |||
109 | At this moment, drivers for any other systems have not been tested. | ||
110 | Knowing how MacOS is based on BSD and BSD is an Open Source it is | ||
111 | believed that it should (read: "I have no idea whether it will") work | ||
112 | out-of-the-box. | ||
113 | |||
114 | For more exotic systems I have even less to say... | ||
115 | |||
116 | Any testing and drivers *are* *welcome*! | ||
117 | |||
118 | * Authors | ||
119 | |||
120 | This document has been written by Michal Nazarewicz | ||
121 | ([[mailto:mina86@mina86.com]]). INF files have been hacked with | ||
122 | support of Marek Szyprowski ([[mailto:m.szyprowski@samsung.com]]) and | ||
123 | Xiaofan Chen ([[mailto:xiaofanc@gmail.com]]) basing on the MS RNDIS | ||
124 | template[9], Microchip's CDC ACM INF file and David Brownell's | ||
125 | ([[mailto:dbrownell@users.sourceforge.net]]) original INF files. | ||
126 | |||
127 | * Footnotes | ||
128 | |||
129 | [1] Remote Network Driver Interface Specification, | ||
130 | [[http://msdn.microsoft.com/en-us/library/ee484414.aspx]]. | ||
131 | |||
132 | [2] Communications Device Class Abstract Control Model, spec for this | ||
133 | and other USB classes can be found at | ||
134 | [[http://www.usb.org/developers/devclass_docs/]]. | ||
135 | |||
136 | [3] CDC Ethernet Control Model. | ||
137 | |||
138 | [4] [[http://msdn.microsoft.com/en-us/library/ff537109(v=VS.85).aspx]] | ||
139 | |||
140 | [5] [[http://msdn.microsoft.com/en-us/library/ff539234(v=VS.85).aspx]] | ||
141 | |||
142 | [6] To put it in some other nice words, Windows failed to respond to | ||
143 | any user input. | ||
144 | |||
145 | [7] You may find [[http://www.cygnal.org/ubb/Forum9/HTML/001050.html]] | ||
146 | useful. | ||
147 | |||
148 | [8] http://www.nirsoft.net/utils/usb_devices_view.html | ||
149 | |||
150 | [9] [[http://msdn.microsoft.com/en-us/library/ff570620.aspx]] | ||
diff --git a/Documentation/usb/gadget_serial.txt b/Documentation/usb/gadget_serial.txt index eac7df94d8e3..61e67f6a20a0 100644 --- a/Documentation/usb/gadget_serial.txt +++ b/Documentation/usb/gadget_serial.txt | |||
@@ -151,88 +151,23 @@ instructions below to install the host side driver. | |||
151 | 151 | ||
152 | Installing the Windows Host ACM Driver | 152 | Installing the Windows Host ACM Driver |
153 | -------------------------------------- | 153 | -------------------------------------- |
154 | To use the Windows ACM driver you must have the files "gserial.inf" | 154 | To use the Windows ACM driver you must have the "linux-cdc-acm.inf" |
155 | and "usbser.sys" together in a folder on the Windows machine. | 155 | file (provided along this document) which supports all recent versions |
156 | 156 | of Windows. | |
157 | The "gserial.inf" file is given here. | ||
158 | |||
159 | -------------------- CUT HERE -------------------- | ||
160 | [Version] | ||
161 | Signature="$Windows NT$" | ||
162 | Class=Ports | ||
163 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} | ||
164 | Provider=%LINUX% | ||
165 | DriverVer=08/17/2004,0.0.2.0 | ||
166 | ; Copyright (C) 2004 Al Borchers (alborchers@steinerpoint.com) | ||
167 | |||
168 | [Manufacturer] | ||
169 | %LINUX%=GSerialDeviceList | ||
170 | |||
171 | [GSerialDeviceList] | ||
172 | %GSERIAL%=GSerialInstall, USB\VID_0525&PID_A4A7 | ||
173 | |||
174 | [DestinationDirs] | ||
175 | DefaultDestDir=10,System32\Drivers | ||
176 | |||
177 | [GSerialInstall] | ||
178 | CopyFiles=GSerialCopyFiles | ||
179 | AddReg=GSerialAddReg | ||
180 | |||
181 | [GSerialCopyFiles] | ||
182 | usbser.sys | ||
183 | |||
184 | [GSerialAddReg] | ||
185 | HKR,,DevLoader,,*ntkern | ||
186 | HKR,,NTMPDriver,,usbser.sys | ||
187 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" | ||
188 | |||
189 | [GSerialInstall.Services] | ||
190 | AddService = usbser,0x0002,GSerialService | ||
191 | |||
192 | [GSerialService] | ||
193 | DisplayName = %GSERIAL_DISPLAY_NAME% | ||
194 | ServiceType = 1 ; SERVICE_KERNEL_DRIVER | ||
195 | StartType = 3 ; SERVICE_DEMAND_START | ||
196 | ErrorControl = 1 ; SERVICE_ERROR_NORMAL | ||
197 | ServiceBinary = %10%\System32\Drivers\usbser.sys | ||
198 | LoadOrderGroup = Base | ||
199 | |||
200 | [Strings] | ||
201 | LINUX = "Linux" | ||
202 | GSERIAL = "Gadget Serial" | ||
203 | GSERIAL_DISPLAY_NAME = "USB Gadget Serial Driver" | ||
204 | -------------------- CUT HERE -------------------- | ||
205 | |||
206 | The "usbser.sys" file comes with various versions of Windows. | ||
207 | For example, it can be found on Windows XP typically in | ||
208 | |||
209 | C:\WINDOWS\Driver Cache\i386\driver.cab | ||
210 | |||
211 | Or it can be found on the Windows 98SE CD in the "win98" folder | ||
212 | in the "DRIVER11.CAB" through "DRIVER20.CAB" cab files. You will | ||
213 | need the DOS "expand" program, the Cygwin "cabextract" program, or | ||
214 | a similar program to unpack these cab files and extract "usbser.sys". | ||
215 | |||
216 | For example, to extract "usbser.sys" into the current directory | ||
217 | on Windows XP, open a DOS window and run a command like | ||
218 | |||
219 | expand C:\WINDOWS\Driver~1\i386\driver.cab -F:usbser.sys . | ||
220 | |||
221 | (Thanks to Nishant Kamat for pointing out this DOS command.) | ||
222 | 157 | ||
223 | When the gadget serial driver is loaded and the USB device connected | 158 | When the gadget serial driver is loaded and the USB device connected |
224 | to the Windows host with a USB cable, Windows should recognize the | 159 | to the Windows host with a USB cable, Windows should recognize the |
225 | gadget serial device and ask for a driver. Tell Windows to find the | 160 | gadget serial device and ask for a driver. Tell Windows to find the |
226 | driver in the folder that contains "gserial.inf" and "usbser.sys". | 161 | driver in the folder that contains the "linux-cdc-acm.inf" file. |
227 | 162 | ||
228 | For example, on Windows XP, when the gadget serial device is first | 163 | For example, on Windows XP, when the gadget serial device is first |
229 | plugged in, the "Found New Hardware Wizard" starts up. Select | 164 | plugged in, the "Found New Hardware Wizard" starts up. Select |
230 | "Install from a list or specific location (Advanced)", then on | 165 | "Install from a list or specific location (Advanced)", then on the |
231 | the next screen select "Include this location in the search" and | 166 | next screen select "Include this location in the search" and enter the |
232 | enter the path or browse to the folder containing "gserial.inf" and | 167 | path or browse to the folder containing the "linux-cdc-acm.inf" file. |
233 | "usbser.sys". Windows will complain that the Gadget Serial driver | 168 | Windows will complain that the Gadget Serial driver has not passed |
234 | has not passed Windows Logo testing, but select "Continue anyway" | 169 | Windows Logo testing, but select "Continue anyway" and finish the |
235 | and finish the driver installation. | 170 | driver installation. |
236 | 171 | ||
237 | On Windows XP, in the "Device Manager" (under "Control Panel", | 172 | On Windows XP, in the "Device Manager" (under "Control Panel", |
238 | "System", "Hardware") expand the "Ports (COM & LPT)" entry and you | 173 | "System", "Hardware") expand the "Ports (COM & LPT)" entry and you |
@@ -345,5 +280,3 @@ you should be able to send data back and forth between the gadget | |||
345 | side and host side systems. Anything you type on the terminal | 280 | side and host side systems. Anything you type on the terminal |
346 | window on the gadget side should appear in the terminal window on | 281 | window on the gadget side should appear in the terminal window on |
347 | the host side and vice versa. | 282 | the host side and vice versa. |
348 | |||
349 | |||
diff --git a/Documentation/usb/hotplug.txt b/Documentation/usb/hotplug.txt index f53170665f37..4c945716a660 100644 --- a/Documentation/usb/hotplug.txt +++ b/Documentation/usb/hotplug.txt | |||
@@ -10,7 +10,7 @@ immediately usable. That means the system must do many things, including: | |||
10 | 10 | ||
11 | - Bind a driver to that device. Bus frameworks do that using a | 11 | - Bind a driver to that device. Bus frameworks do that using a |
12 | device driver's probe() routine. | 12 | device driver's probe() routine. |
13 | 13 | ||
14 | - Tell other subsystems to configure the new device. Print | 14 | - Tell other subsystems to configure the new device. Print |
15 | queues may need to be enabled, networks brought up, disk | 15 | queues may need to be enabled, networks brought up, disk |
16 | partitions mounted, and so on. In some cases these will | 16 | partitions mounted, and so on. In some cases these will |
@@ -84,7 +84,7 @@ USB MODUTILS SUPPORT | |||
84 | Current versions of module-init-tools will create a "modules.usbmap" file | 84 | Current versions of module-init-tools will create a "modules.usbmap" file |
85 | which contains the entries from each driver's MODULE_DEVICE_TABLE. Such | 85 | which contains the entries from each driver's MODULE_DEVICE_TABLE. Such |
86 | files can be used by various user mode policy agents to make sure all the | 86 | files can be used by various user mode policy agents to make sure all the |
87 | right driver modules get loaded, either at boot time or later. | 87 | right driver modules get loaded, either at boot time or later. |
88 | 88 | ||
89 | See <linux/usb.h> for full information about such table entries; or look | 89 | See <linux/usb.h> for full information about such table entries; or look |
90 | at existing drivers. Each table entry describes one or more criteria to | 90 | at existing drivers. Each table entry describes one or more criteria to |
diff --git a/Documentation/usb/linux-cdc-acm.inf b/Documentation/usb/linux-cdc-acm.inf new file mode 100644 index 000000000000..612e7220fb29 --- /dev/null +++ b/Documentation/usb/linux-cdc-acm.inf | |||
@@ -0,0 +1,107 @@ | |||
1 | ; Windows USB CDC ACM Setup File | ||
2 | |||
3 | ; Based on INF template which was: | ||
4 | ; Copyright (c) 2000 Microsoft Corporation | ||
5 | ; Copyright (c) 2007 Microchip Technology Inc. | ||
6 | ; likely to be covered by the MLPL as found at: | ||
7 | ; <http://msdn.microsoft.com/en-us/cc300389.aspx#MLPL>. | ||
8 | ; For use only on Windows operating systems. | ||
9 | |||
10 | [Version] | ||
11 | Signature="$Windows NT$" | ||
12 | Class=Ports | ||
13 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} | ||
14 | Provider=%Linux% | ||
15 | DriverVer=11/15/2007,5.1.2600.0 | ||
16 | |||
17 | [Manufacturer] | ||
18 | %Linux%=DeviceList, NTamd64 | ||
19 | |||
20 | [DestinationDirs] | ||
21 | DefaultDestDir=12 | ||
22 | |||
23 | |||
24 | ;------------------------------------------------------------------------------ | ||
25 | ; Windows 2000/XP/Vista-32bit Sections | ||
26 | ;------------------------------------------------------------------------------ | ||
27 | |||
28 | [DriverInstall.nt] | ||
29 | include=mdmcpq.inf | ||
30 | CopyFiles=DriverCopyFiles.nt | ||
31 | AddReg=DriverInstall.nt.AddReg | ||
32 | |||
33 | [DriverCopyFiles.nt] | ||
34 | usbser.sys,,,0x20 | ||
35 | |||
36 | [DriverInstall.nt.AddReg] | ||
37 | HKR,,DevLoader,,*ntkern | ||
38 | HKR,,NTMPDriver,,USBSER.sys | ||
39 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" | ||
40 | |||
41 | [DriverInstall.nt.Services] | ||
42 | AddService=usbser, 0x00000002, DriverService.nt | ||
43 | |||
44 | [DriverService.nt] | ||
45 | DisplayName=%SERVICE% | ||
46 | ServiceType=1 | ||
47 | StartType=3 | ||
48 | ErrorControl=1 | ||
49 | ServiceBinary=%12%\USBSER.sys | ||
50 | |||
51 | ;------------------------------------------------------------------------------ | ||
52 | ; Vista-64bit Sections | ||
53 | ;------------------------------------------------------------------------------ | ||
54 | |||
55 | [DriverInstall.NTamd64] | ||
56 | include=mdmcpq.inf | ||
57 | CopyFiles=DriverCopyFiles.NTamd64 | ||
58 | AddReg=DriverInstall.NTamd64.AddReg | ||
59 | |||
60 | [DriverCopyFiles.NTamd64] | ||
61 | USBSER.sys,,,0x20 | ||
62 | |||
63 | [DriverInstall.NTamd64.AddReg] | ||
64 | HKR,,DevLoader,,*ntkern | ||
65 | HKR,,NTMPDriver,,USBSER.sys | ||
66 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" | ||
67 | |||
68 | [DriverInstall.NTamd64.Services] | ||
69 | AddService=usbser, 0x00000002, DriverService.NTamd64 | ||
70 | |||
71 | [DriverService.NTamd64] | ||
72 | DisplayName=%SERVICE% | ||
73 | ServiceType=1 | ||
74 | StartType=3 | ||
75 | ErrorControl=1 | ||
76 | ServiceBinary=%12%\USBSER.sys | ||
77 | |||
78 | |||
79 | ;------------------------------------------------------------------------------ | ||
80 | ; Vendor and Product ID Definitions | ||
81 | ;------------------------------------------------------------------------------ | ||
82 | ; When developing your USB device, the VID and PID used in the PC side | ||
83 | ; application program and the firmware on the microcontroller must match. | ||
84 | ; Modify the below line to use your VID and PID. Use the format as shown | ||
85 | ; below. | ||
86 | ; Note: One INF file can be used for multiple devices with different | ||
87 | ; VID and PIDs. For each supported device, append | ||
88 | ; ",USB\VID_xxxx&PID_yyyy" to the end of the line. | ||
89 | ;------------------------------------------------------------------------------ | ||
90 | [SourceDisksFiles] | ||
91 | [SourceDisksNames] | ||
92 | [DeviceList] | ||
93 | %DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_0525&PID_A4AB&MI_02 | ||
94 | |||
95 | [DeviceList.NTamd64] | ||
96 | %DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_0525&PID_A4AB&MI_02 | ||
97 | |||
98 | |||
99 | ;------------------------------------------------------------------------------ | ||
100 | ; String Definitions | ||
101 | ;------------------------------------------------------------------------------ | ||
102 | ;Modify these strings to customize your device | ||
103 | ;------------------------------------------------------------------------------ | ||
104 | [Strings] | ||
105 | Linux = "Linux Developer Community" | ||
106 | DESCRIPTION = "Gadget Serial" | ||
107 | SERVICE = "USB RS-232 Emulation Driver" | ||
diff --git a/Documentation/usb/linux.inf b/Documentation/usb/linux.inf index af71d87d9e94..4dee95851224 100644 --- a/Documentation/usb/linux.inf +++ b/Documentation/usb/linux.inf | |||
@@ -1,200 +1,66 @@ | |||
1 | ; MS-Windows driver config matching some basic modes of the | 1 | ; Based on template INF file found at |
2 | ; Linux-USB Ethernet/RNDIS gadget firmware: | 2 | ; <http://msdn.microsoft.com/en-us/library/ff570620.aspx> |
3 | ; | 3 | ; which was: |
4 | ; - RNDIS plus CDC Ethernet ... this may be familiar as a DOCSIS | 4 | ; Copyright (c) Microsoft Corporation |
5 | ; cable modem profile, and supports most non-Microsoft USB hosts | 5 | ; and released under the MLPL as found at: |
6 | ; | 6 | ; <http://msdn.microsoft.com/en-us/cc300389.aspx#MLPL>. |
7 | ; - RNDIS plus CDC Subset ... used by hardware that incapable of | 7 | ; For use only on Windows operating systems. |
8 | ; full CDC Ethernet support. | ||
9 | ; | ||
10 | ; Microsoft only directly supports RNDIS drivers, and bundled them into XP. | ||
11 | ; The Microsoft "Remote NDIS USB Driver Kit" is currently found at: | ||
12 | ; http://www.microsoft.com/whdc/device/network/ndis/rmndis.mspx | ||
13 | |||
14 | 8 | ||
15 | [Version] | 9 | [Version] |
16 | Signature = "$CHICAGO$" | 10 | Signature = "$Windows NT$" |
17 | Class = Net | 11 | Class = Net |
18 | ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} | 12 | ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} |
19 | Provider = %Linux% | 13 | Provider = %Linux% |
20 | Compatible = 1 | 14 | DriverVer = 06/21/2006,6.0.6000.16384 |
21 | MillenniumPreferred = .ME | ||
22 | DriverVer = 03/30/2004,0.0.0.0 | ||
23 | ; catalog file would be used by WHQL | ||
24 | ;CatalogFile = Linux.cat | ||
25 | 15 | ||
26 | [Manufacturer] | 16 | [Manufacturer] |
27 | %Linux% = LinuxDevices,NT.5.1 | 17 | %Linux% = LinuxDevices,NTx86,NTamd64,NTia64 |
18 | |||
19 | ; Decoration for x86 architecture | ||
20 | [LinuxDevices.NTx86] | ||
21 | %LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_0525&PID_a4ab&MI_00 | ||
28 | 22 | ||
29 | [LinuxDevices] | 23 | ; Decoration for x64 architecture |
30 | ; NetChip IDs, used by both firmware modes | 24 | [LinuxDevices.NTamd64] |
31 | %LinuxDevice% = RNDIS, USB\VID_0525&PID_a4a2 | 25 | %LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_0525&PID_a4ab&MI_00 |
32 | 26 | ||
33 | [LinuxDevices.NT.5.1] | 27 | ; Decoration for ia64 architecture |
34 | %LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2 | 28 | [LinuxDevices.NTia64] |
29 | %LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_0525&PID_a4ab&MI_00 | ||
35 | 30 | ||
31 | ;@@@ This is the common setting for setup | ||
36 | [ControlFlags] | 32 | [ControlFlags] |
37 | ExcludeFromSelect=* | 33 | ExcludeFromSelect=* |
38 | 34 | ||
39 | ; Windows 98, Windows 98 Second Edition specific sections -------- | 35 | ; DDInstall section |
40 | 36 | ; References the in-build Netrndis.inf | |
41 | [RNDIS] | ||
42 | DeviceID = usb8023 | ||
43 | MaxInstance = 512 | ||
44 | DriverVer = 03/30/2004,0.0.0.0 | ||
45 | AddReg = RNDIS_AddReg_98, RNDIS_AddReg_Common | ||
46 | |||
47 | [RNDIS_AddReg_98] | ||
48 | HKR, , DevLoader, 0, *ndis | ||
49 | HKR, , DeviceVxDs, 0, usb8023.sys | ||
50 | HKR, NDIS, LogDriverName, 0, "usb8023" | ||
51 | HKR, NDIS, MajorNdisVersion, 1, 5 | ||
52 | HKR, NDIS, MinorNdisVersion, 1, 0 | ||
53 | HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5" | ||
54 | HKR, Ndi\Interfaces, DefLower, 0, "ethernet" | ||
55 | HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5" | ||
56 | HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" | ||
57 | HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_98" | ||
58 | HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_98" | ||
59 | HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_98" | ||
60 | HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2" | ||
61 | |||
62 | [RNDIS_Install_98] | ||
63 | CopyFiles=RNDIS_CopyFiles_98 | ||
64 | |||
65 | [RNDIS_CopyFiles_98] | ||
66 | usb8023.sys, usb8023w.sys, , 0 | ||
67 | rndismp.sys, rndismpw.sys, , 0 | ||
68 | |||
69 | ; Windows Millennium Edition specific sections -------------------- | ||
70 | |||
71 | [RNDIS.ME] | ||
72 | DeviceID = usb8023 | ||
73 | MaxInstance = 512 | ||
74 | DriverVer = 03/30/2004,0.0.0.0 | ||
75 | AddReg = RNDIS_AddReg_ME, RNDIS_AddReg_Common | ||
76 | Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI | ||
77 | BusType = 15 | ||
78 | |||
79 | [RNDIS_AddReg_ME] | ||
80 | HKR, , DevLoader, 0, *ndis | ||
81 | HKR, , DeviceVxDs, 0, usb8023.sys | ||
82 | HKR, NDIS, LogDriverName, 0, "usb8023" | ||
83 | HKR, NDIS, MajorNdisVersion, 1, 5 | ||
84 | HKR, NDIS, MinorNdisVersion, 1, 0 | ||
85 | HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5" | ||
86 | HKR, Ndi\Interfaces, DefLower, 0, "ethernet" | ||
87 | HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5" | ||
88 | HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" | ||
89 | HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_ME" | ||
90 | HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_ME" | ||
91 | HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_ME" | ||
92 | HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2" | ||
93 | |||
94 | [RNDIS_Install_ME] | ||
95 | CopyFiles=RNDIS_CopyFiles_ME | ||
96 | |||
97 | [RNDIS_CopyFiles_ME] | ||
98 | usb8023.sys, usb8023m.sys, , 0 | ||
99 | rndismp.sys, rndismpm.sys, , 0 | ||
100 | |||
101 | ; Windows 2000 specific sections --------------------------------- | ||
102 | |||
103 | [RNDIS.NT] | ||
104 | Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI | ||
105 | BusType = 15 | ||
106 | DriverVer = 03/30/2004,0.0.0.0 | ||
107 | AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common | ||
108 | CopyFiles = RNDIS_CopyFiles_NT | ||
109 | |||
110 | [RNDIS.NT.Services] | ||
111 | AddService = USB_RNDIS, 2, RNDIS_ServiceInst_NT, RNDIS_EventLog | ||
112 | |||
113 | [RNDIS_CopyFiles_NT] | ||
114 | ; no rename of files on Windows 2000, use the 'k' names as is | ||
115 | usb8023k.sys, , , 0 | ||
116 | rndismpk.sys, , , 0 | ||
117 | |||
118 | [RNDIS_ServiceInst_NT] | ||
119 | DisplayName = %ServiceDisplayName% | ||
120 | ServiceType = 1 | ||
121 | StartType = 3 | ||
122 | ErrorControl = 1 | ||
123 | ServiceBinary = %12%\usb8023k.sys | ||
124 | LoadOrderGroup = NDIS | ||
125 | AddReg = RNDIS_WMI_AddReg_NT | ||
126 | |||
127 | [RNDIS_WMI_AddReg_NT] | ||
128 | HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismpk.sys" | ||
129 | |||
130 | ; Windows XP specific sections ----------------------------------- | ||
131 | |||
132 | [RNDIS.NT.5.1] | 37 | [RNDIS.NT.5.1] |
133 | Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI | 38 | Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI |
134 | BusType = 15 | 39 | BusType = 15 |
135 | DriverVer = 03/30/2004,0.0.0.0 | 40 | ; NEVER REMOVE THE FOLLOWING REFERENCE FOR NETRNDIS.INF |
136 | AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common | 41 | include = netrndis.inf |
137 | ; no copyfiles - the files are already in place | 42 | needs = Usb_Rndis.ndi |
138 | 43 | AddReg = Rndis_AddReg_Vista | |
44 | |||
45 | ; DDInstal.Services section | ||
139 | [RNDIS.NT.5.1.Services] | 46 | [RNDIS.NT.5.1.Services] |
140 | AddService = USB_RNDIS, 2, RNDIS_ServiceInst_51, RNDIS_EventLog | 47 | include = netrndis.inf |
141 | 48 | needs = Usb_Rndis.ndi.Services | |
142 | [RNDIS_ServiceInst_51] | 49 | |
143 | DisplayName = %ServiceDisplayName% | 50 | ; Optional registry settings. You can modify as needed. |
144 | ServiceType = 1 | 51 | [RNDIS_AddReg_Vista] |
145 | StartType = 3 | 52 | HKR, NDI\params\VistaProperty, ParamDesc, 0, %Vista_Property% |
146 | ErrorControl = 1 | 53 | HKR, NDI\params\VistaProperty, type, 0, "edit" |
147 | ServiceBinary = %12%\usb8023.sys | 54 | HKR, NDI\params\VistaProperty, LimitText, 0, "12" |
148 | LoadOrderGroup = NDIS | 55 | HKR, NDI\params\VistaProperty, UpperCase, 0, "1" |
149 | AddReg = RNDIS_WMI_AddReg_51 | 56 | HKR, NDI\params\VistaProperty, default, 0, " " |
150 | 57 | HKR, NDI\params\VistaProperty, optional, 0, "1" | |
151 | [RNDIS_WMI_AddReg_51] | 58 | |
152 | HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismp.sys" | 59 | ; No sys copyfiles - the sys files are already in-build |
153 | 60 | ; (part of the operating system). | |
154 | ; Windows 2000 and Windows XP common sections -------------------- | 61 | ; We do not support XP SP1-, 2003 SP1-, ME, 9x. |
155 | |||
156 | [RNDIS_AddReg_NT] | ||
157 | HKR, Ndi, Service, 0, "USB_RNDIS" | ||
158 | HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" | ||
159 | HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" | ||
160 | |||
161 | [RNDIS_EventLog] | ||
162 | AddReg = RNDIS_EventLog_AddReg | ||
163 | |||
164 | [RNDIS_EventLog_AddReg] | ||
165 | HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll" | ||
166 | HKR, , TypesSupported, 0x00010001, 7 | ||
167 | |||
168 | ; Common Sections ------------------------------------------------- | ||
169 | |||
170 | [RNDIS_AddReg_Common] | ||
171 | HKR, NDI\params\NetworkAddress, ParamDesc, 0, %NetworkAddress% | ||
172 | HKR, NDI\params\NetworkAddress, type, 0, "edit" | ||
173 | HKR, NDI\params\NetworkAddress, LimitText, 0, "12" | ||
174 | HKR, NDI\params\NetworkAddress, UpperCase, 0, "1" | ||
175 | HKR, NDI\params\NetworkAddress, default, 0, " " | ||
176 | HKR, NDI\params\NetworkAddress, optional, 0, "1" | ||
177 | |||
178 | [SourceDisksNames] | ||
179 | 1=%SourceDisk%,,1 | ||
180 | |||
181 | [SourceDisksFiles] | ||
182 | usb8023m.sys=1 | ||
183 | rndismpm.sys=1 | ||
184 | usb8023w.sys=1 | ||
185 | rndismpw.sys=1 | ||
186 | usb8023k.sys=1 | ||
187 | rndismpk.sys=1 | ||
188 | |||
189 | [DestinationDirs] | ||
190 | RNDIS_CopyFiles_98 = 10, system32/drivers | ||
191 | RNDIS_CopyFiles_ME = 10, system32/drivers | ||
192 | RNDIS_CopyFiles_NT = 12 | ||
193 | 62 | ||
194 | [Strings] | 63 | [Strings] |
195 | ServiceDisplayName = "USB Remote NDIS Network Device Driver" | ||
196 | NetworkAddress = "Network Address" | ||
197 | Linux = "Linux Developer Community" | 64 | Linux = "Linux Developer Community" |
198 | LinuxDevice = "Linux USB Ethernet/RNDIS Gadget" | 65 | LinuxDevice = "Linux USB Ethernet/RNDIS Gadget" |
199 | SourceDisk = "Ethernet/RNDIS Gadget Driver Install Disk" | 66 | Vista_Property = "Optional Vista Property" |
200 | |||