diff options
Diffstat (limited to 'Documentation')
58 files changed, 1370 insertions, 739 deletions
diff --git a/Documentation/ABI/stable/sysfs-class-backlight b/Documentation/ABI/stable/sysfs-class-backlight new file mode 100644 index 000000000000..4d637e1c4ff7 --- /dev/null +++ b/Documentation/ABI/stable/sysfs-class-backlight | |||
@@ -0,0 +1,36 @@ | |||
1 | What: /sys/class/backlight/<backlight>/bl_power | ||
2 | Date: April 2005 | ||
3 | KernelVersion: 2.6.12 | ||
4 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
5 | Description: | ||
6 | Control BACKLIGHT power, values are FB_BLANK_* from fb.h | ||
7 | - FB_BLANK_UNBLANK (0) : power on. | ||
8 | - FB_BLANK_POWERDOWN (4) : power off | ||
9 | Users: HAL | ||
10 | |||
11 | What: /sys/class/backlight/<backlight>/brightness | ||
12 | Date: April 2005 | ||
13 | KernelVersion: 2.6.12 | ||
14 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
15 | Description: | ||
16 | Control the brightness for this <backlight>. Values | ||
17 | are between 0 and max_brightness. This file will also | ||
18 | show the brightness level stored in the driver, which | ||
19 | may not be the actual brightness (see actual_brightness). | ||
20 | Users: HAL | ||
21 | |||
22 | What: /sys/class/backlight/<backlight>/actual_brightness | ||
23 | Date: March 2006 | ||
24 | KernelVersion: 2.6.17 | ||
25 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
26 | Description: | ||
27 | Show the actual brightness by querying the hardware. | ||
28 | Users: HAL | ||
29 | |||
30 | What: /sys/class/backlight/<backlight>/max_brightness | ||
31 | Date: April 2005 | ||
32 | KernelVersion: 2.6.12 | ||
33 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
34 | Description: | ||
35 | Maximum brightness for <backlight>. | ||
36 | Users: HAL | ||
diff --git a/Documentation/ABI/testing/sysfs-class-lcd b/Documentation/ABI/testing/sysfs-class-lcd new file mode 100644 index 000000000000..35906bf7aa70 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-lcd | |||
@@ -0,0 +1,23 @@ | |||
1 | What: /sys/class/lcd/<lcd>/lcd_power | ||
2 | Date: April 2005 | ||
3 | KernelVersion: 2.6.12 | ||
4 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
5 | Description: | ||
6 | Control LCD power, values are FB_BLANK_* from fb.h | ||
7 | - FB_BLANK_UNBLANK (0) : power on. | ||
8 | - FB_BLANK_POWERDOWN (4) : power off | ||
9 | |||
10 | What: /sys/class/lcd/<lcd>/contrast | ||
11 | Date: April 2005 | ||
12 | KernelVersion: 2.6.12 | ||
13 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
14 | Description: | ||
15 | Current contrast of this LCD device. Value is between 0 and | ||
16 | /sys/class/lcd/<lcd>/max_contrast. | ||
17 | |||
18 | What: /sys/class/lcd/<lcd>/max_contrast | ||
19 | Date: April 2005 | ||
20 | KernelVersion: 2.6.12 | ||
21 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
22 | Description: | ||
23 | Maximum contrast for this LCD device. | ||
diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led new file mode 100644 index 000000000000..9e4541d71cb6 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-led | |||
@@ -0,0 +1,28 @@ | |||
1 | What: /sys/class/leds/<led>/brightness | ||
2 | Date: March 2006 | ||
3 | KernelVersion: 2.6.17 | ||
4 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
5 | Description: | ||
6 | Set the brightness of the LED. Most LEDs don't | ||
7 | have hardware brightness support so will just be turned on for | ||
8 | non-zero brightness settings. The value is between 0 and | ||
9 | /sys/class/leds/<led>/max_brightness. | ||
10 | |||
11 | What: /sys/class/leds/<led>/max_brightness | ||
12 | Date: March 2006 | ||
13 | KernelVersion: 2.6.17 | ||
14 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
15 | Description: | ||
16 | Maximum brightness level for this led, default is 255 (LED_FULL). | ||
17 | |||
18 | What: /sys/class/leds/<led>/trigger | ||
19 | Date: March 2006 | ||
20 | KernelVersion: 2.6.17 | ||
21 | Contact: Richard Purdie <rpurdie@rpsys.net> | ||
22 | Description: | ||
23 | Set the trigger for this LED. A trigger is a kernel based source | ||
24 | of led events. | ||
25 | You can change triggers in a similar manner to the way an IO | ||
26 | scheduler is chosen. Trigger specific parameters can appear in | ||
27 | /sys/class/leds/<led> once a given trigger is selected. | ||
28 | |||
diff --git a/Documentation/ABI/testing/sysfs-gpio b/Documentation/ABI/testing/sysfs-gpio index 8aab8092ad35..80f4c94c7bef 100644 --- a/Documentation/ABI/testing/sysfs-gpio +++ b/Documentation/ABI/testing/sysfs-gpio | |||
@@ -19,6 +19,7 @@ Description: | |||
19 | /gpioN ... for each exported GPIO #N | 19 | /gpioN ... for each exported GPIO #N |
20 | /value ... always readable, writes fail for input GPIOs | 20 | /value ... always readable, writes fail for input GPIOs |
21 | /direction ... r/w as: in, out (default low); write: high, low | 21 | /direction ... r/w as: in, out (default low); write: high, low |
22 | /edge ... r/w as: none, falling, rising, both | ||
22 | /gpiochipN ... for each gpiochip; #N is its first GPIO | 23 | /gpiochipN ... for each gpiochip; #N is its first GPIO |
23 | /base ... (r/o) same as N | 24 | /base ... (r/o) same as N |
24 | /label ... (r/o) descriptive, not necessarily unique | 25 | /label ... (r/o) descriptive, not necessarily unique |
diff --git a/Documentation/ABI/testing/sysfs-platform-asus-laptop b/Documentation/ABI/testing/sysfs-platform-asus-laptop new file mode 100644 index 000000000000..a1cb660c50cf --- /dev/null +++ b/Documentation/ABI/testing/sysfs-platform-asus-laptop | |||
@@ -0,0 +1,52 @@ | |||
1 | What: /sys/devices/platform/asus-laptop/display | ||
2 | Date: January 2007 | ||
3 | KernelVersion: 2.6.20 | ||
4 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
5 | Description: | ||
6 | This file allows display switching. The value | ||
7 | is composed by 4 bits and defined as follow: | ||
8 | 4321 | ||
9 | |||`- LCD | ||
10 | ||`-- CRT | ||
11 | |`--- TV | ||
12 | `---- DVI | ||
13 | Ex: - 0 (0000b) means no display | ||
14 | - 3 (0011b) CRT+LCD. | ||
15 | |||
16 | What: /sys/devices/platform/asus-laptop/gps | ||
17 | Date: January 2007 | ||
18 | KernelVersion: 2.6.20 | ||
19 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
20 | Description: | ||
21 | Control the gps device. 1 means on, 0 means off. | ||
22 | Users: Lapsus | ||
23 | |||
24 | What: /sys/devices/platform/asus-laptop/ledd | ||
25 | Date: January 2007 | ||
26 | KernelVersion: 2.6.20 | ||
27 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
28 | Description: | ||
29 | Some models like the W1N have a LED display that can be | ||
30 | used to display several informations. | ||
31 | To control the LED display, use the following : | ||
32 | echo 0x0T000DDD > /sys/devices/platform/asus-laptop/ | ||
33 | where T control the 3 letters display, and DDD the 3 digits display. | ||
34 | The DDD table can be found in Documentation/laptops/asus-laptop.txt | ||
35 | |||
36 | What: /sys/devices/platform/asus-laptop/bluetooth | ||
37 | Date: January 2007 | ||
38 | KernelVersion: 2.6.20 | ||
39 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
40 | Description: | ||
41 | Control the bluetooth device. 1 means on, 0 means off. | ||
42 | This may control the led, the device or both. | ||
43 | Users: Lapsus | ||
44 | |||
45 | What: /sys/devices/platform/asus-laptop/wlan | ||
46 | Date: January 2007 | ||
47 | KernelVersion: 2.6.20 | ||
48 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
49 | Description: | ||
50 | Control the bluetooth device. 1 means on, 0 means off. | ||
51 | This may control the led, the device or both. | ||
52 | Users: Lapsus | ||
diff --git a/Documentation/ABI/testing/sysfs-platform-eeepc-laptop b/Documentation/ABI/testing/sysfs-platform-eeepc-laptop new file mode 100644 index 000000000000..7445dfb321b5 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-platform-eeepc-laptop | |||
@@ -0,0 +1,50 @@ | |||
1 | What: /sys/devices/platform/eeepc-laptop/disp | ||
2 | Date: May 2008 | ||
3 | KernelVersion: 2.6.26 | ||
4 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
5 | Description: | ||
6 | This file allows display switching. | ||
7 | - 1 = LCD | ||
8 | - 2 = CRT | ||
9 | - 3 = LCD+CRT | ||
10 | If you run X11, you should use xrandr instead. | ||
11 | |||
12 | What: /sys/devices/platform/eeepc-laptop/camera | ||
13 | Date: May 2008 | ||
14 | KernelVersion: 2.6.26 | ||
15 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
16 | Description: | ||
17 | Control the camera. 1 means on, 0 means off. | ||
18 | |||
19 | What: /sys/devices/platform/eeepc-laptop/cardr | ||
20 | Date: May 2008 | ||
21 | KernelVersion: 2.6.26 | ||
22 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
23 | Description: | ||
24 | Control the card reader. 1 means on, 0 means off. | ||
25 | |||
26 | What: /sys/devices/platform/eeepc-laptop/cpufv | ||
27 | Date: Jun 2009 | ||
28 | KernelVersion: 2.6.31 | ||
29 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
30 | Description: | ||
31 | Change CPU clock configuration. | ||
32 | On the Eee PC 1000H there are three available clock configuration: | ||
33 | * 0 -> Super Performance Mode | ||
34 | * 1 -> High Performance Mode | ||
35 | * 2 -> Power Saving Mode | ||
36 | On Eee PC 701 there is only 2 available clock configurations. | ||
37 | Available configuration are listed in available_cpufv file. | ||
38 | Reading this file will show the raw hexadecimal value which | ||
39 | is defined as follow: | ||
40 | | 8 bit | 8 bit | | ||
41 | | `---- Current mode | ||
42 | `------------ Availables modes | ||
43 | For example, 0x301 means: mode 1 selected, 3 available modes. | ||
44 | |||
45 | What: /sys/devices/platform/eeepc-laptop/available_cpufv | ||
46 | Date: Jun 2009 | ||
47 | KernelVersion: 2.6.31 | ||
48 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
49 | Description: | ||
50 | List available cpufv modes. | ||
diff --git a/Documentation/Intel-IOMMU.txt b/Documentation/Intel-IOMMU.txt index 21bc416d887e..cf9431db8731 100644 --- a/Documentation/Intel-IOMMU.txt +++ b/Documentation/Intel-IOMMU.txt | |||
@@ -56,11 +56,7 @@ Graphics Problems? | |||
56 | ------------------ | 56 | ------------------ |
57 | If you encounter issues with graphics devices, you can try adding | 57 | If you encounter issues with graphics devices, you can try adding |
58 | option intel_iommu=igfx_off to turn off the integrated graphics engine. | 58 | option intel_iommu=igfx_off to turn off the integrated graphics engine. |
59 | 59 | If this fixes anything, please ensure you file a bug reporting the problem. | |
60 | If it happens to be a PCI device included in the INCLUDE_ALL Engine, | ||
61 | then try enabling CONFIG_DMAR_GFX_WA to setup a 1-1 map. We hear | ||
62 | graphics drivers may be in process of using DMA api's in the near | ||
63 | future and at that time this option can be yanked out. | ||
64 | 60 | ||
65 | Some exceptions to IOVA | 61 | Some exceptions to IOVA |
66 | ----------------------- | 62 | ----------------------- |
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index aa73e72fd793..6e25c2659e0a 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c | |||
@@ -116,7 +116,7 @@ error: | |||
116 | } | 116 | } |
117 | 117 | ||
118 | 118 | ||
119 | int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, | 119 | static int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, |
120 | __u8 genl_cmd, __u16 nla_type, | 120 | __u8 genl_cmd, __u16 nla_type, |
121 | void *nla_data, int nla_len) | 121 | void *nla_data, int nla_len) |
122 | { | 122 | { |
@@ -160,7 +160,7 @@ int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, | |||
160 | * Probe the controller in genetlink to find the family id | 160 | * Probe the controller in genetlink to find the family id |
161 | * for the TASKSTATS family | 161 | * for the TASKSTATS family |
162 | */ | 162 | */ |
163 | int get_family_id(int sd) | 163 | static int get_family_id(int sd) |
164 | { | 164 | { |
165 | struct { | 165 | struct { |
166 | struct nlmsghdr n; | 166 | struct nlmsghdr n; |
@@ -190,7 +190,7 @@ int get_family_id(int sd) | |||
190 | return id; | 190 | return id; |
191 | } | 191 | } |
192 | 192 | ||
193 | void print_delayacct(struct taskstats *t) | 193 | static void print_delayacct(struct taskstats *t) |
194 | { | 194 | { |
195 | printf("\n\nCPU %15s%15s%15s%15s\n" | 195 | printf("\n\nCPU %15s%15s%15s%15s\n" |
196 | " %15llu%15llu%15llu%15llu\n" | 196 | " %15llu%15llu%15llu%15llu\n" |
@@ -216,7 +216,7 @@ void print_delayacct(struct taskstats *t) | |||
216 | (unsigned long long)t->freepages_delay_total); | 216 | (unsigned long long)t->freepages_delay_total); |
217 | } | 217 | } |
218 | 218 | ||
219 | void task_context_switch_counts(struct taskstats *t) | 219 | static void task_context_switch_counts(struct taskstats *t) |
220 | { | 220 | { |
221 | printf("\n\nTask %15s%15s\n" | 221 | printf("\n\nTask %15s%15s\n" |
222 | " %15llu%15llu\n", | 222 | " %15llu%15llu\n", |
@@ -224,7 +224,7 @@ void task_context_switch_counts(struct taskstats *t) | |||
224 | (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw); | 224 | (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw); |
225 | } | 225 | } |
226 | 226 | ||
227 | void print_cgroupstats(struct cgroupstats *c) | 227 | static void print_cgroupstats(struct cgroupstats *c) |
228 | { | 228 | { |
229 | printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " | 229 | printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " |
230 | "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping, | 230 | "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping, |
@@ -235,7 +235,7 @@ void print_cgroupstats(struct cgroupstats *c) | |||
235 | } | 235 | } |
236 | 236 | ||
237 | 237 | ||
238 | void print_ioacct(struct taskstats *t) | 238 | static void print_ioacct(struct taskstats *t) |
239 | { | 239 | { |
240 | printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n", | 240 | printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n", |
241 | t->ac_comm, | 241 | t->ac_comm, |
diff --git a/Documentation/auxdisplay/cfag12864b-example.c b/Documentation/auxdisplay/cfag12864b-example.c index 2caeea5e4993..e7823ffb1ca0 100644 --- a/Documentation/auxdisplay/cfag12864b-example.c +++ b/Documentation/auxdisplay/cfag12864b-example.c | |||
@@ -62,7 +62,7 @@ unsigned char cfag12864b_buffer[CFAG12864B_SIZE]; | |||
62 | * Unable to open: return = -1 | 62 | * Unable to open: return = -1 |
63 | * Unable to mmap: return = -2 | 63 | * Unable to mmap: return = -2 |
64 | */ | 64 | */ |
65 | int cfag12864b_init(char *path) | 65 | static int cfag12864b_init(char *path) |
66 | { | 66 | { |
67 | cfag12864b_fd = open(path, O_RDWR); | 67 | cfag12864b_fd = open(path, O_RDWR); |
68 | if (cfag12864b_fd == -1) | 68 | if (cfag12864b_fd == -1) |
@@ -81,7 +81,7 @@ int cfag12864b_init(char *path) | |||
81 | /* | 81 | /* |
82 | * exit a cfag12864b framebuffer device | 82 | * exit a cfag12864b framebuffer device |
83 | */ | 83 | */ |
84 | void cfag12864b_exit(void) | 84 | static void cfag12864b_exit(void) |
85 | { | 85 | { |
86 | munmap(cfag12864b_mem, CFAG12864B_SIZE); | 86 | munmap(cfag12864b_mem, CFAG12864B_SIZE); |
87 | close(cfag12864b_fd); | 87 | close(cfag12864b_fd); |
@@ -90,7 +90,7 @@ void cfag12864b_exit(void) | |||
90 | /* | 90 | /* |
91 | * set (x, y) pixel | 91 | * set (x, y) pixel |
92 | */ | 92 | */ |
93 | void cfag12864b_set(unsigned char x, unsigned char y) | 93 | static void cfag12864b_set(unsigned char x, unsigned char y) |
94 | { | 94 | { |
95 | if (CFAG12864B_CHECK(x, y)) | 95 | if (CFAG12864B_CHECK(x, y)) |
96 | cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |= | 96 | cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |= |
@@ -100,7 +100,7 @@ void cfag12864b_set(unsigned char x, unsigned char y) | |||
100 | /* | 100 | /* |
101 | * unset (x, y) pixel | 101 | * unset (x, y) pixel |
102 | */ | 102 | */ |
103 | void cfag12864b_unset(unsigned char x, unsigned char y) | 103 | static void cfag12864b_unset(unsigned char x, unsigned char y) |
104 | { | 104 | { |
105 | if (CFAG12864B_CHECK(x, y)) | 105 | if (CFAG12864B_CHECK(x, y)) |
106 | cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &= | 106 | cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &= |
@@ -113,7 +113,7 @@ void cfag12864b_unset(unsigned char x, unsigned char y) | |||
113 | * Pixel off: return = 0 | 113 | * Pixel off: return = 0 |
114 | * Pixel on: return = 1 | 114 | * Pixel on: return = 1 |
115 | */ | 115 | */ |
116 | unsigned char cfag12864b_isset(unsigned char x, unsigned char y) | 116 | static unsigned char cfag12864b_isset(unsigned char x, unsigned char y) |
117 | { | 117 | { |
118 | if (CFAG12864B_CHECK(x, y)) | 118 | if (CFAG12864B_CHECK(x, y)) |
119 | if (cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] & | 119 | if (cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] & |
@@ -126,7 +126,7 @@ unsigned char cfag12864b_isset(unsigned char x, unsigned char y) | |||
126 | /* | 126 | /* |
127 | * not (x, y) pixel | 127 | * not (x, y) pixel |
128 | */ | 128 | */ |
129 | void cfag12864b_not(unsigned char x, unsigned char y) | 129 | static void cfag12864b_not(unsigned char x, unsigned char y) |
130 | { | 130 | { |
131 | if (cfag12864b_isset(x, y)) | 131 | if (cfag12864b_isset(x, y)) |
132 | cfag12864b_unset(x, y); | 132 | cfag12864b_unset(x, y); |
@@ -137,7 +137,7 @@ void cfag12864b_not(unsigned char x, unsigned char y) | |||
137 | /* | 137 | /* |
138 | * fill (set all pixels) | 138 | * fill (set all pixels) |
139 | */ | 139 | */ |
140 | void cfag12864b_fill(void) | 140 | static void cfag12864b_fill(void) |
141 | { | 141 | { |
142 | unsigned short i; | 142 | unsigned short i; |
143 | 143 | ||
@@ -148,7 +148,7 @@ void cfag12864b_fill(void) | |||
148 | /* | 148 | /* |
149 | * clear (unset all pixels) | 149 | * clear (unset all pixels) |
150 | */ | 150 | */ |
151 | void cfag12864b_clear(void) | 151 | static void cfag12864b_clear(void) |
152 | { | 152 | { |
153 | unsigned short i; | 153 | unsigned short i; |
154 | 154 | ||
@@ -162,7 +162,7 @@ void cfag12864b_clear(void) | |||
162 | * Pixel off: src[i] = 0 | 162 | * Pixel off: src[i] = 0 |
163 | * Pixel on: src[i] > 0 | 163 | * Pixel on: src[i] > 0 |
164 | */ | 164 | */ |
165 | void cfag12864b_format(unsigned char * matrix) | 165 | static void cfag12864b_format(unsigned char * matrix) |
166 | { | 166 | { |
167 | unsigned char i, j, n; | 167 | unsigned char i, j, n; |
168 | 168 | ||
@@ -182,7 +182,7 @@ void cfag12864b_format(unsigned char * matrix) | |||
182 | /* | 182 | /* |
183 | * blit buffer to lcd | 183 | * blit buffer to lcd |
184 | */ | 184 | */ |
185 | void cfag12864b_blit(void) | 185 | static void cfag12864b_blit(void) |
186 | { | 186 | { |
187 | memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE); | 187 | memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE); |
188 | } | 188 | } |
@@ -194,11 +194,10 @@ void cfag12864b_blit(void) | |||
194 | */ | 194 | */ |
195 | 195 | ||
196 | #include <stdio.h> | 196 | #include <stdio.h> |
197 | #include <string.h> | ||
198 | 197 | ||
199 | #define EXAMPLES 6 | 198 | #define EXAMPLES 6 |
200 | 199 | ||
201 | void example(unsigned char n) | 200 | static void example(unsigned char n) |
202 | { | 201 | { |
203 | unsigned short i, j; | 202 | unsigned short i, j; |
204 | unsigned char matrix[CFAG12864B_WIDTH * CFAG12864B_HEIGHT]; | 203 | unsigned char matrix[CFAG12864B_WIDTH * CFAG12864B_HEIGHT]; |
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index 6eb1a97e88ce..455d4e6d346d 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -408,6 +408,26 @@ You can attach the current shell task by echoing 0: | |||
408 | 408 | ||
409 | # echo 0 > tasks | 409 | # echo 0 > tasks |
410 | 410 | ||
411 | 2.3 Mounting hierarchies by name | ||
412 | -------------------------------- | ||
413 | |||
414 | Passing the name=<x> option when mounting a cgroups hierarchy | ||
415 | associates the given name with the hierarchy. This can be used when | ||
416 | mounting a pre-existing hierarchy, in order to refer to it by name | ||
417 | rather than by its set of active subsystems. Each hierarchy is either | ||
418 | nameless, or has a unique name. | ||
419 | |||
420 | The name should match [\w.-]+ | ||
421 | |||
422 | When passing a name=<x> option for a new hierarchy, you need to | ||
423 | specify subsystems manually; the legacy behaviour of mounting all | ||
424 | subsystems when none are explicitly specified is not supported when | ||
425 | you give a subsystem a name. | ||
426 | |||
427 | The name of the subsystem appears as part of the hierarchy description | ||
428 | in /proc/mounts and /proc/<pid>/cgroups. | ||
429 | |||
430 | |||
411 | 3. Kernel API | 431 | 3. Kernel API |
412 | ============= | 432 | ============= |
413 | 433 | ||
@@ -501,7 +521,7 @@ rmdir() will fail with it. From this behavior, pre_destroy() can be | |||
501 | called multiple times against a cgroup. | 521 | called multiple times against a cgroup. |
502 | 522 | ||
503 | int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 523 | int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
504 | struct task_struct *task) | 524 | struct task_struct *task, bool threadgroup) |
505 | (cgroup_mutex held by caller) | 525 | (cgroup_mutex held by caller) |
506 | 526 | ||
507 | Called prior to moving a task into a cgroup; if the subsystem | 527 | Called prior to moving a task into a cgroup; if the subsystem |
@@ -509,14 +529,20 @@ returns an error, this will abort the attach operation. If a NULL | |||
509 | task is passed, then a successful result indicates that *any* | 529 | task is passed, then a successful result indicates that *any* |
510 | unspecified task can be moved into the cgroup. Note that this isn't | 530 | unspecified task can be moved into the cgroup. Note that this isn't |
511 | called on a fork. If this method returns 0 (success) then this should | 531 | called on a fork. If this method returns 0 (success) then this should |
512 | remain valid while the caller holds cgroup_mutex. | 532 | remain valid while the caller holds cgroup_mutex. If threadgroup is |
533 | true, then a successful result indicates that all threads in the given | ||
534 | thread's threadgroup can be moved together. | ||
513 | 535 | ||
514 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 536 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
515 | struct cgroup *old_cgrp, struct task_struct *task) | 537 | struct cgroup *old_cgrp, struct task_struct *task, |
538 | bool threadgroup) | ||
516 | (cgroup_mutex held by caller) | 539 | (cgroup_mutex held by caller) |
517 | 540 | ||
518 | Called after the task has been attached to the cgroup, to allow any | 541 | Called after the task has been attached to the cgroup, to allow any |
519 | post-attachment activity that requires memory allocations or blocking. | 542 | post-attachment activity that requires memory allocations or blocking. |
543 | If threadgroup is true, the subsystem should take care of all threads | ||
544 | in the specified thread's threadgroup. Currently does not support any | ||
545 | subsystem that might need the old_cgrp for every thread in the group. | ||
520 | 546 | ||
521 | void fork(struct cgroup_subsy *ss, struct task_struct *task) | 547 | void fork(struct cgroup_subsy *ss, struct task_struct *task) |
522 | 548 | ||
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 23d1262c0775..b871f2552b45 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -179,6 +179,9 @@ The reclaim algorithm has not been modified for cgroups, except that | |||
179 | pages that are selected for reclaiming come from the per cgroup LRU | 179 | pages that are selected for reclaiming come from the per cgroup LRU |
180 | list. | 180 | list. |
181 | 181 | ||
182 | NOTE: Reclaim does not work for the root cgroup, since we cannot set any | ||
183 | limits on the root cgroup. | ||
184 | |||
182 | 2. Locking | 185 | 2. Locking |
183 | 186 | ||
184 | The memory controller uses the following hierarchy | 187 | The memory controller uses the following hierarchy |
@@ -210,6 +213,7 @@ We can alter the memory limit: | |||
210 | NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, | 213 | NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, |
211 | mega or gigabytes. | 214 | mega or gigabytes. |
212 | NOTE: We can write "-1" to reset the *.limit_in_bytes(unlimited). | 215 | NOTE: We can write "-1" to reset the *.limit_in_bytes(unlimited). |
216 | NOTE: We cannot set limits on the root cgroup any more. | ||
213 | 217 | ||
214 | # cat /cgroups/0/memory.limit_in_bytes | 218 | # cat /cgroups/0/memory.limit_in_bytes |
215 | 4194304 | 219 | 4194304 |
@@ -375,7 +379,42 @@ cgroups created below it. | |||
375 | 379 | ||
376 | NOTE2: This feature can be enabled/disabled per subtree. | 380 | NOTE2: This feature can be enabled/disabled per subtree. |
377 | 381 | ||
378 | 7. TODO | 382 | 7. Soft limits |
383 | |||
384 | Soft limits allow for greater sharing of memory. The idea behind soft limits | ||
385 | is to allow control groups to use as much of the memory as needed, provided | ||
386 | |||
387 | a. There is no memory contention | ||
388 | b. They do not exceed their hard limit | ||
389 | |||
390 | When the system detects memory contention or low memory control groups | ||
391 | are pushed back to their soft limits. If the soft limit of each control | ||
392 | group is very high, they are pushed back as much as possible to make | ||
393 | sure that one control group does not starve the others of memory. | ||
394 | |||
395 | Please note that soft limits is a best effort feature, it comes with | ||
396 | no guarantees, but it does its best to make sure that when memory is | ||
397 | heavily contended for, memory is allocated based on the soft limit | ||
398 | hints/setup. Currently soft limit based reclaim is setup such that | ||
399 | it gets invoked from balance_pgdat (kswapd). | ||
400 | |||
401 | 7.1 Interface | ||
402 | |||
403 | Soft limits can be setup by using the following commands (in this example we | ||
404 | assume a soft limit of 256 megabytes) | ||
405 | |||
406 | # echo 256M > memory.soft_limit_in_bytes | ||
407 | |||
408 | If we want to change this to 1G, we can at any time use | ||
409 | |||
410 | # echo 1G > memory.soft_limit_in_bytes | ||
411 | |||
412 | NOTE1: Soft limits take effect over a long period of time, since they involve | ||
413 | reclaiming memory for balancing between memory cgroups | ||
414 | NOTE2: It is recommended to set the soft limit always below the hard limit, | ||
415 | otherwise the hard limit will take precedence. | ||
416 | |||
417 | 8. TODO | ||
379 | 418 | ||
380 | 1. Add support for accounting huge pages (as a separate controller) | 419 | 1. Add support for accounting huge pages (as a separate controller) |
381 | 2. Make per-cgroup scanner reclaim not-shared pages first | 420 | 2. Make per-cgroup scanner reclaim not-shared pages first |
diff --git a/Documentation/fb/ep93xx-fb.txt b/Documentation/fb/ep93xx-fb.txt new file mode 100644 index 000000000000..5af1bd9effae --- /dev/null +++ b/Documentation/fb/ep93xx-fb.txt | |||
@@ -0,0 +1,135 @@ | |||
1 | ================================ | ||
2 | Driver for EP93xx LCD controller | ||
3 | ================================ | ||
4 | |||
5 | The EP93xx LCD controller can drive both standard desktop monitors and | ||
6 | embedded LCD displays. If you have a standard desktop monitor then you | ||
7 | can use the standard Linux video mode database. In your board file: | ||
8 | |||
9 | static struct ep93xxfb_mach_info some_board_fb_info = { | ||
10 | .num_modes = EP93XXFB_USE_MODEDB, | ||
11 | .bpp = 16, | ||
12 | }; | ||
13 | |||
14 | If you have an embedded LCD display then you need to define a video | ||
15 | mode for it as follows: | ||
16 | |||
17 | static struct fb_videomode some_board_video_modes[] = { | ||
18 | { | ||
19 | .name = "some_lcd_name", | ||
20 | /* Pixel clock, porches, etc */ | ||
21 | }, | ||
22 | }; | ||
23 | |||
24 | Note that the pixel clock value is in pico-seconds. You can use the | ||
25 | KHZ2PICOS macro to convert the pixel clock value. Most other values | ||
26 | are in pixel clocks. See Documentation/fb/framebuffer.txt for further | ||
27 | details. | ||
28 | |||
29 | The ep93xxfb_mach_info structure for your board should look like the | ||
30 | following: | ||
31 | |||
32 | static struct ep93xxfb_mach_info some_board_fb_info = { | ||
33 | .num_modes = ARRAY_SIZE(some_board_video_modes), | ||
34 | .modes = some_board_video_modes, | ||
35 | .default_mode = &some_board_video_modes[0], | ||
36 | .bpp = 16, | ||
37 | }; | ||
38 | |||
39 | The framebuffer device can be registered by adding the following to | ||
40 | your board initialisation function: | ||
41 | |||
42 | ep93xx_register_fb(&some_board_fb_info); | ||
43 | |||
44 | ===================== | ||
45 | Video Attribute Flags | ||
46 | ===================== | ||
47 | |||
48 | The ep93xxfb_mach_info structure has a flags field which can be used | ||
49 | to configure the controller. The video attributes flags are fully | ||
50 | documented in section 7 of the EP93xx users' guide. The following | ||
51 | flags are available: | ||
52 | |||
53 | EP93XXFB_PCLK_FALLING Clock data on the falling edge of the | ||
54 | pixel clock. The default is to clock | ||
55 | data on the rising edge. | ||
56 | |||
57 | EP93XXFB_SYNC_BLANK_HIGH Blank signal is active high. By | ||
58 | default the blank signal is active low. | ||
59 | |||
60 | EP93XXFB_SYNC_HORIZ_HIGH Horizontal sync is active high. By | ||
61 | default the horizontal sync is active low. | ||
62 | |||
63 | EP93XXFB_SYNC_VERT_HIGH Vertical sync is active high. By | ||
64 | default the vertical sync is active high. | ||
65 | |||
66 | The physical address of the framebuffer can be controlled using the | ||
67 | following flags: | ||
68 | |||
69 | EP93XXFB_USE_SDCSN0 Use SDCSn[0] for the framebuffer. This | ||
70 | is the default setting. | ||
71 | |||
72 | EP93XXFB_USE_SDCSN1 Use SDCSn[1] for the framebuffer. | ||
73 | |||
74 | EP93XXFB_USE_SDCSN2 Use SDCSn[2] for the framebuffer. | ||
75 | |||
76 | EP93XXFB_USE_SDCSN3 Use SDCSn[3] for the framebuffer. | ||
77 | |||
78 | ================== | ||
79 | Platform callbacks | ||
80 | ================== | ||
81 | |||
82 | The EP93xx framebuffer driver supports three optional platform | ||
83 | callbacks: setup, teardown and blank. The setup and teardown functions | ||
84 | are called when the framebuffer driver is installed and removed | ||
85 | respectively. The blank function is called whenever the display is | ||
86 | blanked or unblanked. | ||
87 | |||
88 | The setup and teardown devices pass the platform_device structure as | ||
89 | an argument. The fb_info and ep93xxfb_mach_info structures can be | ||
90 | obtained as follows: | ||
91 | |||
92 | static int some_board_fb_setup(struct platform_device *pdev) | ||
93 | { | ||
94 | struct ep93xxfb_mach_info *mach_info = pdev->dev.platform_data; | ||
95 | struct fb_info *fb_info = platform_get_drvdata(pdev); | ||
96 | |||
97 | /* Board specific framebuffer setup */ | ||
98 | } | ||
99 | |||
100 | ====================== | ||
101 | Setting the video mode | ||
102 | ====================== | ||
103 | |||
104 | The video mode is set using the following syntax: | ||
105 | |||
106 | video=XRESxYRES[-BPP][@REFRESH] | ||
107 | |||
108 | If the EP93xx video driver is built-in then the video mode is set on | ||
109 | the Linux kernel command line, for example: | ||
110 | |||
111 | video=ep93xx-fb:800x600-16@60 | ||
112 | |||
113 | If the EP93xx video driver is built as a module then the video mode is | ||
114 | set when the module is installed: | ||
115 | |||
116 | modprobe ep93xx-fb video=320x240 | ||
117 | |||
118 | ============== | ||
119 | Screenpage bug | ||
120 | ============== | ||
121 | |||
122 | At least on the EP9315 there is a silicon bug which causes bit 27 of | ||
123 | the VIDSCRNPAGE (framebuffer physical offset) to be tied low. There is | ||
124 | an unofficial errata for this bug at: | ||
125 | http://marc.info/?l=linux-arm-kernel&m=110061245502000&w=2 | ||
126 | |||
127 | By default the EP93xx framebuffer driver checks if the allocated physical | ||
128 | address has bit 27 set. If it does, then the memory is freed and an | ||
129 | error is returned. The check can be disabled by adding the following | ||
130 | option when loading the driver: | ||
131 | |||
132 | ep93xx-fb.check_screenpage_bug=0 | ||
133 | |||
134 | In some cases it may be possible to reconfigure your SDRAM layout to | ||
135 | avoid this bug. See section 13 of the EP93xx users' guide for details. | ||
diff --git a/Documentation/fb/matroxfb.txt b/Documentation/fb/matroxfb.txt index ad7a67707d62..e5ce8a1a978b 100644 --- a/Documentation/fb/matroxfb.txt +++ b/Documentation/fb/matroxfb.txt | |||
@@ -186,9 +186,7 @@ noinverse - show true colors on screen. It is default. | |||
186 | dev:X - bind driver to device X. Driver numbers device from 0 up to N, | 186 | dev:X - bind driver to device X. Driver numbers device from 0 up to N, |
187 | where device 0 is first `known' device found, 1 second and so on. | 187 | where device 0 is first `known' device found, 1 second and so on. |
188 | lspci lists devices in this order. | 188 | lspci lists devices in this order. |
189 | Default is `every' known device for driver with multihead support | 189 | Default is `every' known device. |
190 | and first working device (usually dev:0) for driver without | ||
191 | multihead support. | ||
192 | nohwcursor - disables hardware cursor (use software cursor instead). | 190 | nohwcursor - disables hardware cursor (use software cursor instead). |
193 | hwcursor - enables hardware cursor. It is default. If you are using | 191 | hwcursor - enables hardware cursor. It is default. If you are using |
194 | non-accelerated mode (`noaccel' or `fbset -accel false'), software | 192 | non-accelerated mode (`noaccel' or `fbset -accel false'), software |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index fa75220f8d34..89a47b5aff07 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -354,14 +354,6 @@ Who: Krzysztof Piotr Oledzki <ole@ans.pl> | |||
354 | 354 | ||
355 | --------------------------- | 355 | --------------------------- |
356 | 356 | ||
357 | What: fscher and fscpos drivers | ||
358 | When: June 2009 | ||
359 | Why: Deprecated by the new fschmd driver. | ||
360 | Who: Hans de Goede <hdegoede@redhat.com> | ||
361 | Jean Delvare <khali@linux-fr.org> | ||
362 | |||
363 | --------------------------- | ||
364 | |||
365 | What: sysfs ui for changing p4-clockmod parameters | 357 | What: sysfs ui for changing p4-clockmod parameters |
366 | When: September 2009 | 358 | When: September 2009 |
367 | Why: See commits 129f8ae9b1b5be94517da76009ea956e89104ce8 and | 359 | Why: See commits 129f8ae9b1b5be94517da76009ea956e89104ce8 and |
diff --git a/Documentation/filesystems/9p.txt b/Documentation/filesystems/9p.txt index 6208f55c44c3..57e0b80a5274 100644 --- a/Documentation/filesystems/9p.txt +++ b/Documentation/filesystems/9p.txt | |||
@@ -18,11 +18,11 @@ the 9p client is available in the form of a USENIX paper: | |||
18 | 18 | ||
19 | Other applications are described in the following papers: | 19 | Other applications are described in the following papers: |
20 | * XCPU & Clustering | 20 | * XCPU & Clustering |
21 | http://www.xcpu.org/xcpu-talk.pdf | 21 | http://xcpu.org/papers/xcpu-talk.pdf |
22 | * KVMFS: control file system for KVM | 22 | * KVMFS: control file system for KVM |
23 | http://www.xcpu.org/kvmfs.pdf | 23 | http://xcpu.org/papers/kvmfs.pdf |
24 | * CellFS: A New ProgrammingModel for the Cell BE | 24 | * CellFS: A New Programming Model for the Cell BE |
25 | http://www.xcpu.org/cellfs-talk.pdf | 25 | http://xcpu.org/papers/cellfs-talk.pdf |
26 | * PROSE I/O: Using 9p to enable Application Partitions | 26 | * PROSE I/O: Using 9p to enable Application Partitions |
27 | http://plan9.escet.urjc.es/iwp9/cready/PROSE_iwp9_2006.pdf | 27 | http://plan9.escet.urjc.es/iwp9/cready/PROSE_iwp9_2006.pdf |
28 | 28 | ||
@@ -48,6 +48,7 @@ OPTIONS | |||
48 | (see rfdno and wfdno) | 48 | (see rfdno and wfdno) |
49 | virtio - connect to the next virtio channel available | 49 | virtio - connect to the next virtio channel available |
50 | (from lguest or KVM with trans_virtio module) | 50 | (from lguest or KVM with trans_virtio module) |
51 | rdma - connect to a specified RDMA channel | ||
51 | 52 | ||
52 | uname=name user name to attempt mount as on the remote server. The | 53 | uname=name user name to attempt mount as on the remote server. The |
53 | server may override or ignore this value. Certain user | 54 | server may override or ignore this value. Certain user |
@@ -59,16 +60,22 @@ OPTIONS | |||
59 | cache=mode specifies a caching policy. By default, no caches are used. | 60 | cache=mode specifies a caching policy. By default, no caches are used. |
60 | loose = no attempts are made at consistency, | 61 | loose = no attempts are made at consistency, |
61 | intended for exclusive, read-only mounts | 62 | intended for exclusive, read-only mounts |
63 | fscache = use FS-Cache for a persistent, read-only | ||
64 | cache backend. | ||
62 | 65 | ||
63 | debug=n specifies debug level. The debug level is a bitmask. | 66 | debug=n specifies debug level. The debug level is a bitmask. |
64 | 0x01 = display verbose error messages | 67 | 0x01 = display verbose error messages |
65 | 0x02 = developer debug (DEBUG_CURRENT) | 68 | 0x02 = developer debug (DEBUG_CURRENT) |
66 | 0x04 = display 9p trace | 69 | 0x04 = display 9p trace |
67 | 0x08 = display VFS trace | 70 | 0x08 = display VFS trace |
68 | 0x10 = display Marshalling debug | 71 | 0x10 = display Marshalling debug |
69 | 0x20 = display RPC debug | 72 | 0x20 = display RPC debug |
70 | 0x40 = display transport debug | 73 | 0x40 = display transport debug |
71 | 0x80 = display allocation debug | 74 | 0x80 = display allocation debug |
75 | 0x100 = display protocol message debug | ||
76 | 0x200 = display Fid debug | ||
77 | 0x400 = display packet debug | ||
78 | 0x800 = display fscache tracing debug | ||
72 | 79 | ||
73 | rfdno=n the file descriptor for reading with trans=fd | 80 | rfdno=n the file descriptor for reading with trans=fd |
74 | 81 | ||
@@ -100,6 +107,10 @@ OPTIONS | |||
100 | any = v9fs does single attach and performs all | 107 | any = v9fs does single attach and performs all |
101 | operations as one user | 108 | operations as one user |
102 | 109 | ||
110 | cachetag cache tag to use the specified persistent cache. | ||
111 | cache tags for existing cache sessions can be listed at | ||
112 | /sys/fs/9p/caches. (applies only to cache=fscache) | ||
113 | |||
103 | RESOURCES | 114 | RESOURCES |
104 | ========= | 115 | ========= |
105 | 116 | ||
@@ -118,7 +129,7 @@ and export. | |||
118 | A Linux version of the 9p server is now maintained under the npfs project | 129 | A Linux version of the 9p server is now maintained under the npfs project |
119 | on sourceforge (http://sourceforge.net/projects/npfs). The currently | 130 | on sourceforge (http://sourceforge.net/projects/npfs). The currently |
120 | maintained version is the single-threaded version of the server (named spfs) | 131 | maintained version is the single-threaded version of the server (named spfs) |
121 | available from the same CVS repository. | 132 | available from the same SVN repository. |
122 | 133 | ||
123 | There are user and developer mailing lists available through the v9fs project | 134 | There are user and developer mailing lists available through the v9fs project |
124 | on sourceforge (http://sourceforge.net/projects/v9fs). | 135 | on sourceforge (http://sourceforge.net/projects/v9fs). |
@@ -126,7 +137,8 @@ on sourceforge (http://sourceforge.net/projects/v9fs). | |||
126 | A stand-alone version of the module (which should build for any 2.6 kernel) | 137 | A stand-alone version of the module (which should build for any 2.6 kernel) |
127 | is available via (http://github.com/ericvh/9p-sac/tree/master) | 138 | is available via (http://github.com/ericvh/9p-sac/tree/master) |
128 | 139 | ||
129 | News and other information is maintained on SWiK (http://swik.net/v9fs). | 140 | News and other information is maintained on SWiK (http://swik.net/v9fs) |
141 | and the Wiki (http://sf.net/apps/mediawiki/v9fs/index.php). | ||
130 | 142 | ||
131 | Bug reports may be issued through the kernel.org bugzilla | 143 | Bug reports may be issued through the kernel.org bugzilla |
132 | (http://bugzilla.kernel.org) | 144 | (http://bugzilla.kernel.org) |
diff --git a/Documentation/filesystems/ncpfs.txt b/Documentation/filesystems/ncpfs.txt index f12c30c93f2f..5af164f4b37b 100644 --- a/Documentation/filesystems/ncpfs.txt +++ b/Documentation/filesystems/ncpfs.txt | |||
@@ -7,6 +7,6 @@ ftp.gwdg.de/pub/linux/misc/ncpfs, but sunsite and its many mirrors | |||
7 | will have it as well. | 7 | will have it as well. |
8 | 8 | ||
9 | Related products are linware and mars_nwe, which will give Linux partial | 9 | Related products are linware and mars_nwe, which will give Linux partial |
10 | NetWare server functionality. Linware's home site is | 10 | NetWare server functionality. |
11 | klokan.sh.cvut.cz/pub/linux/linware; mars_nwe can be found on | 11 | |
12 | ftp.gwdg.de/pub/linux/misc/ncpfs. | 12 | mars_nwe can be found on ftp.gwdg.de/pub/linux/misc/ncpfs. |
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 75988ba26a51..b5aee7838a00 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -176,6 +176,7 @@ read the file /proc/PID/status: | |||
176 | CapBnd: ffffffffffffffff | 176 | CapBnd: ffffffffffffffff |
177 | voluntary_ctxt_switches: 0 | 177 | voluntary_ctxt_switches: 0 |
178 | nonvoluntary_ctxt_switches: 1 | 178 | nonvoluntary_ctxt_switches: 1 |
179 | Stack usage: 12 kB | ||
179 | 180 | ||
180 | This shows you nearly the same information you would get if you viewed it with | 181 | This shows you nearly the same information you would get if you viewed it with |
181 | the ps command. In fact, ps uses the proc file system to obtain its | 182 | the ps command. In fact, ps uses the proc file system to obtain its |
@@ -229,6 +230,7 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | |||
229 | Mems_allowed_list Same as previous, but in "list format" | 230 | Mems_allowed_list Same as previous, but in "list format" |
230 | voluntary_ctxt_switches number of voluntary context switches | 231 | voluntary_ctxt_switches number of voluntary context switches |
231 | nonvoluntary_ctxt_switches number of non voluntary context switches | 232 | nonvoluntary_ctxt_switches number of non voluntary context switches |
233 | Stack usage: stack usage high water mark (round up to page size) | ||
232 | .............................................................................. | 234 | .............................................................................. |
233 | 235 | ||
234 | Table 1-3: Contents of the statm files (as of 2.6.8-rc3) | 236 | Table 1-3: Contents of the statm files (as of 2.6.8-rc3) |
@@ -307,7 +309,7 @@ address perms offset dev inode pathname | |||
307 | 08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test | 309 | 08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test |
308 | 0804a000-0806b000 rw-p 00000000 00:00 0 [heap] | 310 | 0804a000-0806b000 rw-p 00000000 00:00 0 [heap] |
309 | a7cb1000-a7cb2000 ---p 00000000 00:00 0 | 311 | a7cb1000-a7cb2000 ---p 00000000 00:00 0 |
310 | a7cb2000-a7eb2000 rw-p 00000000 00:00 0 | 312 | a7cb2000-a7eb2000 rw-p 00000000 00:00 0 [threadstack:001ff4b4] |
311 | a7eb2000-a7eb3000 ---p 00000000 00:00 0 | 313 | a7eb2000-a7eb3000 ---p 00000000 00:00 0 |
312 | a7eb3000-a7ed5000 rw-p 00000000 00:00 0 | 314 | a7eb3000-a7ed5000 rw-p 00000000 00:00 0 |
313 | a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6 | 315 | a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6 |
@@ -343,6 +345,7 @@ is not associated with a file: | |||
343 | [stack] = the stack of the main process | 345 | [stack] = the stack of the main process |
344 | [vdso] = the "virtual dynamic shared object", | 346 | [vdso] = the "virtual dynamic shared object", |
345 | the kernel system call handler | 347 | the kernel system call handler |
348 | [threadstack:xxxxxxxx] = the stack of the thread, xxxxxxxx is the stack size | ||
346 | 349 | ||
347 | or if empty, the mapping is anonymous. | 350 | or if empty, the mapping is anonymous. |
348 | 351 | ||
diff --git a/Documentation/filesystems/sharedsubtree.txt b/Documentation/filesystems/sharedsubtree.txt index 736540045dc7..23a181074f94 100644 --- a/Documentation/filesystems/sharedsubtree.txt +++ b/Documentation/filesystems/sharedsubtree.txt | |||
@@ -4,7 +4,7 @@ Shared Subtrees | |||
4 | Contents: | 4 | Contents: |
5 | 1) Overview | 5 | 1) Overview |
6 | 2) Features | 6 | 2) Features |
7 | 3) smount command | 7 | 3) Setting mount states |
8 | 4) Use-case | 8 | 4) Use-case |
9 | 5) Detailed semantics | 9 | 5) Detailed semantics |
10 | 6) Quiz | 10 | 6) Quiz |
@@ -41,14 +41,14 @@ replicas continue to be exactly same. | |||
41 | 41 | ||
42 | Here is an example: | 42 | Here is an example: |
43 | 43 | ||
44 | Lets say /mnt has a mount that is shared. | 44 | Let's say /mnt has a mount that is shared. |
45 | mount --make-shared /mnt | 45 | mount --make-shared /mnt |
46 | 46 | ||
47 | note: mount command does not yet support the --make-shared flag. | 47 | Note: mount(8) command now supports the --make-shared flag, |
48 | I have included a small C program which does the same by executing | 48 | so the sample 'smount' program is no longer needed and has been |
49 | 'smount /mnt shared' | 49 | removed. |
50 | 50 | ||
51 | #mount --bind /mnt /tmp | 51 | # mount --bind /mnt /tmp |
52 | The above command replicates the mount at /mnt to the mountpoint /tmp | 52 | The above command replicates the mount at /mnt to the mountpoint /tmp |
53 | and the contents of both the mounts remain identical. | 53 | and the contents of both the mounts remain identical. |
54 | 54 | ||
@@ -58,8 +58,8 @@ replicas continue to be exactly same. | |||
58 | #ls /tmp | 58 | #ls /tmp |
59 | a b c | 59 | a b c |
60 | 60 | ||
61 | Now lets say we mount a device at /tmp/a | 61 | Now let's say we mount a device at /tmp/a |
62 | #mount /dev/sd0 /tmp/a | 62 | # mount /dev/sd0 /tmp/a |
63 | 63 | ||
64 | #ls /tmp/a | 64 | #ls /tmp/a |
65 | t1 t2 t2 | 65 | t1 t2 t2 |
@@ -80,21 +80,20 @@ replicas continue to be exactly same. | |||
80 | 80 | ||
81 | Here is an example: | 81 | Here is an example: |
82 | 82 | ||
83 | Lets say /mnt has a mount which is shared. | 83 | Let's say /mnt has a mount which is shared. |
84 | #mount --make-shared /mnt | 84 | # mount --make-shared /mnt |
85 | 85 | ||
86 | Lets bind mount /mnt to /tmp | 86 | Let's bind mount /mnt to /tmp |
87 | #mount --bind /mnt /tmp | 87 | # mount --bind /mnt /tmp |
88 | 88 | ||
89 | the new mount at /tmp becomes a shared mount and it is a replica of | 89 | the new mount at /tmp becomes a shared mount and it is a replica of |
90 | the mount at /mnt. | 90 | the mount at /mnt. |
91 | 91 | ||
92 | Now lets make the mount at /tmp; a slave of /mnt | 92 | Now let's make the mount at /tmp; a slave of /mnt |
93 | #mount --make-slave /tmp | 93 | # mount --make-slave /tmp |
94 | [or smount /tmp slave] | ||
95 | 94 | ||
96 | lets mount /dev/sd0 on /mnt/a | 95 | let's mount /dev/sd0 on /mnt/a |
97 | #mount /dev/sd0 /mnt/a | 96 | # mount /dev/sd0 /mnt/a |
98 | 97 | ||
99 | #ls /mnt/a | 98 | #ls /mnt/a |
100 | t1 t2 t3 | 99 | t1 t2 t3 |
@@ -104,9 +103,9 @@ replicas continue to be exactly same. | |||
104 | 103 | ||
105 | Note the mount event has propagated to the mount at /tmp | 104 | Note the mount event has propagated to the mount at /tmp |
106 | 105 | ||
107 | However lets see what happens if we mount something on the mount at /tmp | 106 | However let's see what happens if we mount something on the mount at /tmp |
108 | 107 | ||
109 | #mount /dev/sd1 /tmp/b | 108 | # mount /dev/sd1 /tmp/b |
110 | 109 | ||
111 | #ls /tmp/b | 110 | #ls /tmp/b |
112 | s1 s2 s3 | 111 | s1 s2 s3 |
@@ -124,12 +123,11 @@ replicas continue to be exactly same. | |||
124 | 123 | ||
125 | 2d) A unbindable mount is a unbindable private mount | 124 | 2d) A unbindable mount is a unbindable private mount |
126 | 125 | ||
127 | lets say we have a mount at /mnt and we make is unbindable | 126 | let's say we have a mount at /mnt and we make is unbindable |
128 | 127 | ||
129 | #mount --make-unbindable /mnt | 128 | # mount --make-unbindable /mnt |
130 | [ smount /mnt unbindable ] | ||
131 | 129 | ||
132 | Lets try to bind mount this mount somewhere else. | 130 | Let's try to bind mount this mount somewhere else. |
133 | # mount --bind /mnt /tmp | 131 | # mount --bind /mnt /tmp |
134 | mount: wrong fs type, bad option, bad superblock on /mnt, | 132 | mount: wrong fs type, bad option, bad superblock on /mnt, |
135 | or too many mounted file systems | 133 | or too many mounted file systems |
@@ -137,149 +135,15 @@ replicas continue to be exactly same. | |||
137 | Binding a unbindable mount is a invalid operation. | 135 | Binding a unbindable mount is a invalid operation. |
138 | 136 | ||
139 | 137 | ||
140 | 3) smount command | 138 | 3) Setting mount states |
141 | 139 | ||
142 | Currently the mount command is not aware of shared subtree features. | 140 | The mount command (util-linux package) can be used to set mount |
143 | Work is in progress to add the support in mount ( util-linux package ). | 141 | states: |
144 | Till then use the following program. | ||
145 | 142 | ||
146 | ------------------------------------------------------------------------ | 143 | mount --make-shared mountpoint |
147 | // | 144 | mount --make-slave mountpoint |
148 | //this code was developed my Miklos Szeredi <miklos@szeredi.hu> | 145 | mount --make-private mountpoint |
149 | //and modified by Ram Pai <linuxram@us.ibm.com> | 146 | mount --make-unbindable mountpoint |
150 | // sample usage: | ||
151 | // smount /tmp shared | ||
152 | // | ||
153 | #include <stdio.h> | ||
154 | #include <stdlib.h> | ||
155 | #include <unistd.h> | ||
156 | #include <string.h> | ||
157 | #include <sys/mount.h> | ||
158 | #include <sys/fsuid.h> | ||
159 | |||
160 | #ifndef MS_REC | ||
161 | #define MS_REC 0x4000 /* 16384: Recursive loopback */ | ||
162 | #endif | ||
163 | |||
164 | #ifndef MS_SHARED | ||
165 | #define MS_SHARED 1<<20 /* Shared */ | ||
166 | #endif | ||
167 | |||
168 | #ifndef MS_PRIVATE | ||
169 | #define MS_PRIVATE 1<<18 /* Private */ | ||
170 | #endif | ||
171 | |||
172 | #ifndef MS_SLAVE | ||
173 | #define MS_SLAVE 1<<19 /* Slave */ | ||
174 | #endif | ||
175 | |||
176 | #ifndef MS_UNBINDABLE | ||
177 | #define MS_UNBINDABLE 1<<17 /* Unbindable */ | ||
178 | #endif | ||
179 | |||
180 | int main(int argc, char *argv[]) | ||
181 | { | ||
182 | int type; | ||
183 | if(argc != 3) { | ||
184 | fprintf(stderr, "usage: %s dir " | ||
185 | "<rshared|rslave|rprivate|runbindable|shared|slave" | ||
186 | "|private|unbindable>\n" , argv[0]); | ||
187 | return 1; | ||
188 | } | ||
189 | |||
190 | fprintf(stdout, "%s %s %s\n", argv[0], argv[1], argv[2]); | ||
191 | |||
192 | if (strcmp(argv[2],"rshared")==0) | ||
193 | type=(MS_SHARED|MS_REC); | ||
194 | else if (strcmp(argv[2],"rslave")==0) | ||
195 | type=(MS_SLAVE|MS_REC); | ||
196 | else if (strcmp(argv[2],"rprivate")==0) | ||
197 | type=(MS_PRIVATE|MS_REC); | ||
198 | else if (strcmp(argv[2],"runbindable")==0) | ||
199 | type=(MS_UNBINDABLE|MS_REC); | ||
200 | else if (strcmp(argv[2],"shared")==0) | ||
201 | type=MS_SHARED; | ||
202 | else if (strcmp(argv[2],"slave")==0) | ||
203 | type=MS_SLAVE; | ||
204 | else if (strcmp(argv[2],"private")==0) | ||
205 | type=MS_PRIVATE; | ||
206 | else if (strcmp(argv[2],"unbindable")==0) | ||
207 | type=MS_UNBINDABLE; | ||
208 | else { | ||
209 | fprintf(stderr, "invalid operation: %s\n", argv[2]); | ||
210 | return 1; | ||
211 | } | ||
212 | setfsuid(getuid()); | ||
213 | |||
214 | if(mount("", argv[1], "dontcare", type, "") == -1) { | ||
215 | perror("mount"); | ||
216 | return 1; | ||
217 | } | ||
218 | return 0; | ||
219 | } | ||
220 | ----------------------------------------------------------------------- | ||
221 | |||
222 | Copy the above code snippet into smount.c | ||
223 | gcc -o smount smount.c | ||
224 | |||
225 | |||
226 | (i) To mark all the mounts under /mnt as shared execute the following | ||
227 | command: | ||
228 | |||
229 | smount /mnt rshared | ||
230 | the corresponding syntax planned for mount command is | ||
231 | mount --make-rshared /mnt | ||
232 | |||
233 | just to mark a mount /mnt as shared, execute the following | ||
234 | command: | ||
235 | smount /mnt shared | ||
236 | the corresponding syntax planned for mount command is | ||
237 | mount --make-shared /mnt | ||
238 | |||
239 | (ii) To mark all the shared mounts under /mnt as slave execute the | ||
240 | following | ||
241 | |||
242 | command: | ||
243 | smount /mnt rslave | ||
244 | the corresponding syntax planned for mount command is | ||
245 | mount --make-rslave /mnt | ||
246 | |||
247 | just to mark a mount /mnt as slave, execute the following | ||
248 | command: | ||
249 | smount /mnt slave | ||
250 | the corresponding syntax planned for mount command is | ||
251 | mount --make-slave /mnt | ||
252 | |||
253 | (iii) To mark all the mounts under /mnt as private execute the | ||
254 | following command: | ||
255 | |||
256 | smount /mnt rprivate | ||
257 | the corresponding syntax planned for mount command is | ||
258 | mount --make-rprivate /mnt | ||
259 | |||
260 | just to mark a mount /mnt as private, execute the following | ||
261 | command: | ||
262 | smount /mnt private | ||
263 | the corresponding syntax planned for mount command is | ||
264 | mount --make-private /mnt | ||
265 | |||
266 | NOTE: by default all the mounts are created as private. But if | ||
267 | you want to change some shared/slave/unbindable mount as | ||
268 | private at a later point in time, this command can help. | ||
269 | |||
270 | (iv) To mark all the mounts under /mnt as unbindable execute the | ||
271 | following | ||
272 | |||
273 | command: | ||
274 | smount /mnt runbindable | ||
275 | the corresponding syntax planned for mount command is | ||
276 | mount --make-runbindable /mnt | ||
277 | |||
278 | just to mark a mount /mnt as unbindable, execute the following | ||
279 | command: | ||
280 | smount /mnt unbindable | ||
281 | the corresponding syntax planned for mount command is | ||
282 | mount --make-unbindable /mnt | ||
283 | 147 | ||
284 | 148 | ||
285 | 4) Use cases | 149 | 4) Use cases |
@@ -350,7 +214,7 @@ replicas continue to be exactly same. | |||
350 | mount --rbind / /view/v3 | 214 | mount --rbind / /view/v3 |
351 | mount --rbind / /view/v4 | 215 | mount --rbind / /view/v4 |
352 | 216 | ||
353 | and if /usr has a versioning filesystem mounted, than that | 217 | and if /usr has a versioning filesystem mounted, then that |
354 | mount appears at /view/v1/usr, /view/v2/usr, /view/v3/usr and | 218 | mount appears at /view/v1/usr, /view/v2/usr, /view/v3/usr and |
355 | /view/v4/usr too | 219 | /view/v4/usr too |
356 | 220 | ||
@@ -390,7 +254,7 @@ replicas continue to be exactly same. | |||
390 | 254 | ||
391 | For example: | 255 | For example: |
392 | mount --make-shared /mnt | 256 | mount --make-shared /mnt |
393 | mount --bin /mnt /tmp | 257 | mount --bind /mnt /tmp |
394 | 258 | ||
395 | The mount at /mnt and that at /tmp are both shared and belong | 259 | The mount at /mnt and that at /tmp are both shared and belong |
396 | to the same peer group. Anything mounted or unmounted under | 260 | to the same peer group. Anything mounted or unmounted under |
@@ -558,7 +422,7 @@ replicas continue to be exactly same. | |||
558 | then the subtree under the unbindable mount is pruned in the new | 422 | then the subtree under the unbindable mount is pruned in the new |
559 | location. | 423 | location. |
560 | 424 | ||
561 | eg: lets say we have the following mount tree. | 425 | eg: let's say we have the following mount tree. |
562 | 426 | ||
563 | A | 427 | A |
564 | / \ | 428 | / \ |
@@ -566,7 +430,7 @@ replicas continue to be exactly same. | |||
566 | / \ / \ | 430 | / \ / \ |
567 | D E F G | 431 | D E F G |
568 | 432 | ||
569 | Lets say all the mount except the mount C in the tree are | 433 | Let's say all the mount except the mount C in the tree are |
570 | of a type other than unbindable. | 434 | of a type other than unbindable. |
571 | 435 | ||
572 | If this tree is rbound to say Z | 436 | If this tree is rbound to say Z |
@@ -683,13 +547,13 @@ replicas continue to be exactly same. | |||
683 | 'b' on mounts that receive propagation from mount 'B' and does not have | 547 | 'b' on mounts that receive propagation from mount 'B' and does not have |
684 | sub-mounts within them are unmounted. | 548 | sub-mounts within them are unmounted. |
685 | 549 | ||
686 | Example: Lets say 'B1', 'B2', 'B3' are shared mounts that propagate to | 550 | Example: Let's say 'B1', 'B2', 'B3' are shared mounts that propagate to |
687 | each other. | 551 | each other. |
688 | 552 | ||
689 | lets say 'A1', 'A2', 'A3' are first mounted at dentry 'b' on mount | 553 | let's say 'A1', 'A2', 'A3' are first mounted at dentry 'b' on mount |
690 | 'B1', 'B2' and 'B3' respectively. | 554 | 'B1', 'B2' and 'B3' respectively. |
691 | 555 | ||
692 | lets say 'C1', 'C2', 'C3' are next mounted at the same dentry 'b' on | 556 | let's say 'C1', 'C2', 'C3' are next mounted at the same dentry 'b' on |
693 | mount 'B1', 'B2' and 'B3' respectively. | 557 | mount 'B1', 'B2' and 'B3' respectively. |
694 | 558 | ||
695 | if 'C1' is unmounted, all the mounts that are most-recently-mounted on | 559 | if 'C1' is unmounted, all the mounts that are most-recently-mounted on |
@@ -710,7 +574,7 @@ replicas continue to be exactly same. | |||
710 | A cloned namespace contains all the mounts as that of the parent | 574 | A cloned namespace contains all the mounts as that of the parent |
711 | namespace. | 575 | namespace. |
712 | 576 | ||
713 | Lets say 'A' and 'B' are the corresponding mounts in the parent and the | 577 | Let's say 'A' and 'B' are the corresponding mounts in the parent and the |
714 | child namespace. | 578 | child namespace. |
715 | 579 | ||
716 | If 'A' is shared, then 'B' is also shared and 'A' and 'B' propagate to | 580 | If 'A' is shared, then 'B' is also shared and 'A' and 'B' propagate to |
@@ -759,11 +623,11 @@ replicas continue to be exactly same. | |||
759 | mount --make-slave /mnt | 623 | mount --make-slave /mnt |
760 | 624 | ||
761 | At this point we have the first mount at /tmp and | 625 | At this point we have the first mount at /tmp and |
762 | its root dentry is 1. Lets call this mount 'A' | 626 | its root dentry is 1. Let's call this mount 'A' |
763 | And then we have a second mount at /tmp1 with root | 627 | And then we have a second mount at /tmp1 with root |
764 | dentry 2. Lets call this mount 'B' | 628 | dentry 2. Let's call this mount 'B' |
765 | Next we have a third mount at /mnt with root dentry | 629 | Next we have a third mount at /mnt with root dentry |
766 | mnt. Lets call this mount 'C' | 630 | mnt. Let's call this mount 'C' |
767 | 631 | ||
768 | 'B' is the slave of 'A' and 'C' is a slave of 'B' | 632 | 'B' is the slave of 'A' and 'C' is a slave of 'B' |
769 | A -> B -> C | 633 | A -> B -> C |
@@ -794,7 +658,7 @@ replicas continue to be exactly same. | |||
794 | 658 | ||
795 | Q3 Why is unbindable mount needed? | 659 | Q3 Why is unbindable mount needed? |
796 | 660 | ||
797 | Lets say we want to replicate the mount tree at multiple | 661 | Let's say we want to replicate the mount tree at multiple |
798 | locations within the same subtree. | 662 | locations within the same subtree. |
799 | 663 | ||
800 | if one rbind mounts a tree within the same subtree 'n' times | 664 | if one rbind mounts a tree within the same subtree 'n' times |
@@ -803,7 +667,7 @@ replicas continue to be exactly same. | |||
803 | mounts. Here is a example. | 667 | mounts. Here is a example. |
804 | 668 | ||
805 | step 1: | 669 | step 1: |
806 | lets say the root tree has just two directories with | 670 | let's say the root tree has just two directories with |
807 | one vfsmount. | 671 | one vfsmount. |
808 | root | 672 | root |
809 | / \ | 673 | / \ |
@@ -875,7 +739,7 @@ replicas continue to be exactly same. | |||
875 | Unclonable mounts come in handy here. | 739 | Unclonable mounts come in handy here. |
876 | 740 | ||
877 | step 1: | 741 | step 1: |
878 | lets say the root tree has just two directories with | 742 | let's say the root tree has just two directories with |
879 | one vfsmount. | 743 | one vfsmount. |
880 | root | 744 | root |
881 | / \ | 745 | / \ |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index f49eecf2e573..623f094c9d8d 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -536,6 +536,7 @@ struct address_space_operations { | |||
536 | /* migrate the contents of a page to the specified target */ | 536 | /* migrate the contents of a page to the specified target */ |
537 | int (*migratepage) (struct page *, struct page *); | 537 | int (*migratepage) (struct page *, struct page *); |
538 | int (*launder_page) (struct page *); | 538 | int (*launder_page) (struct page *); |
539 | int (*error_remove_page) (struct mapping *mapping, struct page *page); | ||
539 | }; | 540 | }; |
540 | 541 | ||
541 | writepage: called by the VM to write a dirty page to backing store. | 542 | writepage: called by the VM to write a dirty page to backing store. |
@@ -694,6 +695,12 @@ struct address_space_operations { | |||
694 | prevent redirtying the page, it is kept locked during the whole | 695 | prevent redirtying the page, it is kept locked during the whole |
695 | operation. | 696 | operation. |
696 | 697 | ||
698 | error_remove_page: normally set to generic_error_remove_page if truncation | ||
699 | is ok for this address space. Used for memory failure handling. | ||
700 | Setting this implies you deal with pages going away under you, | ||
701 | unless you have them locked or reference counts increased. | ||
702 | |||
703 | |||
697 | The File Object | 704 | The File Object |
698 | =============== | 705 | =============== |
699 | 706 | ||
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index e4b6985044a2..fa4dc077ae0e 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -524,6 +524,13 @@ and have the following read/write attributes: | |||
524 | is configured as an output, this value may be written; | 524 | is configured as an output, this value may be written; |
525 | any nonzero value is treated as high. | 525 | any nonzero value is treated as high. |
526 | 526 | ||
527 | "edge" ... reads as either "none", "rising", "falling", or | ||
528 | "both". Write these strings to select the signal edge(s) | ||
529 | that will make poll(2) on the "value" file return. | ||
530 | |||
531 | This file exists only if the pin can be configured as an | ||
532 | interrupt generating input pin. | ||
533 | |||
527 | GPIO controllers have paths like /sys/class/gpio/chipchip42/ (for the | 534 | GPIO controllers have paths like /sys/class/gpio/chipchip42/ (for the |
528 | controller implementing GPIOs starting at #42) and have the following | 535 | controller implementing GPIOs starting at #42) and have the following |
529 | read-only attributes: | 536 | read-only attributes: |
@@ -555,6 +562,11 @@ requested using gpio_request(): | |||
555 | /* reverse gpio_export() */ | 562 | /* reverse gpio_export() */ |
556 | void gpio_unexport(); | 563 | void gpio_unexport(); |
557 | 564 | ||
565 | /* create a sysfs link to an exported GPIO node */ | ||
566 | int gpio_export_link(struct device *dev, const char *name, | ||
567 | unsigned gpio) | ||
568 | |||
569 | |||
558 | After a kernel driver requests a GPIO, it may only be made available in | 570 | After a kernel driver requests a GPIO, it may only be made available in |
559 | the sysfs interface by gpio_export(). The driver can control whether the | 571 | the sysfs interface by gpio_export(). The driver can control whether the |
560 | signal direction may change. This helps drivers prevent userspace code | 572 | signal direction may change. This helps drivers prevent userspace code |
@@ -563,3 +575,8 @@ from accidentally clobbering important system state. | |||
563 | This explicit exporting can help with debugging (by making some kinds | 575 | This explicit exporting can help with debugging (by making some kinds |
564 | of experiments easier), or can provide an always-there interface that's | 576 | of experiments easier), or can provide an always-there interface that's |
565 | suitable for documenting as part of a board support package. | 577 | suitable for documenting as part of a board support package. |
578 | |||
579 | After the GPIO has been exported, gpio_export_link() allows creating | ||
580 | symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can | ||
581 | use this to provide the interface under their own device in sysfs with | ||
582 | a descriptive name. | ||
diff --git a/Documentation/hwmon/acpi_power_meter b/Documentation/hwmon/acpi_power_meter new file mode 100644 index 000000000000..c80399a00c50 --- /dev/null +++ b/Documentation/hwmon/acpi_power_meter | |||
@@ -0,0 +1,51 @@ | |||
1 | Kernel driver power_meter | ||
2 | ========================= | ||
3 | |||
4 | This driver talks to ACPI 4.0 power meters. | ||
5 | |||
6 | Supported systems: | ||
7 | * Any recent system with ACPI 4.0. | ||
8 | Prefix: 'power_meter' | ||
9 | Datasheet: http://acpi.info/, section 10.4. | ||
10 | |||
11 | Author: Darrick J. Wong | ||
12 | |||
13 | Description | ||
14 | ----------- | ||
15 | |||
16 | This driver implements sensor reading support for the power meters exposed in | ||
17 | the ACPI 4.0 spec (Chapter 10.4). These devices have a simple set of | ||
18 | features--a power meter that returns average power use over a configurable | ||
19 | interval, an optional capping mechanism, and a couple of trip points. The | ||
20 | sysfs interface conforms with the specification outlined in the "Power" section | ||
21 | of Documentation/hwmon/sysfs-interface. | ||
22 | |||
23 | Special Features | ||
24 | ---------------- | ||
25 | |||
26 | The power[1-*]_is_battery knob indicates if the power supply is a battery. | ||
27 | Both power[1-*]_average_{min,max} must be set before the trip points will work. | ||
28 | When both of them are set, an ACPI event will be broadcast on the ACPI netlink | ||
29 | socket and a poll notification will be sent to the appropriate | ||
30 | power[1-*]_average sysfs file. | ||
31 | |||
32 | The power[1-*]_{model_number, serial_number, oem_info} fields display arbitrary | ||
33 | strings that ACPI provides with the meter. The measures/ directory contains | ||
34 | symlinks to the devices that this meter measures. | ||
35 | |||
36 | Some computers have the ability to enforce a power cap in hardware. If this is | ||
37 | the case, the power[1-*]_cap and related sysfs files will appear. When the | ||
38 | average power consumption exceeds the cap, an ACPI event will be broadcast on | ||
39 | the netlink event socket and a poll notification will be sent to the | ||
40 | appropriate power[1-*]_alarm file to indicate that capping has begun, and the | ||
41 | hardware has taken action to reduce power consumption. Most likely this will | ||
42 | result in reduced performance. | ||
43 | |||
44 | There are a few other ACPI notifications that can be sent by the firmware. In | ||
45 | all cases the ACPI event will be broadcast on the ACPI netlink event socket as | ||
46 | well as sent as a poll notification to a sysfs file. The events are as | ||
47 | follows: | ||
48 | |||
49 | power[1-*]_cap will be notified if the firmware changes the power cap. | ||
50 | power[1-*]_interval will be notified if the firmware changes the averaging | ||
51 | interval. | ||
diff --git a/Documentation/hwmon/coretemp b/Documentation/hwmon/coretemp index dbbe6c7025b0..92267b62db59 100644 --- a/Documentation/hwmon/coretemp +++ b/Documentation/hwmon/coretemp | |||
@@ -4,7 +4,9 @@ Kernel driver coretemp | |||
4 | Supported chips: | 4 | Supported chips: |
5 | * All Intel Core family | 5 | * All Intel Core family |
6 | Prefix: 'coretemp' | 6 | Prefix: 'coretemp' |
7 | CPUID: family 0x6, models 0xe, 0xf, 0x16, 0x17 | 7 | CPUID: family 0x6, models 0xe (Pentium M DC), 0xf (Core 2 DC 65nm), |
8 | 0x16 (Core 2 SC 65nm), 0x17 (Penryn 45nm), | ||
9 | 0x1a (Nehalem), 0x1c (Atom), 0x1e (Lynnfield) | ||
8 | Datasheet: Intel 64 and IA-32 Architectures Software Developer's Manual | 10 | Datasheet: Intel 64 and IA-32 Architectures Software Developer's Manual |
9 | Volume 3A: System Programming Guide | 11 | Volume 3A: System Programming Guide |
10 | http://softwarecommunity.intel.com/Wiki/Mobility/720.htm | 12 | http://softwarecommunity.intel.com/Wiki/Mobility/720.htm |
diff --git a/Documentation/hwmon/fscher b/Documentation/hwmon/fscher deleted file mode 100644 index 64031659aff3..000000000000 --- a/Documentation/hwmon/fscher +++ /dev/null | |||
@@ -1,169 +0,0 @@ | |||
1 | Kernel driver fscher | ||
2 | ==================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Fujitsu-Siemens Hermes chip | ||
6 | Prefix: 'fscher' | ||
7 | Addresses scanned: I2C 0x73 | ||
8 | |||
9 | Authors: | ||
10 | Reinhard Nissl <rnissl@gmx.de> based on work | ||
11 | from Hermann Jung <hej@odn.de>, | ||
12 | Frodo Looijaard <frodol@dds.nl>, | ||
13 | Philip Edelbrock <phil@netroedge.com> | ||
14 | |||
15 | Description | ||
16 | ----------- | ||
17 | |||
18 | This driver implements support for the Fujitsu-Siemens Hermes chip. It is | ||
19 | described in the 'Register Set Specification BMC Hermes based Systemboard' | ||
20 | from Fujitsu-Siemens. | ||
21 | |||
22 | The Hermes chip implements a hardware-based system management, e.g. for | ||
23 | controlling fan speed and core voltage. There is also a watchdog counter on | ||
24 | the chip which can trigger an alarm and even shut the system down. | ||
25 | |||
26 | The chip provides three temperature values (CPU, motherboard and | ||
27 | auxiliary), three voltage values (+12V, +5V and battery) and three fans | ||
28 | (power supply, CPU and auxiliary). | ||
29 | |||
30 | Temperatures are measured in degrees Celsius. The resolution is 1 degree. | ||
31 | |||
32 | Fan rotation speeds are reported in RPM (rotations per minute). The value | ||
33 | can be divided by a programmable divider (1, 2 or 4) which is stored on | ||
34 | the chip. | ||
35 | |||
36 | Voltage sensors (also known as "in" sensors) report their values in volts. | ||
37 | |||
38 | All values are reported as final values from the driver. There is no need | ||
39 | for further calculations. | ||
40 | |||
41 | |||
42 | Detailed description | ||
43 | -------------------- | ||
44 | |||
45 | Below you'll find a single line description of all the bit values. With | ||
46 | this information, you're able to decode e. g. alarms, wdog, etc. To make | ||
47 | use of the watchdog, you'll need to set the watchdog time and enable the | ||
48 | watchdog. After that it is necessary to restart the watchdog time within | ||
49 | the specified period of time, or a system reset will occur. | ||
50 | |||
51 | * revision | ||
52 | READING & 0xff = 0x??: HERMES revision identification | ||
53 | |||
54 | * alarms | ||
55 | READING & 0x80 = 0x80: CPU throttling active | ||
56 | READING & 0x80 = 0x00: CPU running at full speed | ||
57 | |||
58 | READING & 0x10 = 0x10: software event (see control:1) | ||
59 | READING & 0x10 = 0x00: no software event | ||
60 | |||
61 | READING & 0x08 = 0x08: watchdog event (see wdog:2) | ||
62 | READING & 0x08 = 0x00: no watchdog event | ||
63 | |||
64 | READING & 0x02 = 0x02: thermal event (see temp*:1) | ||
65 | READING & 0x02 = 0x00: no thermal event | ||
66 | |||
67 | READING & 0x01 = 0x01: fan event (see fan*:1) | ||
68 | READING & 0x01 = 0x00: no fan event | ||
69 | |||
70 | READING & 0x13 ! 0x00: ALERT LED is flashing | ||
71 | |||
72 | * control | ||
73 | READING & 0x01 = 0x01: software event | ||
74 | READING & 0x01 = 0x00: no software event | ||
75 | |||
76 | WRITING & 0x01 = 0x01: set software event | ||
77 | WRITING & 0x01 = 0x00: clear software event | ||
78 | |||
79 | * watchdog_control | ||
80 | READING & 0x80 = 0x80: power off on watchdog event while thermal event | ||
81 | READING & 0x80 = 0x00: watchdog power off disabled (just system reset enabled) | ||
82 | |||
83 | READING & 0x40 = 0x40: watchdog timebase 60 seconds (see also wdog:1) | ||
84 | READING & 0x40 = 0x00: watchdog timebase 2 seconds | ||
85 | |||
86 | READING & 0x10 = 0x10: watchdog enabled | ||
87 | READING & 0x10 = 0x00: watchdog disabled | ||
88 | |||
89 | WRITING & 0x80 = 0x80: enable "power off on watchdog event while thermal event" | ||
90 | WRITING & 0x80 = 0x00: disable "power off on watchdog event while thermal event" | ||
91 | |||
92 | WRITING & 0x40 = 0x40: set watchdog timebase to 60 seconds | ||
93 | WRITING & 0x40 = 0x00: set watchdog timebase to 2 seconds | ||
94 | |||
95 | WRITING & 0x20 = 0x20: disable watchdog | ||
96 | |||
97 | WRITING & 0x10 = 0x10: enable watchdog / restart watchdog time | ||
98 | |||
99 | * watchdog_state | ||
100 | READING & 0x02 = 0x02: watchdog system reset occurred | ||
101 | READING & 0x02 = 0x00: no watchdog system reset occurred | ||
102 | |||
103 | WRITING & 0x02 = 0x02: clear watchdog event | ||
104 | |||
105 | * watchdog_preset | ||
106 | READING & 0xff = 0x??: configured watch dog time in units (see wdog:3 0x40) | ||
107 | |||
108 | WRITING & 0xff = 0x??: configure watch dog time in units | ||
109 | |||
110 | * in* (0: +5V, 1: +12V, 2: onboard 3V battery) | ||
111 | READING: actual voltage value | ||
112 | |||
113 | * temp*_status (1: CPU sensor, 2: onboard sensor, 3: auxiliary sensor) | ||
114 | READING & 0x02 = 0x02: thermal event (overtemperature) | ||
115 | READING & 0x02 = 0x00: no thermal event | ||
116 | |||
117 | READING & 0x01 = 0x01: sensor is working | ||
118 | READING & 0x01 = 0x00: sensor is faulty | ||
119 | |||
120 | WRITING & 0x02 = 0x02: clear thermal event | ||
121 | |||
122 | * temp*_input (1: CPU sensor, 2: onboard sensor, 3: auxiliary sensor) | ||
123 | READING: actual temperature value | ||
124 | |||
125 | * fan*_status (1: power supply fan, 2: CPU fan, 3: auxiliary fan) | ||
126 | READING & 0x04 = 0x04: fan event (fan fault) | ||
127 | READING & 0x04 = 0x00: no fan event | ||
128 | |||
129 | WRITING & 0x04 = 0x04: clear fan event | ||
130 | |||
131 | * fan*_div (1: power supply fan, 2: CPU fan, 3: auxiliary fan) | ||
132 | Divisors 2,4 and 8 are supported, both for reading and writing | ||
133 | |||
134 | * fan*_pwm (1: power supply fan, 2: CPU fan, 3: auxiliary fan) | ||
135 | READING & 0xff = 0x00: fan may be switched off | ||
136 | READING & 0xff = 0x01: fan must run at least at minimum speed (supply: 6V) | ||
137 | READING & 0xff = 0xff: fan must run at maximum speed (supply: 12V) | ||
138 | READING & 0xff = 0x??: fan must run at least at given speed (supply: 6V..12V) | ||
139 | |||
140 | WRITING & 0xff = 0x00: fan may be switched off | ||
141 | WRITING & 0xff = 0x01: fan must run at least at minimum speed (supply: 6V) | ||
142 | WRITING & 0xff = 0xff: fan must run at maximum speed (supply: 12V) | ||
143 | WRITING & 0xff = 0x??: fan must run at least at given speed (supply: 6V..12V) | ||
144 | |||
145 | * fan*_input (1: power supply fan, 2: CPU fan, 3: auxiliary fan) | ||
146 | READING: actual RPM value | ||
147 | |||
148 | |||
149 | Limitations | ||
150 | ----------- | ||
151 | |||
152 | * Measuring fan speed | ||
153 | It seems that the chip counts "ripples" (typical fans produce 2 ripples per | ||
154 | rotation while VERAX fans produce 18) in a 9-bit register. This register is | ||
155 | read out every second, then the ripple prescaler (2, 4 or 8) is applied and | ||
156 | the result is stored in the 8 bit output register. Due to the limitation of | ||
157 | the counting register to 9 bits, it is impossible to measure a VERAX fan | ||
158 | properly (even with a prescaler of 8). At its maximum speed of 3500 RPM the | ||
159 | fan produces 1080 ripples per second which causes the counting register to | ||
160 | overflow twice, leading to only 186 RPM. | ||
161 | |||
162 | * Measuring input voltages | ||
163 | in2 ("battery") reports the voltage of the onboard lithium battery and not | ||
164 | +3.3V from the power supply. | ||
165 | |||
166 | * Undocumented features | ||
167 | Fujitsu-Siemens Computers has not documented all features of the chip so | ||
168 | far. Their software, System Guard, shows that there are a still some | ||
169 | features which cannot be controlled by this implementation. | ||
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4 index f889481762b5..c5b37c570554 100644 --- a/Documentation/i2c/busses/i2c-piix4 +++ b/Documentation/i2c/busses/i2c-piix4 | |||
@@ -8,6 +8,8 @@ Supported adapters: | |||
8 | Datasheet: Only available via NDA from ServerWorks | 8 | Datasheet: Only available via NDA from ServerWorks |
9 | * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges | 9 | * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges |
10 | Datasheet: Not publicly available | 10 | Datasheet: Not publicly available |
11 | * AMD SB900 | ||
12 | Datasheet: Not publicly available | ||
11 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge | 13 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge |
12 | Datasheet: Publicly available at the SMSC website http://www.smsc.com | 14 | Datasheet: Publicly available at the SMSC website http://www.smsc.com |
13 | 15 | ||
diff --git a/Documentation/i2c/chips/pca9539 b/Documentation/i2c/chips/pca9539 deleted file mode 100644 index 6aff890088b1..000000000000 --- a/Documentation/i2c/chips/pca9539 +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | Kernel driver pca9539 | ||
2 | ===================== | ||
3 | |||
4 | NOTE: this driver is deprecated and will be dropped soon, use | ||
5 | drivers/gpio/pca9539.c instead. | ||
6 | |||
7 | Supported chips: | ||
8 | * Philips PCA9539 | ||
9 | Prefix: 'pca9539' | ||
10 | Addresses scanned: none | ||
11 | Datasheet: | ||
12 | http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf | ||
13 | |||
14 | Author: Ben Gardner <bgardner@wabtec.com> | ||
15 | |||
16 | |||
17 | Description | ||
18 | ----------- | ||
19 | |||
20 | The Philips PCA9539 is a 16 bit low power I/O device. | ||
21 | All 16 lines can be individually configured as an input or output. | ||
22 | The input sense can also be inverted. | ||
23 | The 16 lines are split between two bytes. | ||
24 | |||
25 | |||
26 | Detection | ||
27 | --------- | ||
28 | |||
29 | The PCA9539 is difficult to detect and not commonly found in PC machines, | ||
30 | so you have to pass the I2C bus and address of the installed PCA9539 | ||
31 | devices explicitly to the driver at load time via the force=... parameter. | ||
32 | |||
33 | |||
34 | Sysfs entries | ||
35 | ------------- | ||
36 | |||
37 | Each is a byte that maps to the 8 I/O bits. | ||
38 | A '0' suffix is for bits 0-7, while '1' is for bits 8-15. | ||
39 | |||
40 | input[01] - read the current value | ||
41 | output[01] - sets the output value | ||
42 | direction[01] - direction of each bit: 1=input, 0=output | ||
43 | invert[01] - toggle the input bit sense | ||
44 | |||
45 | input reads the actual state of the line and is always available. | ||
46 | The direction defaults to input for all channels. | ||
47 | |||
48 | |||
49 | General Remarks | ||
50 | --------------- | ||
51 | |||
52 | Note that each output, direction, and invert entry controls 8 lines. | ||
53 | You should use the read, modify, write sequence. | ||
54 | For example. to set output bit 0 of 1. | ||
55 | val=$(cat output0) | ||
56 | val=$(( $val | 1 )) | ||
57 | echo $val > output0 | ||
58 | |||
diff --git a/Documentation/i2c/chips/pcf8574 b/Documentation/i2c/chips/pcf8574 deleted file mode 100644 index 235815c075ff..000000000000 --- a/Documentation/i2c/chips/pcf8574 +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | Kernel driver pcf8574 | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Philips PCF8574 | ||
6 | Prefix: 'pcf8574' | ||
7 | Addresses scanned: none | ||
8 | Datasheet: Publicly available at the Philips Semiconductors website | ||
9 | http://www.semiconductors.philips.com/pip/PCF8574P.html | ||
10 | |||
11 | * Philips PCF8574A | ||
12 | Prefix: 'pcf8574a' | ||
13 | Addresses scanned: none | ||
14 | Datasheet: Publicly available at the Philips Semiconductors website | ||
15 | http://www.semiconductors.philips.com/pip/PCF8574P.html | ||
16 | |||
17 | Authors: | ||
18 | Frodo Looijaard <frodol@dds.nl>, | ||
19 | Philip Edelbrock <phil@netroedge.com>, | ||
20 | Dan Eaton <dan.eaton@rocketlogix.com>, | ||
21 | Aurelien Jarno <aurelien@aurel32.net>, | ||
22 | Jean Delvare <khali@linux-fr.org>, | ||
23 | |||
24 | |||
25 | Description | ||
26 | ----------- | ||
27 | The PCF8574(A) is an 8-bit I/O expander for the I2C bus produced by Philips | ||
28 | Semiconductors. It is designed to provide a byte I2C interface to up to 16 | ||
29 | separate devices (8 x PCF8574 and 8 x PCF8574A). | ||
30 | |||
31 | This device consists of a quasi-bidirectional port. Each of the eight I/Os | ||
32 | can be independently used as an input or output. To setup an I/O as an | ||
33 | input, you have to write a 1 to the corresponding output. | ||
34 | |||
35 | For more informations see the datasheet. | ||
36 | |||
37 | |||
38 | Accessing PCF8574(A) via /sys interface | ||
39 | ------------------------------------- | ||
40 | |||
41 | The PCF8574(A) is plainly impossible to detect ! Stupid chip. | ||
42 | So, you have to pass the I2C bus and address of the installed PCF857A | ||
43 | and PCF8574A devices explicitly to the driver at load time via the | ||
44 | force=... parameter. | ||
45 | |||
46 | On detection (i.e. insmod, modprobe et al.), directories are being | ||
47 | created for each detected PCF8574(A): | ||
48 | |||
49 | /sys/bus/i2c/devices/<0>-<1>/ | ||
50 | where <0> is the bus the chip was detected on (e. g. i2c-0) | ||
51 | and <1> the chip address ([20..27] or [38..3f]): | ||
52 | |||
53 | (example: /sys/bus/i2c/devices/1-0020/) | ||
54 | |||
55 | Inside these directories, there are two files each: | ||
56 | read and write (and one file with chip name). | ||
57 | |||
58 | The read file is read-only. Reading gives you the current I/O input | ||
59 | if the corresponding output is set as 1, otherwise the current output | ||
60 | value, that is to say 0. | ||
61 | |||
62 | The write file is read/write. Writing a value outputs it on the I/O | ||
63 | port. Reading returns the last written value. As it is not possible | ||
64 | to read this value from the chip, you need to write at least once to | ||
65 | this file before you can read back from it. | ||
diff --git a/Documentation/i2c/chips/pcf8575 b/Documentation/i2c/chips/pcf8575 deleted file mode 100644 index 40b268eb276f..000000000000 --- a/Documentation/i2c/chips/pcf8575 +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | About the PCF8575 chip and the pcf8575 kernel driver | ||
2 | ==================================================== | ||
3 | |||
4 | The PCF8575 chip is produced by the following manufacturers: | ||
5 | |||
6 | * Philips NXP | ||
7 | http://www.nxp.com/#/pip/cb=[type=product,path=50807/41735/41850,final=PCF8575_3]|pip=[pip=PCF8575_3][0] | ||
8 | |||
9 | * Texas Instruments | ||
10 | http://focus.ti.com/docs/prod/folders/print/pcf8575.html | ||
11 | |||
12 | |||
13 | Some vendors sell small PCB's with the PCF8575 mounted on it. You can connect | ||
14 | such a board to a Linux host via e.g. an USB to I2C interface. Examples of | ||
15 | PCB boards with a PCF8575: | ||
16 | |||
17 | * SFE Breakout Board for PCF8575 I2C Expander by RobotShop | ||
18 | http://www.robotshop.ca/home/products/robot-parts/electronics/adapters-converters/sfe-pcf8575-i2c-expander-board.html | ||
19 | |||
20 | * Breakout Board for PCF8575 I2C Expander by Spark Fun Electronics | ||
21 | http://www.sparkfun.com/commerce/product_info.php?products_id=8130 | ||
22 | |||
23 | |||
24 | Description | ||
25 | ----------- | ||
26 | The PCF8575 chip is a 16-bit I/O expander for the I2C bus. Up to eight of | ||
27 | these chips can be connected to the same I2C bus. You can find this | ||
28 | chip on some custom designed hardware, but you won't find it on PC | ||
29 | motherboards. | ||
30 | |||
31 | The PCF8575 chip consists of a 16-bit quasi-bidirectional port and an I2C-bus | ||
32 | interface. Each of the sixteen I/O's can be independently used as an input or | ||
33 | an output. To set up an I/O pin as an input, you have to write a 1 to the | ||
34 | corresponding output. | ||
35 | |||
36 | For more information please see the datasheet. | ||
37 | |||
38 | |||
39 | Detection | ||
40 | --------- | ||
41 | |||
42 | There is no method known to detect whether a chip on a given I2C address is | ||
43 | a PCF8575 or whether it is any other I2C device, so you have to pass the I2C | ||
44 | bus and address of the installed PCF8575 devices explicitly to the driver at | ||
45 | load time via the force=... parameter. | ||
46 | |||
47 | /sys interface | ||
48 | -------------- | ||
49 | |||
50 | For each address on which a PCF8575 chip was found or forced the following | ||
51 | files will be created under /sys: | ||
52 | * /sys/bus/i2c/devices/<bus>-<address>/read | ||
53 | * /sys/bus/i2c/devices/<bus>-<address>/write | ||
54 | where bus is the I2C bus number (0, 1, ...) and address is the four-digit | ||
55 | hexadecimal representation of the 7-bit I2C address of the PCF8575 | ||
56 | (0020 .. 0027). | ||
57 | |||
58 | The read file is read-only. Reading it will trigger an I2C read and will hence | ||
59 | report the current input state for the pins configured as inputs, and the | ||
60 | current output value for the pins configured as outputs. | ||
61 | |||
62 | The write file is read-write. Writing a value to it will configure all pins | ||
63 | as output for which the corresponding bit is zero. Reading the write file will | ||
64 | return the value last written, or -EAGAIN if no value has yet been written to | ||
65 | the write file. | ||
66 | |||
67 | On module initialization the configuration of the chip is not changed -- the | ||
68 | chip is left in the state it was already configured in through either power-up | ||
69 | or through previous I2C write actions. | ||
diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c index d23610fb2ff9..3dfb76ca6931 100644 --- a/Documentation/ia64/aliasing-test.c +++ b/Documentation/ia64/aliasing-test.c | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | int sum; | 25 | int sum; |
26 | 26 | ||
27 | int map_mem(char *path, off_t offset, size_t length, int touch) | 27 | static int map_mem(char *path, off_t offset, size_t length, int touch) |
28 | { | 28 | { |
29 | int fd, rc; | 29 | int fd, rc; |
30 | void *addr; | 30 | void *addr; |
@@ -62,7 +62,7 @@ int map_mem(char *path, off_t offset, size_t length, int touch) | |||
62 | return 0; | 62 | return 0; |
63 | } | 63 | } |
64 | 64 | ||
65 | int scan_tree(char *path, char *file, off_t offset, size_t length, int touch) | 65 | static int scan_tree(char *path, char *file, off_t offset, size_t length, int touch) |
66 | { | 66 | { |
67 | struct dirent **namelist; | 67 | struct dirent **namelist; |
68 | char *name, *path2; | 68 | char *name, *path2; |
@@ -119,7 +119,7 @@ skip: | |||
119 | 119 | ||
120 | char buf[1024]; | 120 | char buf[1024]; |
121 | 121 | ||
122 | int read_rom(char *path) | 122 | static int read_rom(char *path) |
123 | { | 123 | { |
124 | int fd, rc; | 124 | int fd, rc; |
125 | size_t size = 0; | 125 | size_t size = 0; |
@@ -146,7 +146,7 @@ int read_rom(char *path) | |||
146 | return size; | 146 | return size; |
147 | } | 147 | } |
148 | 148 | ||
149 | int scan_rom(char *path, char *file) | 149 | static int scan_rom(char *path, char *file) |
150 | { | 150 | { |
151 | struct dirent **namelist; | 151 | struct dirent **namelist; |
152 | char *name, *path2; | 152 | char *name, *path2; |
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt index aafca0a8f66a..947374977ca5 100644 --- a/Documentation/ioctl/ioctl-number.txt +++ b/Documentation/ioctl/ioctl-number.txt | |||
@@ -135,6 +135,7 @@ Code Seq# Include File Comments | |||
135 | <http://mikonos.dia.unisa.it/tcfs> | 135 | <http://mikonos.dia.unisa.it/tcfs> |
136 | 'l' 40-7F linux/udf_fs_i.h in development: | 136 | 'l' 40-7F linux/udf_fs_i.h in development: |
137 | <http://sourceforge.net/projects/linux-udf/> | 137 | <http://sourceforge.net/projects/linux-udf/> |
138 | 'm' 00-09 linux/mmtimer.h | ||
138 | 'm' all linux/mtio.h conflict! | 139 | 'm' all linux/mtio.h conflict! |
139 | 'm' all linux/soundcard.h conflict! | 140 | 'm' all linux/soundcard.h conflict! |
140 | 'm' all linux/synclink.h conflict! | 141 | 'm' all linux/synclink.h conflict! |
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index f3355b6812df..bb3bf38f03da 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt | |||
@@ -65,6 +65,22 @@ INSTALL_PATH | |||
65 | INSTALL_PATH specifies where to place the updated kernel and system map | 65 | INSTALL_PATH specifies where to place the updated kernel and system map |
66 | images. Default is /boot, but you can set it to other values. | 66 | images. Default is /boot, but you can set it to other values. |
67 | 67 | ||
68 | INSTALLKERNEL | ||
69 | -------------------------------------------------- | ||
70 | Install script called when using "make install". | ||
71 | The default name is "installkernel". | ||
72 | |||
73 | The script will be called with the following arguments: | ||
74 | $1 - kernel version | ||
75 | $2 - kernel image file | ||
76 | $3 - kernel map file | ||
77 | $4 - default install path (use root directory if blank) | ||
78 | |||
79 | The implmentation of "make install" is architecture specific | ||
80 | and it may differ from the above. | ||
81 | |||
82 | INSTALLKERNEL is provided to enable the possibility to | ||
83 | specify a custom installer when cross compiling a kernel. | ||
68 | 84 | ||
69 | MODLIB | 85 | MODLIB |
70 | -------------------------------------------------- | 86 | -------------------------------------------------- |
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index d76cfd8712e1..71c602d61680 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -18,6 +18,7 @@ This document describes the Linux kernel Makefiles. | |||
18 | --- 3.9 Dependency tracking | 18 | --- 3.9 Dependency tracking |
19 | --- 3.10 Special Rules | 19 | --- 3.10 Special Rules |
20 | --- 3.11 $(CC) support functions | 20 | --- 3.11 $(CC) support functions |
21 | --- 3.12 $(LD) support functions | ||
21 | 22 | ||
22 | === 4 Host Program support | 23 | === 4 Host Program support |
23 | --- 4.1 Simple Host Program | 24 | --- 4.1 Simple Host Program |
@@ -435,14 +436,14 @@ more details, with real examples. | |||
435 | The second argument is optional, and if supplied will be used | 436 | The second argument is optional, and if supplied will be used |
436 | if first argument is not supported. | 437 | if first argument is not supported. |
437 | 438 | ||
438 | ld-option | 439 | cc-ldoption |
439 | ld-option is used to check if $(CC) when used to link object files | 440 | cc-ldoption is used to check if $(CC) when used to link object files |
440 | supports the given option. An optional second option may be | 441 | supports the given option. An optional second option may be |
441 | specified if first option are not supported. | 442 | specified if first option are not supported. |
442 | 443 | ||
443 | Example: | 444 | Example: |
444 | #arch/i386/kernel/Makefile | 445 | #arch/i386/kernel/Makefile |
445 | vsyscall-flags += $(call ld-option, -Wl$(comma)--hash-style=sysv) | 446 | vsyscall-flags += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) |
446 | 447 | ||
447 | In the above example, vsyscall-flags will be assigned the option | 448 | In the above example, vsyscall-flags will be assigned the option |
448 | -Wl$(comma)--hash-style=sysv if it is supported by $(CC). | 449 | -Wl$(comma)--hash-style=sysv if it is supported by $(CC). |
@@ -570,6 +571,19 @@ more details, with real examples. | |||
570 | endif | 571 | endif |
571 | endif | 572 | endif |
572 | 573 | ||
574 | --- 3.12 $(LD) support functions | ||
575 | |||
576 | ld-option | ||
577 | ld-option is used to check if $(LD) supports the supplied option. | ||
578 | ld-option takes two options as arguments. | ||
579 | The second argument is an optional option that can be used if the | ||
580 | first option is not supported by $(LD). | ||
581 | |||
582 | Example: | ||
583 | #Makefile | ||
584 | LDFLAGS_vmlinux += $(call really-ld-option, -X) | ||
585 | |||
586 | |||
573 | === 4 Host Program support | 587 | === 4 Host Program support |
574 | 588 | ||
575 | Kbuild supports building executables on the host for use during the | 589 | Kbuild supports building executables on the host for use during the |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index c363840cdcea..6fa7292947e5 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -671,7 +671,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
671 | earlyprintk= [X86,SH,BLACKFIN] | 671 | earlyprintk= [X86,SH,BLACKFIN] |
672 | earlyprintk=vga | 672 | earlyprintk=vga |
673 | earlyprintk=serial[,ttySn[,baudrate]] | 673 | earlyprintk=serial[,ttySn[,baudrate]] |
674 | earlyprintk=dbgp | 674 | earlyprintk=dbgp[debugController#] |
675 | 675 | ||
676 | Append ",keep" to not disable it when the real console | 676 | Append ",keep" to not disable it when the real console |
677 | takes over. | 677 | takes over. |
diff --git a/Documentation/laptops/asus-laptop.txt b/Documentation/laptops/asus-laptop.txt new file mode 100644 index 000000000000..c1c5be84e4b1 --- /dev/null +++ b/Documentation/laptops/asus-laptop.txt | |||
@@ -0,0 +1,258 @@ | |||
1 | Asus Laptop Extras | ||
2 | |||
3 | Version 0.1 | ||
4 | August 6, 2009 | ||
5 | |||
6 | Corentin Chary <corentincj@iksaif.net> | ||
7 | http://acpi4asus.sf.net/ | ||
8 | |||
9 | This driver provides support for extra features of ACPI-compatible ASUS laptops. | ||
10 | It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or | ||
11 | VICTOR XP7210 for example). It makes all the extra buttons generate standard | ||
12 | ACPI events that go through /proc/acpi/events and input events (like keyboards). | ||
13 | On some models adds support for changing the display brightness and output, | ||
14 | switching the LCD backlight on and off, and most importantly, allows you to | ||
15 | blink those fancy LEDs intended for reporting mail and wireless status. | ||
16 | |||
17 | This driver supercedes the old asus_acpi driver. | ||
18 | |||
19 | Requirements | ||
20 | ------------ | ||
21 | |||
22 | Kernel 2.6.X sources, configured for your computer, with ACPI support. | ||
23 | You also need CONFIG_INPUT and CONFIG_ACPI. | ||
24 | |||
25 | Status | ||
26 | ------ | ||
27 | |||
28 | The features currently supported are the following (see below for | ||
29 | detailed description): | ||
30 | |||
31 | - Fn key combinations | ||
32 | - Bluetooth enable and disable | ||
33 | - Wlan enable and disable | ||
34 | - GPS enable and disable | ||
35 | - Video output switching | ||
36 | - Ambient Light Sensor on and off | ||
37 | - LED control | ||
38 | - LED Display control | ||
39 | - LCD brightness control | ||
40 | - LCD on and off | ||
41 | |||
42 | A compatibility table by model and feature is maintained on the web | ||
43 | site, http://acpi4asus.sf.net/. | ||
44 | |||
45 | Usage | ||
46 | ----- | ||
47 | |||
48 | Try "modprobe asus_acpi". Check your dmesg (simply type dmesg). You should | ||
49 | see some lines like this : | ||
50 | |||
51 | Asus Laptop Extras version 0.42 | ||
52 | L2D model detected. | ||
53 | |||
54 | If it is not the output you have on your laptop, send it (and the laptop's | ||
55 | DSDT) to me. | ||
56 | |||
57 | That's all, now, all the events generated by the hotkeys of your laptop | ||
58 | should be reported in your /proc/acpi/event entry. You can check with | ||
59 | "acpi_listen". | ||
60 | |||
61 | Hotkeys are also reported as input keys (like keyboards) you can check | ||
62 | which key are supported using "xev" under X11. | ||
63 | |||
64 | You can get informations on the version of your DSDT table by reading the | ||
65 | /sys/devices/platform/asus-laptop/infos entry. If you have a question or a | ||
66 | bug report to do, please include the output of this entry. | ||
67 | |||
68 | LEDs | ||
69 | ---- | ||
70 | |||
71 | You can modify LEDs be echoing values to /sys/class/leds/asus::*/brightness : | ||
72 | echo 1 > /sys/class/leds/asus::mail/brightness | ||
73 | will switch the mail LED on. | ||
74 | You can also know if they are on/off by reading their content and use | ||
75 | kernel triggers like ide-disk or heartbeat. | ||
76 | |||
77 | Backlight | ||
78 | --------- | ||
79 | |||
80 | You can control lcd backlight power and brightness with | ||
81 | /sys/class/backlight/asus-laptop/. Brightness Values are between 0 and 15. | ||
82 | |||
83 | Wireless devices | ||
84 | --------------- | ||
85 | |||
86 | You can turn the internal Bluetooth adapter on/off with the bluetooth entry | ||
87 | (only on models with Bluetooth). This usually controls the associated LED. | ||
88 | Same for Wlan adapter. | ||
89 | |||
90 | Display switching | ||
91 | ----------------- | ||
92 | |||
93 | Note: the display switching code is currently considered EXPERIMENTAL. | ||
94 | |||
95 | Switching works for the following models: | ||
96 | L3800C | ||
97 | A2500H | ||
98 | L5800C | ||
99 | M5200N | ||
100 | W1000N (albeit with some glitches) | ||
101 | M6700R | ||
102 | A6JC | ||
103 | F3J | ||
104 | |||
105 | Switching doesn't work for the following: | ||
106 | M3700N | ||
107 | L2X00D (locks the laptop under certain conditions) | ||
108 | |||
109 | To switch the displays, echo values from 0 to 15 to | ||
110 | /sys/devices/platform/asus-laptop/display. The significance of those values | ||
111 | is as follows: | ||
112 | |||
113 | +-------+-----+-----+-----+-----+-----+ | ||
114 | | Bin | Val | DVI | TV | CRT | LCD | | ||
115 | +-------+-----+-----+-----+-----+-----+ | ||
116 | + 0000 + 0 + + + + + | ||
117 | +-------+-----+-----+-----+-----+-----+ | ||
118 | + 0001 + 1 + + + + X + | ||
119 | +-------+-----+-----+-----+-----+-----+ | ||
120 | + 0010 + 2 + + + X + + | ||
121 | +-------+-----+-----+-----+-----+-----+ | ||
122 | + 0011 + 3 + + + X + X + | ||
123 | +-------+-----+-----+-----+-----+-----+ | ||
124 | + 0100 + 4 + + X + + + | ||
125 | +-------+-----+-----+-----+-----+-----+ | ||
126 | + 0101 + 5 + + X + + X + | ||
127 | +-------+-----+-----+-----+-----+-----+ | ||
128 | + 0110 + 6 + + X + X + + | ||
129 | +-------+-----+-----+-----+-----+-----+ | ||
130 | + 0111 + 7 + + X + X + X + | ||
131 | +-------+-----+-----+-----+-----+-----+ | ||
132 | + 1000 + 8 + X + + + + | ||
133 | +-------+-----+-----+-----+-----+-----+ | ||
134 | + 1001 + 9 + X + + + X + | ||
135 | +-------+-----+-----+-----+-----+-----+ | ||
136 | + 1010 + 10 + X + + X + + | ||
137 | +-------+-----+-----+-----+-----+-----+ | ||
138 | + 1011 + 11 + X + + X + X + | ||
139 | +-------+-----+-----+-----+-----+-----+ | ||
140 | + 1100 + 12 + X + X + + + | ||
141 | +-------+-----+-----+-----+-----+-----+ | ||
142 | + 1101 + 13 + X + X + + X + | ||
143 | +-------+-----+-----+-----+-----+-----+ | ||
144 | + 1110 + 14 + X + X + X + + | ||
145 | +-------+-----+-----+-----+-----+-----+ | ||
146 | + 1111 + 15 + X + X + X + X + | ||
147 | +-------+-----+-----+-----+-----+-----+ | ||
148 | |||
149 | In most cases, the appropriate displays must be plugged in for the above | ||
150 | combinations to work. TV-Out may need to be initialized at boot time. | ||
151 | |||
152 | Debugging: | ||
153 | 1) Check whether the Fn+F8 key: | ||
154 | a) does not lock the laptop (try disabling CONFIG_X86_UP_APIC or boot with | ||
155 | noapic / nolapic if it does) | ||
156 | b) generates events (0x6n, where n is the value corresponding to the | ||
157 | configuration above) | ||
158 | c) actually works | ||
159 | Record the disp value at every configuration. | ||
160 | 2) Echo values from 0 to 15 to /sys/devices/platform/asus-laptop/display. | ||
161 | Record its value, note any change. If nothing changes, try a broader range, | ||
162 | up to 65535. | ||
163 | 3) Send ANY output (both positive and negative reports are needed, unless your | ||
164 | machine is already listed above) to the acpi4asus-user mailing list. | ||
165 | |||
166 | Note: on some machines (e.g. L3C), after the module has been loaded, only 0x6n | ||
167 | events are generated and no actual switching occurs. In such a case, a line | ||
168 | like: | ||
169 | |||
170 | echo $((10#$arg-60)) > /sys/devices/platform/asus-laptop/display | ||
171 | |||
172 | will usually do the trick ($arg is the 0000006n-like event passed to acpid). | ||
173 | |||
174 | Note: there is currently no reliable way to read display status on xxN | ||
175 | (Centrino) models. | ||
176 | |||
177 | LED display | ||
178 | ----------- | ||
179 | |||
180 | Some models like the W1N have a LED display that can be used to display | ||
181 | several informations. | ||
182 | |||
183 | LED display works for the following models: | ||
184 | W1000N | ||
185 | W1J | ||
186 | |||
187 | To control the LED display, use the following : | ||
188 | |||
189 | echo 0x0T000DDD > /sys/devices/platform/asus-laptop/ | ||
190 | |||
191 | where T control the 3 letters display, and DDD the 3 digits display, | ||
192 | according to the tables below. | ||
193 | |||
194 | DDD (digits) | ||
195 | 000 to 999 = display digits | ||
196 | AAA = --- | ||
197 | BBB to FFF = turn-off | ||
198 | |||
199 | T (type) | ||
200 | 0 = off | ||
201 | 1 = dvd | ||
202 | 2 = vcd | ||
203 | 3 = mp3 | ||
204 | 4 = cd | ||
205 | 5 = tv | ||
206 | 6 = cpu | ||
207 | 7 = vol | ||
208 | |||
209 | For example "echo 0x01000001 >/sys/devices/platform/asus-laptop/ledd" | ||
210 | would display "DVD001". | ||
211 | |||
212 | Driver options: | ||
213 | --------------- | ||
214 | |||
215 | Options can be passed to the asus-laptop driver using the standard | ||
216 | module argument syntax (<param>=<value> when passing the option to the | ||
217 | module or asus-laptop.<param>=<value> on the kernel boot line when | ||
218 | asus-laptop is statically linked into the kernel). | ||
219 | |||
220 | wapf: WAPF defines the behavior of the Fn+Fx wlan key | ||
221 | The significance of values is yet to be found, but | ||
222 | most of the time: | ||
223 | - 0x0 should do nothing | ||
224 | - 0x1 should allow to control the device with Fn+Fx key. | ||
225 | - 0x4 should send an ACPI event (0x88) while pressing the Fn+Fx key | ||
226 | - 0x5 like 0x1 or 0x4 | ||
227 | |||
228 | The default value is 0x1. | ||
229 | |||
230 | Unsupported models | ||
231 | ------------------ | ||
232 | |||
233 | These models will never be supported by this module, as they use a completely | ||
234 | different mechanism to handle LEDs and extra stuff (meaning we have no clue | ||
235 | how it works): | ||
236 | |||
237 | - ASUS A1300 (A1B), A1370D | ||
238 | - ASUS L7300G | ||
239 | - ASUS L8400 | ||
240 | |||
241 | Patches, Errors, Questions: | ||
242 | -------------------------- | ||
243 | |||
244 | I appreciate any success or failure | ||
245 | reports, especially if they add to or correct the compatibility table. | ||
246 | Please include the following information in your report: | ||
247 | |||
248 | - Asus model name | ||
249 | - a copy of your ACPI tables, using the "acpidump" utility | ||
250 | - a copy of /sys/devices/platform/asus-laptop/infos | ||
251 | - which driver features work and which don't | ||
252 | - the observed behavior of non-working features | ||
253 | |||
254 | Any other comments or patches are also more than welcome. | ||
255 | |||
256 | acpi4asus-user@lists.sourceforge.net | ||
257 | http://sourceforge.net/projects/acpi4asus | ||
258 | |||
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index e2ddcdeb61b6..6d03487ef1c7 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -219,7 +219,7 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file: | |||
219 | echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys | 219 | echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys |
220 | echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys | 220 | echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys |
221 | ... any other 8-hex-digit mask ... | 221 | ... any other 8-hex-digit mask ... |
222 | echo reset > /proc/acpi/ibm/hotkey -- restore the original mask | 222 | echo reset > /proc/acpi/ibm/hotkey -- restore the recommended mask |
223 | 223 | ||
224 | The following commands have been deprecated and will cause the kernel | 224 | The following commands have been deprecated and will cause the kernel |
225 | to log a warning: | 225 | to log a warning: |
@@ -240,9 +240,13 @@ sysfs notes: | |||
240 | Returns 0. | 240 | Returns 0. |
241 | 241 | ||
242 | hotkey_bios_mask: | 242 | hotkey_bios_mask: |
243 | DEPRECATED, DON'T USE, WILL BE REMOVED IN THE FUTURE. | ||
244 | |||
243 | Returns the hot keys mask when thinkpad-acpi was loaded. | 245 | Returns the hot keys mask when thinkpad-acpi was loaded. |
244 | Upon module unload, the hot keys mask will be restored | 246 | Upon module unload, the hot keys mask will be restored |
245 | to this value. | 247 | to this value. This is always 0x80c, because those are |
248 | the hotkeys that were supported by ancient firmware | ||
249 | without mask support. | ||
246 | 250 | ||
247 | hotkey_enable: | 251 | hotkey_enable: |
248 | DEPRECATED, WILL BE REMOVED SOON. | 252 | DEPRECATED, WILL BE REMOVED SOON. |
diff --git a/Documentation/leds-class.txt b/Documentation/leds-class.txt index 6399557cdab3..8fd5ca2ae32d 100644 --- a/Documentation/leds-class.txt +++ b/Documentation/leds-class.txt | |||
@@ -1,3 +1,4 @@ | |||
1 | |||
1 | LED handling under Linux | 2 | LED handling under Linux |
2 | ======================== | 3 | ======================== |
3 | 4 | ||
@@ -5,10 +6,10 @@ If you're reading this and thinking about keyboard leds, these are | |||
5 | handled by the input subsystem and the led class is *not* needed. | 6 | handled by the input subsystem and the led class is *not* needed. |
6 | 7 | ||
7 | In its simplest form, the LED class just allows control of LEDs from | 8 | In its simplest form, the LED class just allows control of LEDs from |
8 | userspace. LEDs appear in /sys/class/leds/. The brightness file will | 9 | userspace. LEDs appear in /sys/class/leds/. The maximum brightness of the |
9 | set the brightness of the LED (taking a value 0-255). Most LEDs don't | 10 | LED is defined in max_brightness file. The brightness file will set the brightness |
10 | have hardware brightness support so will just be turned on for non-zero | 11 | of the LED (taking a value 0-max_brightness). Most LEDs don't have hardware |
11 | brightness settings. | 12 | brightness support so will just be turned on for non-zero brightness settings. |
12 | 13 | ||
13 | The class also introduces the optional concept of an LED trigger. A trigger | 14 | The class also introduces the optional concept of an LED trigger. A trigger |
14 | is a kernel based source of led events. Triggers can either be simple or | 15 | is a kernel based source of led events. Triggers can either be simple or |
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 950cde6d6e58..ba9373f82ab5 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <signal.h> | 42 | #include <signal.h> |
43 | #include "linux/lguest_launcher.h" | 43 | #include "linux/lguest_launcher.h" |
44 | #include "linux/virtio_config.h" | 44 | #include "linux/virtio_config.h" |
45 | #include <linux/virtio_ids.h> | ||
45 | #include "linux/virtio_net.h" | 46 | #include "linux/virtio_net.h" |
46 | #include "linux/virtio_blk.h" | 47 | #include "linux/virtio_blk.h" |
47 | #include "linux/virtio_console.h" | 48 | #include "linux/virtio_console.h" |
@@ -133,6 +134,9 @@ struct device { | |||
133 | /* Is it operational */ | 134 | /* Is it operational */ |
134 | bool running; | 135 | bool running; |
135 | 136 | ||
137 | /* Does Guest want an intrrupt on empty? */ | ||
138 | bool irq_on_empty; | ||
139 | |||
136 | /* Device-specific data. */ | 140 | /* Device-specific data. */ |
137 | void *priv; | 141 | void *priv; |
138 | }; | 142 | }; |
@@ -623,10 +627,13 @@ static void trigger_irq(struct virtqueue *vq) | |||
623 | return; | 627 | return; |
624 | vq->pending_used = 0; | 628 | vq->pending_used = 0; |
625 | 629 | ||
626 | /* If they don't want an interrupt, don't send one, unless empty. */ | 630 | /* If they don't want an interrupt, don't send one... */ |
627 | if ((vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) | 631 | if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) { |
628 | && lg_last_avail(vq) != vq->vring.avail->idx) | 632 | /* ... unless they've asked us to force one on empty. */ |
629 | return; | 633 | if (!vq->dev->irq_on_empty |
634 | || lg_last_avail(vq) != vq->vring.avail->idx) | ||
635 | return; | ||
636 | } | ||
630 | 637 | ||
631 | /* Send the Guest an interrupt tell them we used something up. */ | 638 | /* Send the Guest an interrupt tell them we used something up. */ |
632 | if (write(lguest_fd, buf, sizeof(buf)) != 0) | 639 | if (write(lguest_fd, buf, sizeof(buf)) != 0) |
@@ -1042,6 +1049,15 @@ static void create_thread(struct virtqueue *vq) | |||
1042 | close(vq->eventfd); | 1049 | close(vq->eventfd); |
1043 | } | 1050 | } |
1044 | 1051 | ||
1052 | static bool accepted_feature(struct device *dev, unsigned int bit) | ||
1053 | { | ||
1054 | const u8 *features = get_feature_bits(dev) + dev->feature_len; | ||
1055 | |||
1056 | if (dev->feature_len < bit / CHAR_BIT) | ||
1057 | return false; | ||
1058 | return features[bit / CHAR_BIT] & (1 << (bit % CHAR_BIT)); | ||
1059 | } | ||
1060 | |||
1045 | static void start_device(struct device *dev) | 1061 | static void start_device(struct device *dev) |
1046 | { | 1062 | { |
1047 | unsigned int i; | 1063 | unsigned int i; |
@@ -1055,6 +1071,8 @@ static void start_device(struct device *dev) | |||
1055 | verbose(" %02x", get_feature_bits(dev) | 1071 | verbose(" %02x", get_feature_bits(dev) |
1056 | [dev->feature_len+i]); | 1072 | [dev->feature_len+i]); |
1057 | 1073 | ||
1074 | dev->irq_on_empty = accepted_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY); | ||
1075 | |||
1058 | for (vq = dev->vq; vq; vq = vq->next) { | 1076 | for (vq = dev->vq; vq; vq = vq->next) { |
1059 | if (vq->service) | 1077 | if (vq->service) |
1060 | create_thread(vq); | 1078 | create_thread(vq); |
diff --git a/Documentation/pcmcia/crc32hash.c b/Documentation/pcmcia/crc32hash.c index 4210e5abab8a..44f8beea7260 100644 --- a/Documentation/pcmcia/crc32hash.c +++ b/Documentation/pcmcia/crc32hash.c | |||
@@ -8,7 +8,7 @@ $ ./crc32hash "Dual Speed" | |||
8 | #include <ctype.h> | 8 | #include <ctype.h> |
9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
10 | 10 | ||
11 | unsigned int crc32(unsigned char const *p, unsigned int len) | 11 | static unsigned int crc32(unsigned char const *p, unsigned int len) |
12 | { | 12 | { |
13 | int i; | 13 | int i; |
14 | unsigned int crc = 0; | 14 | unsigned int crc = 0; |
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt index c6cd4956047c..9f16c5178b66 100644 --- a/Documentation/power/power_supply_class.txt +++ b/Documentation/power/power_supply_class.txt | |||
@@ -76,6 +76,11 @@ STATUS - this attribute represents operating status (charging, full, | |||
76 | discharging (i.e. powering a load), etc.). This corresponds to | 76 | discharging (i.e. powering a load), etc.). This corresponds to |
77 | BATTERY_STATUS_* values, as defined in battery.h. | 77 | BATTERY_STATUS_* values, as defined in battery.h. |
78 | 78 | ||
79 | CHARGE_TYPE - batteries can typically charge at different rates. | ||
80 | This defines trickle and fast charges. For batteries that | ||
81 | are already charged or discharging, 'n/a' can be displayed (or | ||
82 | 'unknown', if the status is not known). | ||
83 | |||
79 | HEALTH - represents health of the battery, values corresponds to | 84 | HEALTH - represents health of the battery, values corresponds to |
80 | POWER_SUPPLY_HEALTH_*, defined in battery.h. | 85 | POWER_SUPPLY_HEALTH_*, defined in battery.h. |
81 | 86 | ||
@@ -108,6 +113,8 @@ relative, time-based measurements. | |||
108 | ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. | 113 | ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. |
109 | 114 | ||
110 | CAPACITY - capacity in percents. | 115 | CAPACITY - capacity in percents. |
116 | CAPACITY_LEVEL - capacity level. This corresponds to | ||
117 | POWER_SUPPLY_CAPACITY_LEVEL_*. | ||
111 | 118 | ||
112 | TEMP - temperature of the power supply. | 119 | TEMP - temperature of the power supply. |
113 | TEMP_AMBIENT - ambient temperature. | 120 | TEMP_AMBIENT - ambient temperature. |
diff --git a/Documentation/power/regulator/design.txt b/Documentation/power/regulator/design.txt new file mode 100644 index 000000000000..f9b56b72b782 --- /dev/null +++ b/Documentation/power/regulator/design.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | Regulator API design notes | ||
2 | ========================== | ||
3 | |||
4 | This document provides a brief, partially structured, overview of some | ||
5 | of the design considerations which impact the regulator API design. | ||
6 | |||
7 | Safety | ||
8 | ------ | ||
9 | |||
10 | - Errors in regulator configuration can have very serious consequences | ||
11 | for the system, potentially including lasting hardware damage. | ||
12 | - It is not possible to automatically determine the power confugration | ||
13 | of the system - software-equivalent variants of the same chip may | ||
14 | have different power requirments, and not all components with power | ||
15 | requirements are visible to software. | ||
16 | |||
17 | => The API should make no changes to the hardware state unless it has | ||
18 | specific knowledge that these changes are safe to do perform on | ||
19 | this particular system. | ||
20 | |||
21 | Consumer use cases | ||
22 | ------------------ | ||
23 | |||
24 | - The overwhelming majority of devices in a system will have no | ||
25 | requirement to do any runtime configuration of their power beyond | ||
26 | being able to turn it on or off. | ||
27 | |||
28 | - Many of the power supplies in the system will be shared between many | ||
29 | different consumers. | ||
30 | |||
31 | => The consumer API should be structured so that these use cases are | ||
32 | very easy to handle and so that consumers will work with shared | ||
33 | supplies without any additional effort. | ||
diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt index ce3487d99abe..63728fed620b 100644 --- a/Documentation/power/regulator/machine.txt +++ b/Documentation/power/regulator/machine.txt | |||
@@ -87,7 +87,7 @@ static struct platform_device regulator_devices[] = { | |||
87 | }, | 87 | }, |
88 | }; | 88 | }; |
89 | /* register regulator 1 device */ | 89 | /* register regulator 1 device */ |
90 | platform_device_register(&wm8350_regulator_devices[0]); | 90 | platform_device_register(®ulator_devices[0]); |
91 | 91 | ||
92 | /* register regulator 2 device */ | 92 | /* register regulator 2 device */ |
93 | platform_device_register(&wm8350_regulator_devices[1]); | 93 | platform_device_register(®ulator_devices[1]); |
diff --git a/Documentation/power/regulator/overview.txt b/Documentation/power/regulator/overview.txt index 0cded696ca01..ffd185bb6054 100644 --- a/Documentation/power/regulator/overview.txt +++ b/Documentation/power/regulator/overview.txt | |||
@@ -29,7 +29,7 @@ Some terms used in this document:- | |||
29 | 29 | ||
30 | 30 | ||
31 | o PMIC - Power Management IC. An IC that contains numerous regulators | 31 | o PMIC - Power Management IC. An IC that contains numerous regulators |
32 | and often contains other susbsystems. | 32 | and often contains other subsystems. |
33 | 33 | ||
34 | 34 | ||
35 | o Consumer - Electronic device that is supplied power by a regulator. | 35 | o Consumer - Electronic device that is supplied power by a regulator. |
@@ -168,4 +168,4 @@ relevant to non SoC devices and is split into the following four interfaces:- | |||
168 | userspace via sysfs. This could be used to help monitor device power | 168 | userspace via sysfs. This could be used to help monitor device power |
169 | consumption and status. | 169 | consumption and status. |
170 | 170 | ||
171 | See Documentation/ABI/testing/regulator-sysfs.txt | 171 | See Documentation/ABI/testing/sysfs-class-regulator |
diff --git a/Documentation/power/regulator/regulator.txt b/Documentation/power/regulator/regulator.txt index 4200accb9bba..3f8b528f237e 100644 --- a/Documentation/power/regulator/regulator.txt +++ b/Documentation/power/regulator/regulator.txt | |||
@@ -10,8 +10,9 @@ Registration | |||
10 | 10 | ||
11 | Drivers can register a regulator by calling :- | 11 | Drivers can register a regulator by calling :- |
12 | 12 | ||
13 | struct regulator_dev *regulator_register(struct device *dev, | 13 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, |
14 | struct regulator_desc *regulator_desc); | 14 | struct device *dev, struct regulator_init_data *init_data, |
15 | void *driver_data); | ||
15 | 16 | ||
16 | This will register the regulators capabilities and operations to the regulator | 17 | This will register the regulators capabilities and operations to the regulator |
17 | core. | 18 | core. |
diff --git a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt index 3ed3797b5086..8a0040738969 100644 --- a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt +++ b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt | |||
@@ -10,6 +10,8 @@ Required properties: | |||
10 | - interrupts : should contain eSDHC interrupt. | 10 | - interrupts : should contain eSDHC interrupt. |
11 | - interrupt-parent : interrupt source phandle. | 11 | - interrupt-parent : interrupt source phandle. |
12 | - clock-frequency : specifies eSDHC base clock frequency. | 12 | - clock-frequency : specifies eSDHC base clock frequency. |
13 | - sdhci,wp-inverted : (optional) specifies that eSDHC controller | ||
14 | reports inverted write-protect state; | ||
13 | - sdhci,1-bit-only : (optional) specifies that a controller can | 15 | - sdhci,1-bit-only : (optional) specifies that a controller can |
14 | only handle 1-bit data transfers. | 16 | only handle 1-bit data transfers. |
15 | 17 | ||
diff --git a/Documentation/powerpc/dts-bindings/mtd-physmap.txt b/Documentation/powerpc/dts-bindings/mtd-physmap.txt index 667c9bde8699..80152cb567d9 100644 --- a/Documentation/powerpc/dts-bindings/mtd-physmap.txt +++ b/Documentation/powerpc/dts-bindings/mtd-physmap.txt | |||
@@ -1,18 +1,19 @@ | |||
1 | CFI or JEDEC memory-mapped NOR flash | 1 | CFI or JEDEC memory-mapped NOR flash, MTD-RAM (NVRAM...) |
2 | 2 | ||
3 | Flash chips (Memory Technology Devices) are often used for solid state | 3 | Flash chips (Memory Technology Devices) are often used for solid state |
4 | file systems on embedded devices. | 4 | file systems on embedded devices. |
5 | 5 | ||
6 | - compatible : should contain the specific model of flash chip(s) | 6 | - compatible : should contain the specific model of mtd chip(s) |
7 | used, if known, followed by either "cfi-flash" or "jedec-flash" | 7 | used, if known, followed by either "cfi-flash", "jedec-flash" |
8 | - reg : Address range(s) of the flash chip(s) | 8 | or "mtd-ram". |
9 | - reg : Address range(s) of the mtd chip(s) | ||
9 | It's possible to (optionally) define multiple "reg" tuples so that | 10 | It's possible to (optionally) define multiple "reg" tuples so that |
10 | non-identical NOR chips can be described in one flash node. | 11 | non-identical chips can be described in one node. |
11 | - bank-width : Width (in bytes) of the flash bank. Equal to the | 12 | - bank-width : Width (in bytes) of the bank. Equal to the |
12 | device width times the number of interleaved chips. | 13 | device width times the number of interleaved chips. |
13 | - device-width : (optional) Width of a single flash chip. If | 14 | - device-width : (optional) Width of a single mtd chip. If |
14 | omitted, assumed to be equal to 'bank-width'. | 15 | omitted, assumed to be equal to 'bank-width'. |
15 | - #address-cells, #size-cells : Must be present if the flash has | 16 | - #address-cells, #size-cells : Must be present if the device has |
16 | sub-nodes representing partitions (see below). In this case | 17 | sub-nodes representing partitions (see below). In this case |
17 | both #address-cells and #size-cells must be equal to 1. | 18 | both #address-cells and #size-cells must be equal to 1. |
18 | 19 | ||
@@ -22,24 +23,24 @@ are defined: | |||
22 | - vendor-id : Contains the flash chip's vendor id (1 byte). | 23 | - vendor-id : Contains the flash chip's vendor id (1 byte). |
23 | - device-id : Contains the flash chip's device id (1 byte). | 24 | - device-id : Contains the flash chip's device id (1 byte). |
24 | 25 | ||
25 | In addition to the information on the flash bank itself, the | 26 | In addition to the information on the mtd bank itself, the |
26 | device tree may optionally contain additional information | 27 | device tree may optionally contain additional information |
27 | describing partitions of the flash address space. This can be | 28 | describing partitions of the address space. This can be |
28 | used on platforms which have strong conventions about which | 29 | used on platforms which have strong conventions about which |
29 | portions of the flash are used for what purposes, but which don't | 30 | portions of a flash are used for what purposes, but which don't |
30 | use an on-flash partition table such as RedBoot. | 31 | use an on-flash partition table such as RedBoot. |
31 | 32 | ||
32 | Each partition is represented as a sub-node of the flash device. | 33 | Each partition is represented as a sub-node of the mtd device. |
33 | Each node's name represents the name of the corresponding | 34 | Each node's name represents the name of the corresponding |
34 | partition of the flash device. | 35 | partition of the mtd device. |
35 | 36 | ||
36 | Flash partitions | 37 | Flash partitions |
37 | - reg : The partition's offset and size within the flash bank. | 38 | - reg : The partition's offset and size within the mtd bank. |
38 | - label : (optional) The label / name for this flash partition. | 39 | - label : (optional) The label / name for this partition. |
39 | If omitted, the label is taken from the node name (excluding | 40 | If omitted, the label is taken from the node name (excluding |
40 | the unit address). | 41 | the unit address). |
41 | - read-only : (optional) This parameter, if present, is a hint to | 42 | - read-only : (optional) This parameter, if present, is a hint to |
42 | Linux that this flash partition should only be mounted | 43 | Linux that this partition should only be mounted |
43 | read-only. This is usually used for flash partitions | 44 | read-only. This is usually used for flash partitions |
44 | containing early-boot firmware images or data which should not | 45 | containing early-boot firmware images or data which should not |
45 | be clobbered. | 46 | be clobbered. |
@@ -78,3 +79,12 @@ Here an example with multiple "reg" tuples: | |||
78 | reg = <0 0x04000000>; | 79 | reg = <0 0x04000000>; |
79 | }; | 80 | }; |
80 | }; | 81 | }; |
82 | |||
83 | An example using SRAM: | ||
84 | |||
85 | sram@2,0 { | ||
86 | compatible = "samsung,k6f1616u6a", "mtd-ram"; | ||
87 | reg = <2 0 0x00200000>; | ||
88 | bank-width = <2>; | ||
89 | }; | ||
90 | |||
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt index 8deffcd68cb8..9104c1062084 100644 --- a/Documentation/rtc.txt +++ b/Documentation/rtc.txt | |||
@@ -135,6 +135,30 @@ a high functionality RTC is integrated into the SOC. That system might read | |||
135 | the system clock from the discrete RTC, but use the integrated one for all | 135 | the system clock from the discrete RTC, but use the integrated one for all |
136 | other tasks, because of its greater functionality. | 136 | other tasks, because of its greater functionality. |
137 | 137 | ||
138 | SYSFS INTERFACE | ||
139 | --------------- | ||
140 | |||
141 | The sysfs interface under /sys/class/rtc/rtcN provides access to various | ||
142 | rtc attributes without requiring the use of ioctls. All dates and times | ||
143 | are in the RTC's timezone, rather than in system time. | ||
144 | |||
145 | date: RTC-provided date | ||
146 | hctosys: 1 if the RTC provided the system time at boot via the | ||
147 | CONFIG_RTC_HCTOSYS kernel option, 0 otherwise | ||
148 | max_user_freq: The maximum interrupt rate an unprivileged user may request | ||
149 | from this RTC. | ||
150 | name: The name of the RTC corresponding to this sysfs directory | ||
151 | since_epoch: The number of seconds since the epoch according to the RTC | ||
152 | time: RTC-provided time | ||
153 | wakealarm: The time at which the clock will generate a system wakeup | ||
154 | event. This is a one shot wakeup event, so must be reset | ||
155 | after wake if a daily wakeup is required. Format is either | ||
156 | seconds since the epoch or, if there's a leading +, seconds | ||
157 | in the future. | ||
158 | |||
159 | IOCTL INTERFACE | ||
160 | --------------- | ||
161 | |||
138 | The ioctl() calls supported by /dev/rtc are also supported by the RTC class | 162 | The ioctl() calls supported by /dev/rtc are also supported by the RTC class |
139 | framework. However, because the chips and systems are not standardized, | 163 | framework. However, because the chips and systems are not standardized, |
140 | some PC/AT functionality might not be provided. And in the same way, some | 164 | some PC/AT functionality might not be provided. And in the same way, some |
@@ -185,6 +209,8 @@ driver returns ENOIOCTLCMD. Some common examples: | |||
185 | hardware in the irq_set_freq function. If it isn't, return -EINVAL. If | 209 | hardware in the irq_set_freq function. If it isn't, return -EINVAL. If |
186 | you cannot actually change the frequency, do not define irq_set_freq. | 210 | you cannot actually change the frequency, do not define irq_set_freq. |
187 | 211 | ||
212 | * RTC_PIE_ON, RTC_PIE_OFF: the irq_set_state function will be called. | ||
213 | |||
188 | If all else fails, check out the rtc-test.c driver! | 214 | If all else fails, check out the rtc-test.c driver! |
189 | 215 | ||
190 | 216 | ||
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary index 4a02d2508bc8..deab51ddc33e 100644 --- a/Documentation/spi/spi-summary +++ b/Documentation/spi/spi-summary | |||
@@ -350,7 +350,7 @@ SPI protocol drivers somewhat resemble platform device drivers: | |||
350 | .resume = CHIP_resume, | 350 | .resume = CHIP_resume, |
351 | }; | 351 | }; |
352 | 352 | ||
353 | The driver core will autmatically attempt to bind this driver to any SPI | 353 | The driver core will automatically attempt to bind this driver to any SPI |
354 | device whose board_info gave a modalias of "CHIP". Your probe() code | 354 | device whose board_info gave a modalias of "CHIP". Your probe() code |
355 | might look like this unless you're creating a device which is managing | 355 | might look like this unless you're creating a device which is managing |
356 | a bus (appearing under /sys/class/spi_master). | 356 | a bus (appearing under /sys/class/spi_master). |
diff --git a/Documentation/spi/spidev_test.c b/Documentation/spi/spidev_test.c index c1a5aad3c75a..10abd3773e49 100644 --- a/Documentation/spi/spidev_test.c +++ b/Documentation/spi/spidev_test.c | |||
@@ -69,7 +69,7 @@ static void transfer(int fd) | |||
69 | puts(""); | 69 | puts(""); |
70 | } | 70 | } |
71 | 71 | ||
72 | void print_usage(const char *prog) | 72 | static void print_usage(const char *prog) |
73 | { | 73 | { |
74 | printf("Usage: %s [-DsbdlHOLC3]\n", prog); | 74 | printf("Usage: %s [-DsbdlHOLC3]\n", prog); |
75 | puts(" -D --device device to use (default /dev/spidev1.1)\n" | 75 | puts(" -D --device device to use (default /dev/spidev1.1)\n" |
@@ -85,7 +85,7 @@ void print_usage(const char *prog) | |||
85 | exit(1); | 85 | exit(1); |
86 | } | 86 | } |
87 | 87 | ||
88 | void parse_opts(int argc, char *argv[]) | 88 | static void parse_opts(int argc, char *argv[]) |
89 | { | 89 | { |
90 | while (1) { | 90 | while (1) { |
91 | static const struct option lopts[] = { | 91 | static const struct option lopts[] = { |
diff --git a/Documentation/sysctl/fs.txt b/Documentation/sysctl/fs.txt index 1458448436cc..62682500878a 100644 --- a/Documentation/sysctl/fs.txt +++ b/Documentation/sysctl/fs.txt | |||
@@ -96,13 +96,16 @@ handles that the Linux kernel will allocate. When you get lots | |||
96 | of error messages about running out of file handles, you might | 96 | of error messages about running out of file handles, you might |
97 | want to increase this limit. | 97 | want to increase this limit. |
98 | 98 | ||
99 | The three values in file-nr denote the number of allocated | 99 | Historically, the three values in file-nr denoted the number of |
100 | file handles, the number of unused file handles and the maximum | 100 | allocated file handles, the number of allocated but unused file |
101 | number of file handles. When the allocated file handles come | 101 | handles, and the maximum number of file handles. Linux 2.6 always |
102 | close to the maximum, but the number of unused file handles is | 102 | reports 0 as the number of free file handles -- this is not an |
103 | significantly greater than 0, you've encountered a peak in your | 103 | error, it just means that the number of allocated file handles |
104 | usage of file handles and you don't need to increase the maximum. | 104 | exactly matches the number of used file handles. |
105 | 105 | ||
106 | Attempts to allocate more file descriptors than file-max are | ||
107 | reported with printk, look for "VFS: file-max limit <number> | ||
108 | reached". | ||
106 | ============================================================== | 109 | ============================================================== |
107 | 110 | ||
108 | nr_open: | 111 | nr_open: |
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 3e5b63ebb821..a028b92001ed 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt | |||
@@ -22,6 +22,7 @@ show up in /proc/sys/kernel: | |||
22 | - callhome [ S390 only ] | 22 | - callhome [ S390 only ] |
23 | - auto_msgmni | 23 | - auto_msgmni |
24 | - core_pattern | 24 | - core_pattern |
25 | - core_pipe_limit | ||
25 | - core_uses_pid | 26 | - core_uses_pid |
26 | - ctrl-alt-del | 27 | - ctrl-alt-del |
27 | - dentry-state | 28 | - dentry-state |
@@ -135,6 +136,27 @@ core_pattern is used to specify a core dumpfile pattern name. | |||
135 | 136 | ||
136 | ============================================================== | 137 | ============================================================== |
137 | 138 | ||
139 | core_pipe_limit: | ||
140 | |||
141 | This sysctl is only applicable when core_pattern is configured to pipe core | ||
142 | files to user space helper a (when the first character of core_pattern is a '|', | ||
143 | see above). When collecting cores via a pipe to an application, it is | ||
144 | occasionally usefull for the collecting application to gather data about the | ||
145 | crashing process from its /proc/pid directory. In order to do this safely, the | ||
146 | kernel must wait for the collecting process to exit, so as not to remove the | ||
147 | crashing processes proc files prematurely. This in turn creates the possibility | ||
148 | that a misbehaving userspace collecting process can block the reaping of a | ||
149 | crashed process simply by never exiting. This sysctl defends against that. It | ||
150 | defines how many concurrent crashing processes may be piped to user space | ||
151 | applications in parallel. If this value is exceeded, then those crashing | ||
152 | processes above that value are noted via the kernel log and their cores are | ||
153 | skipped. 0 is a special value, indicating that unlimited processes may be | ||
154 | captured in parallel, but that no waiting will take place (i.e. the collecting | ||
155 | process is not guaranteed access to /proc/<crahing pid>/). This value defaults | ||
156 | to 0. | ||
157 | |||
158 | ============================================================== | ||
159 | |||
138 | core_uses_pid: | 160 | core_uses_pid: |
139 | 161 | ||
140 | The default coredump filename is "core". By setting | 162 | The default coredump filename is "core". By setting |
@@ -313,6 +335,14 @@ send before ratelimiting kicks in. | |||
313 | 335 | ||
314 | ============================================================== | 336 | ============================================================== |
315 | 337 | ||
338 | printk_delay: | ||
339 | |||
340 | Delay each printk message in printk_delay milliseconds | ||
341 | |||
342 | Value from 0 - 10000 is allowed. | ||
343 | |||
344 | ============================================================== | ||
345 | |||
316 | randomize-va-space: | 346 | randomize-va-space: |
317 | 347 | ||
318 | This option can be used to select the type of process address | 348 | This option can be used to select the type of process address |
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index e6fb1ec2744b..a6e360d2055c 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -32,6 +32,8 @@ Currently, these files are in /proc/sys/vm: | |||
32 | - legacy_va_layout | 32 | - legacy_va_layout |
33 | - lowmem_reserve_ratio | 33 | - lowmem_reserve_ratio |
34 | - max_map_count | 34 | - max_map_count |
35 | - memory_failure_early_kill | ||
36 | - memory_failure_recovery | ||
35 | - min_free_kbytes | 37 | - min_free_kbytes |
36 | - min_slab_ratio | 38 | - min_slab_ratio |
37 | - min_unmapped_ratio | 39 | - min_unmapped_ratio |
@@ -53,7 +55,6 @@ Currently, these files are in /proc/sys/vm: | |||
53 | - vfs_cache_pressure | 55 | - vfs_cache_pressure |
54 | - zone_reclaim_mode | 56 | - zone_reclaim_mode |
55 | 57 | ||
56 | |||
57 | ============================================================== | 58 | ============================================================== |
58 | 59 | ||
59 | block_dump | 60 | block_dump |
@@ -275,6 +276,44 @@ e.g., up to one or two maps per allocation. | |||
275 | 276 | ||
276 | The default value is 65536. | 277 | The default value is 65536. |
277 | 278 | ||
279 | ============================================================= | ||
280 | |||
281 | memory_failure_early_kill: | ||
282 | |||
283 | Control how to kill processes when uncorrected memory error (typically | ||
284 | a 2bit error in a memory module) is detected in the background by hardware | ||
285 | that cannot be handled by the kernel. In some cases (like the page | ||
286 | still having a valid copy on disk) the kernel will handle the failure | ||
287 | transparently without affecting any applications. But if there is | ||
288 | no other uptodate copy of the data it will kill to prevent any data | ||
289 | corruptions from propagating. | ||
290 | |||
291 | 1: Kill all processes that have the corrupted and not reloadable page mapped | ||
292 | as soon as the corruption is detected. Note this is not supported | ||
293 | for a few types of pages, like kernel internally allocated data or | ||
294 | the swap cache, but works for the majority of user pages. | ||
295 | |||
296 | 0: Only unmap the corrupted page from all processes and only kill a process | ||
297 | who tries to access it. | ||
298 | |||
299 | The kill is done using a catchable SIGBUS with BUS_MCEERR_AO, so processes can | ||
300 | handle this if they want to. | ||
301 | |||
302 | This is only active on architectures/platforms with advanced machine | ||
303 | check handling and depends on the hardware capabilities. | ||
304 | |||
305 | Applications can override this setting individually with the PR_MCE_KILL prctl | ||
306 | |||
307 | ============================================================== | ||
308 | |||
309 | memory_failure_recovery | ||
310 | |||
311 | Enable memory failure recovery (when supported by the platform) | ||
312 | |||
313 | 1: Attempt recovery. | ||
314 | |||
315 | 0: Always panic on a memory failure. | ||
316 | |||
278 | ============================================================== | 317 | ============================================================== |
279 | 318 | ||
280 | min_free_kbytes: | 319 | min_free_kbytes: |
diff --git a/Documentation/usb/authorization.txt b/Documentation/usb/authorization.txt index 381b22ee7834..c069b6884c77 100644 --- a/Documentation/usb/authorization.txt +++ b/Documentation/usb/authorization.txt | |||
@@ -16,20 +16,20 @@ Usage: | |||
16 | 16 | ||
17 | Authorize a device to connect: | 17 | Authorize a device to connect: |
18 | 18 | ||
19 | $ echo 1 > /sys/usb/devices/DEVICE/authorized | 19 | $ echo 1 > /sys/bus/usb/devices/DEVICE/authorized |
20 | 20 | ||
21 | Deauthorize a device: | 21 | Deauthorize a device: |
22 | 22 | ||
23 | $ echo 0 > /sys/usb/devices/DEVICE/authorized | 23 | $ echo 0 > /sys/bus/usb/devices/DEVICE/authorized |
24 | 24 | ||
25 | Set new devices connected to hostX to be deauthorized by default (ie: | 25 | Set new devices connected to hostX to be deauthorized by default (ie: |
26 | lock down): | 26 | lock down): |
27 | 27 | ||
28 | $ echo 0 > /sys/bus/devices/usbX/authorized_default | 28 | $ echo 0 > /sys/bus/usb/devices/usbX/authorized_default |
29 | 29 | ||
30 | Remove the lock down: | 30 | Remove the lock down: |
31 | 31 | ||
32 | $ echo 1 > /sys/bus/devices/usbX/authorized_default | 32 | $ echo 1 > /sys/bus/usb/devices/usbX/authorized_default |
33 | 33 | ||
34 | By default, Wired USB devices are authorized by default to | 34 | By default, Wired USB devices are authorized by default to |
35 | connect. Wireless USB hosts deauthorize by default all new connected | 35 | connect. Wireless USB hosts deauthorize by default all new connected |
@@ -47,7 +47,7 @@ USB port): | |||
47 | boot up | 47 | boot up |
48 | rc.local -> | 48 | rc.local -> |
49 | 49 | ||
50 | for host in /sys/bus/devices/usb* | 50 | for host in /sys/bus/usb/devices/usb* |
51 | do | 51 | do |
52 | echo 0 > $host/authorized_default | 52 | echo 0 > $host/authorized_default |
53 | done | 53 | done |
diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt index 6c3c625b7f30..66f92d1194c1 100644 --- a/Documentation/usb/usbmon.txt +++ b/Documentation/usb/usbmon.txt | |||
@@ -33,7 +33,7 @@ if usbmon is built into the kernel. | |||
33 | 33 | ||
34 | Verify that bus sockets are present. | 34 | Verify that bus sockets are present. |
35 | 35 | ||
36 | # ls /sys/kernel/debug/usbmon | 36 | # ls /sys/kernel/debug/usb/usbmon |
37 | 0s 0u 1s 1t 1u 2s 2t 2u 3s 3t 3u 4s 4t 4u | 37 | 0s 0u 1s 1t 1u 2s 2t 2u 3s 3t 3u 4s 4t 4u |
38 | # | 38 | # |
39 | 39 | ||
@@ -58,11 +58,11 @@ Bus=03 means it's bus 3. | |||
58 | 58 | ||
59 | 3. Start 'cat' | 59 | 3. Start 'cat' |
60 | 60 | ||
61 | # cat /sys/kernel/debug/usbmon/3u > /tmp/1.mon.out | 61 | # cat /sys/kernel/debug/usb/usbmon/3u > /tmp/1.mon.out |
62 | 62 | ||
63 | to listen on a single bus, otherwise, to listen on all buses, type: | 63 | to listen on a single bus, otherwise, to listen on all buses, type: |
64 | 64 | ||
65 | # cat /sys/kernel/debug/usbmon/0u > /tmp/1.mon.out | 65 | # cat /sys/kernel/debug/usb/usbmon/0u > /tmp/1.mon.out |
66 | 66 | ||
67 | This process will be reading until killed. Naturally, the output can be | 67 | This process will be reading until killed. Naturally, the output can be |
68 | redirected to a desirable location. This is preferred, because it is going | 68 | redirected to a desirable location. This is preferred, because it is going |
@@ -305,7 +305,7 @@ Before the call, hdr, data, and alloc should be filled. Upon return, the area | |||
305 | pointed by hdr contains the next event structure, and the data buffer contains | 305 | pointed by hdr contains the next event structure, and the data buffer contains |
306 | the data, if any. The event is removed from the kernel buffer. | 306 | the data, if any. The event is removed from the kernel buffer. |
307 | 307 | ||
308 | The MON_IOCX_GET copies 48 bytes, MON_IOCX_GETX copies 64 bytes. | 308 | The MON_IOCX_GET copies 48 bytes to hdr area, MON_IOCX_GETX copies 64 bytes. |
309 | 309 | ||
310 | MON_IOCX_MFETCH, defined as _IOWR(MON_IOC_MAGIC, 7, struct mon_mfetch_arg) | 310 | MON_IOCX_MFETCH, defined as _IOWR(MON_IOC_MAGIC, 7, struct mon_mfetch_arg) |
311 | 311 | ||
diff --git a/Documentation/video4linux/v4lgrab.c b/Documentation/video4linux/v4lgrab.c index 05769cff1009..c8ded175796e 100644 --- a/Documentation/video4linux/v4lgrab.c +++ b/Documentation/video4linux/v4lgrab.c | |||
@@ -89,7 +89,7 @@ | |||
89 | } \ | 89 | } \ |
90 | } | 90 | } |
91 | 91 | ||
92 | int get_brightness_adj(unsigned char *image, long size, int *brightness) { | 92 | static int get_brightness_adj(unsigned char *image, long size, int *brightness) { |
93 | long i, tot = 0; | 93 | long i, tot = 0; |
94 | for (i=0;i<size*3;i++) | 94 | for (i=0;i<size*3;i++) |
95 | tot += image[i]; | 95 | tot += image[i]; |
diff --git a/Documentation/vm/.gitignore b/Documentation/vm/.gitignore index 33e8a023df02..09b164a5700f 100644 --- a/Documentation/vm/.gitignore +++ b/Documentation/vm/.gitignore | |||
@@ -1 +1,2 @@ | |||
1 | page-types | ||
1 | slabinfo | 2 | slabinfo |
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c index 0833f44ba16b..fa1a30d9e9d5 100644 --- a/Documentation/vm/page-types.c +++ b/Documentation/vm/page-types.c | |||
@@ -5,6 +5,7 @@ | |||
5 | * Copyright (C) 2009 Wu Fengguang <fengguang.wu@intel.com> | 5 | * Copyright (C) 2009 Wu Fengguang <fengguang.wu@intel.com> |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define _LARGEFILE64_SOURCE | ||
8 | #include <stdio.h> | 9 | #include <stdio.h> |
9 | #include <stdlib.h> | 10 | #include <stdlib.h> |
10 | #include <unistd.h> | 11 | #include <unistd.h> |
@@ -13,12 +14,33 @@ | |||
13 | #include <string.h> | 14 | #include <string.h> |
14 | #include <getopt.h> | 15 | #include <getopt.h> |
15 | #include <limits.h> | 16 | #include <limits.h> |
17 | #include <assert.h> | ||
16 | #include <sys/types.h> | 18 | #include <sys/types.h> |
17 | #include <sys/errno.h> | 19 | #include <sys/errno.h> |
18 | #include <sys/fcntl.h> | 20 | #include <sys/fcntl.h> |
19 | 21 | ||
20 | 22 | ||
21 | /* | 23 | /* |
24 | * pagemap kernel ABI bits | ||
25 | */ | ||
26 | |||
27 | #define PM_ENTRY_BYTES sizeof(uint64_t) | ||
28 | #define PM_STATUS_BITS 3 | ||
29 | #define PM_STATUS_OFFSET (64 - PM_STATUS_BITS) | ||
30 | #define PM_STATUS_MASK (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET) | ||
31 | #define PM_STATUS(nr) (((nr) << PM_STATUS_OFFSET) & PM_STATUS_MASK) | ||
32 | #define PM_PSHIFT_BITS 6 | ||
33 | #define PM_PSHIFT_OFFSET (PM_STATUS_OFFSET - PM_PSHIFT_BITS) | ||
34 | #define PM_PSHIFT_MASK (((1LL << PM_PSHIFT_BITS) - 1) << PM_PSHIFT_OFFSET) | ||
35 | #define PM_PSHIFT(x) (((u64) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK) | ||
36 | #define PM_PFRAME_MASK ((1LL << PM_PSHIFT_OFFSET) - 1) | ||
37 | #define PM_PFRAME(x) ((x) & PM_PFRAME_MASK) | ||
38 | |||
39 | #define PM_PRESENT PM_STATUS(4LL) | ||
40 | #define PM_SWAP PM_STATUS(2LL) | ||
41 | |||
42 | |||
43 | /* | ||
22 | * kernel page flags | 44 | * kernel page flags |
23 | */ | 45 | */ |
24 | 46 | ||
@@ -126,6 +148,14 @@ static int nr_addr_ranges; | |||
126 | static unsigned long opt_offset[MAX_ADDR_RANGES]; | 148 | static unsigned long opt_offset[MAX_ADDR_RANGES]; |
127 | static unsigned long opt_size[MAX_ADDR_RANGES]; | 149 | static unsigned long opt_size[MAX_ADDR_RANGES]; |
128 | 150 | ||
151 | #define MAX_VMAS 10240 | ||
152 | static int nr_vmas; | ||
153 | static unsigned long pg_start[MAX_VMAS]; | ||
154 | static unsigned long pg_end[MAX_VMAS]; | ||
155 | static unsigned long voffset; | ||
156 | |||
157 | static int pagemap_fd; | ||
158 | |||
129 | #define MAX_BIT_FILTERS 64 | 159 | #define MAX_BIT_FILTERS 64 |
130 | static int nr_bit_filters; | 160 | static int nr_bit_filters; |
131 | static uint64_t opt_mask[MAX_BIT_FILTERS]; | 161 | static uint64_t opt_mask[MAX_BIT_FILTERS]; |
@@ -135,7 +165,6 @@ static int page_size; | |||
135 | 165 | ||
136 | #define PAGES_BATCH (64 << 10) /* 64k pages */ | 166 | #define PAGES_BATCH (64 << 10) /* 64k pages */ |
137 | static int kpageflags_fd; | 167 | static int kpageflags_fd; |
138 | static uint64_t kpageflags_buf[KPF_BYTES * PAGES_BATCH]; | ||
139 | 168 | ||
140 | #define HASH_SHIFT 13 | 169 | #define HASH_SHIFT 13 |
141 | #define HASH_SIZE (1 << HASH_SHIFT) | 170 | #define HASH_SIZE (1 << HASH_SHIFT) |
@@ -158,12 +187,17 @@ static uint64_t page_flags[HASH_SIZE]; | |||
158 | type __min2 = (y); \ | 187 | type __min2 = (y); \ |
159 | __min1 < __min2 ? __min1 : __min2; }) | 188 | __min1 < __min2 ? __min1 : __min2; }) |
160 | 189 | ||
161 | unsigned long pages2mb(unsigned long pages) | 190 | #define max_t(type, x, y) ({ \ |
191 | type __max1 = (x); \ | ||
192 | type __max2 = (y); \ | ||
193 | __max1 > __max2 ? __max1 : __max2; }) | ||
194 | |||
195 | static unsigned long pages2mb(unsigned long pages) | ||
162 | { | 196 | { |
163 | return (pages * page_size) >> 20; | 197 | return (pages * page_size) >> 20; |
164 | } | 198 | } |
165 | 199 | ||
166 | void fatal(const char *x, ...) | 200 | static void fatal(const char *x, ...) |
167 | { | 201 | { |
168 | va_list ap; | 202 | va_list ap; |
169 | 203 | ||
@@ -178,7 +212,7 @@ void fatal(const char *x, ...) | |||
178 | * page flag names | 212 | * page flag names |
179 | */ | 213 | */ |
180 | 214 | ||
181 | char *page_flag_name(uint64_t flags) | 215 | static char *page_flag_name(uint64_t flags) |
182 | { | 216 | { |
183 | static char buf[65]; | 217 | static char buf[65]; |
184 | int present; | 218 | int present; |
@@ -197,7 +231,7 @@ char *page_flag_name(uint64_t flags) | |||
197 | return buf; | 231 | return buf; |
198 | } | 232 | } |
199 | 233 | ||
200 | char *page_flag_longname(uint64_t flags) | 234 | static char *page_flag_longname(uint64_t flags) |
201 | { | 235 | { |
202 | static char buf[1024]; | 236 | static char buf[1024]; |
203 | int i, n; | 237 | int i, n; |
@@ -221,32 +255,40 @@ char *page_flag_longname(uint64_t flags) | |||
221 | * page list and summary | 255 | * page list and summary |
222 | */ | 256 | */ |
223 | 257 | ||
224 | void show_page_range(unsigned long offset, uint64_t flags) | 258 | static void show_page_range(unsigned long offset, uint64_t flags) |
225 | { | 259 | { |
226 | static uint64_t flags0; | 260 | static uint64_t flags0; |
261 | static unsigned long voff; | ||
227 | static unsigned long index; | 262 | static unsigned long index; |
228 | static unsigned long count; | 263 | static unsigned long count; |
229 | 264 | ||
230 | if (flags == flags0 && offset == index + count) { | 265 | if (flags == flags0 && offset == index + count && |
266 | (!opt_pid || voffset == voff + count)) { | ||
231 | count++; | 267 | count++; |
232 | return; | 268 | return; |
233 | } | 269 | } |
234 | 270 | ||
235 | if (count) | 271 | if (count) { |
236 | printf("%lu\t%lu\t%s\n", | 272 | if (opt_pid) |
273 | printf("%lx\t", voff); | ||
274 | printf("%lx\t%lx\t%s\n", | ||
237 | index, count, page_flag_name(flags0)); | 275 | index, count, page_flag_name(flags0)); |
276 | } | ||
238 | 277 | ||
239 | flags0 = flags; | 278 | flags0 = flags; |
240 | index = offset; | 279 | index = offset; |
280 | voff = voffset; | ||
241 | count = 1; | 281 | count = 1; |
242 | } | 282 | } |
243 | 283 | ||
244 | void show_page(unsigned long offset, uint64_t flags) | 284 | static void show_page(unsigned long offset, uint64_t flags) |
245 | { | 285 | { |
246 | printf("%lu\t%s\n", offset, page_flag_name(flags)); | 286 | if (opt_pid) |
287 | printf("%lx\t", voffset); | ||
288 | printf("%lx\t%s\n", offset, page_flag_name(flags)); | ||
247 | } | 289 | } |
248 | 290 | ||
249 | void show_summary(void) | 291 | static void show_summary(void) |
250 | { | 292 | { |
251 | int i; | 293 | int i; |
252 | 294 | ||
@@ -272,7 +314,7 @@ void show_summary(void) | |||
272 | * page flag filters | 314 | * page flag filters |
273 | */ | 315 | */ |
274 | 316 | ||
275 | int bit_mask_ok(uint64_t flags) | 317 | static int bit_mask_ok(uint64_t flags) |
276 | { | 318 | { |
277 | int i; | 319 | int i; |
278 | 320 | ||
@@ -289,7 +331,7 @@ int bit_mask_ok(uint64_t flags) | |||
289 | return 1; | 331 | return 1; |
290 | } | 332 | } |
291 | 333 | ||
292 | uint64_t expand_overloaded_flags(uint64_t flags) | 334 | static uint64_t expand_overloaded_flags(uint64_t flags) |
293 | { | 335 | { |
294 | /* SLOB/SLUB overload several page flags */ | 336 | /* SLOB/SLUB overload several page flags */ |
295 | if (flags & BIT(SLAB)) { | 337 | if (flags & BIT(SLAB)) { |
@@ -308,7 +350,7 @@ uint64_t expand_overloaded_flags(uint64_t flags) | |||
308 | return flags; | 350 | return flags; |
309 | } | 351 | } |
310 | 352 | ||
311 | uint64_t well_known_flags(uint64_t flags) | 353 | static uint64_t well_known_flags(uint64_t flags) |
312 | { | 354 | { |
313 | /* hide flags intended only for kernel hacker */ | 355 | /* hide flags intended only for kernel hacker */ |
314 | flags &= ~KPF_HACKERS_BITS; | 356 | flags &= ~KPF_HACKERS_BITS; |
@@ -325,7 +367,7 @@ uint64_t well_known_flags(uint64_t flags) | |||
325 | * page frame walker | 367 | * page frame walker |
326 | */ | 368 | */ |
327 | 369 | ||
328 | int hash_slot(uint64_t flags) | 370 | static int hash_slot(uint64_t flags) |
329 | { | 371 | { |
330 | int k = HASH_KEY(flags); | 372 | int k = HASH_KEY(flags); |
331 | int i; | 373 | int i; |
@@ -352,7 +394,7 @@ int hash_slot(uint64_t flags) | |||
352 | exit(EXIT_FAILURE); | 394 | exit(EXIT_FAILURE); |
353 | } | 395 | } |
354 | 396 | ||
355 | void add_page(unsigned long offset, uint64_t flags) | 397 | static void add_page(unsigned long offset, uint64_t flags) |
356 | { | 398 | { |
357 | flags = expand_overloaded_flags(flags); | 399 | flags = expand_overloaded_flags(flags); |
358 | 400 | ||
@@ -371,7 +413,7 @@ void add_page(unsigned long offset, uint64_t flags) | |||
371 | total_pages++; | 413 | total_pages++; |
372 | } | 414 | } |
373 | 415 | ||
374 | void walk_pfn(unsigned long index, unsigned long count) | 416 | static void walk_pfn(unsigned long index, unsigned long count) |
375 | { | 417 | { |
376 | unsigned long batch; | 418 | unsigned long batch; |
377 | unsigned long n; | 419 | unsigned long n; |
@@ -383,6 +425,8 @@ void walk_pfn(unsigned long index, unsigned long count) | |||
383 | lseek(kpageflags_fd, index * KPF_BYTES, SEEK_SET); | 425 | lseek(kpageflags_fd, index * KPF_BYTES, SEEK_SET); |
384 | 426 | ||
385 | while (count) { | 427 | while (count) { |
428 | uint64_t kpageflags_buf[KPF_BYTES * PAGES_BATCH]; | ||
429 | |||
386 | batch = min_t(unsigned long, count, PAGES_BATCH); | 430 | batch = min_t(unsigned long, count, PAGES_BATCH); |
387 | n = read(kpageflags_fd, kpageflags_buf, batch * KPF_BYTES); | 431 | n = read(kpageflags_fd, kpageflags_buf, batch * KPF_BYTES); |
388 | if (n == 0) | 432 | if (n == 0) |
@@ -404,7 +448,82 @@ void walk_pfn(unsigned long index, unsigned long count) | |||
404 | } | 448 | } |
405 | } | 449 | } |
406 | 450 | ||
407 | void walk_addr_ranges(void) | 451 | |
452 | #define PAGEMAP_BATCH 4096 | ||
453 | static unsigned long task_pfn(unsigned long pgoff) | ||
454 | { | ||
455 | static uint64_t buf[PAGEMAP_BATCH]; | ||
456 | static unsigned long start; | ||
457 | static long count; | ||
458 | uint64_t pfn; | ||
459 | |||
460 | if (pgoff < start || pgoff >= start + count) { | ||
461 | if (lseek64(pagemap_fd, | ||
462 | (uint64_t)pgoff * PM_ENTRY_BYTES, | ||
463 | SEEK_SET) < 0) { | ||
464 | perror("pagemap seek"); | ||
465 | exit(EXIT_FAILURE); | ||
466 | } | ||
467 | count = read(pagemap_fd, buf, sizeof(buf)); | ||
468 | if (count == 0) | ||
469 | return 0; | ||
470 | if (count < 0) { | ||
471 | perror("pagemap read"); | ||
472 | exit(EXIT_FAILURE); | ||
473 | } | ||
474 | if (count % PM_ENTRY_BYTES) { | ||
475 | fatal("pagemap read not aligned.\n"); | ||
476 | exit(EXIT_FAILURE); | ||
477 | } | ||
478 | count /= PM_ENTRY_BYTES; | ||
479 | start = pgoff; | ||
480 | } | ||
481 | |||
482 | pfn = buf[pgoff - start]; | ||
483 | if (pfn & PM_PRESENT) | ||
484 | pfn = PM_PFRAME(pfn); | ||
485 | else | ||
486 | pfn = 0; | ||
487 | |||
488 | return pfn; | ||
489 | } | ||
490 | |||
491 | static void walk_task(unsigned long index, unsigned long count) | ||
492 | { | ||
493 | int i = 0; | ||
494 | const unsigned long end = index + count; | ||
495 | |||
496 | while (index < end) { | ||
497 | |||
498 | while (pg_end[i] <= index) | ||
499 | if (++i >= nr_vmas) | ||
500 | return; | ||
501 | if (pg_start[i] >= end) | ||
502 | return; | ||
503 | |||
504 | voffset = max_t(unsigned long, pg_start[i], index); | ||
505 | index = min_t(unsigned long, pg_end[i], end); | ||
506 | |||
507 | assert(voffset < index); | ||
508 | for (; voffset < index; voffset++) { | ||
509 | unsigned long pfn = task_pfn(voffset); | ||
510 | if (pfn) | ||
511 | walk_pfn(pfn, 1); | ||
512 | } | ||
513 | } | ||
514 | } | ||
515 | |||
516 | static void add_addr_range(unsigned long offset, unsigned long size) | ||
517 | { | ||
518 | if (nr_addr_ranges >= MAX_ADDR_RANGES) | ||
519 | fatal("too many addr ranges\n"); | ||
520 | |||
521 | opt_offset[nr_addr_ranges] = offset; | ||
522 | opt_size[nr_addr_ranges] = min_t(unsigned long, size, ULONG_MAX-offset); | ||
523 | nr_addr_ranges++; | ||
524 | } | ||
525 | |||
526 | static void walk_addr_ranges(void) | ||
408 | { | 527 | { |
409 | int i; | 528 | int i; |
410 | 529 | ||
@@ -415,10 +534,13 @@ void walk_addr_ranges(void) | |||
415 | } | 534 | } |
416 | 535 | ||
417 | if (!nr_addr_ranges) | 536 | if (!nr_addr_ranges) |
418 | walk_pfn(0, ULONG_MAX); | 537 | add_addr_range(0, ULONG_MAX); |
419 | 538 | ||
420 | for (i = 0; i < nr_addr_ranges; i++) | 539 | for (i = 0; i < nr_addr_ranges; i++) |
421 | walk_pfn(opt_offset[i], opt_size[i]); | 540 | if (!opt_pid) |
541 | walk_pfn(opt_offset[i], opt_size[i]); | ||
542 | else | ||
543 | walk_task(opt_offset[i], opt_size[i]); | ||
422 | 544 | ||
423 | close(kpageflags_fd); | 545 | close(kpageflags_fd); |
424 | } | 546 | } |
@@ -428,7 +550,7 @@ void walk_addr_ranges(void) | |||
428 | * user interface | 550 | * user interface |
429 | */ | 551 | */ |
430 | 552 | ||
431 | const char *page_flag_type(uint64_t flag) | 553 | static const char *page_flag_type(uint64_t flag) |
432 | { | 554 | { |
433 | if (flag & KPF_HACKERS_BITS) | 555 | if (flag & KPF_HACKERS_BITS) |
434 | return "(r)"; | 556 | return "(r)"; |
@@ -437,7 +559,7 @@ const char *page_flag_type(uint64_t flag) | |||
437 | return " "; | 559 | return " "; |
438 | } | 560 | } |
439 | 561 | ||
440 | void usage(void) | 562 | static void usage(void) |
441 | { | 563 | { |
442 | int i, j; | 564 | int i, j; |
443 | 565 | ||
@@ -446,8 +568,8 @@ void usage(void) | |||
446 | " -r|--raw Raw mode, for kernel developers\n" | 568 | " -r|--raw Raw mode, for kernel developers\n" |
447 | " -a|--addr addr-spec Walk a range of pages\n" | 569 | " -a|--addr addr-spec Walk a range of pages\n" |
448 | " -b|--bits bits-spec Walk pages with specified bits\n" | 570 | " -b|--bits bits-spec Walk pages with specified bits\n" |
449 | #if 0 /* planned features */ | ||
450 | " -p|--pid pid Walk process address space\n" | 571 | " -p|--pid pid Walk process address space\n" |
572 | #if 0 /* planned features */ | ||
451 | " -f|--file filename Walk file address space\n" | 573 | " -f|--file filename Walk file address space\n" |
452 | #endif | 574 | #endif |
453 | " -l|--list Show page details in ranges\n" | 575 | " -l|--list Show page details in ranges\n" |
@@ -459,7 +581,7 @@ void usage(void) | |||
459 | " N+M pages range from N to N+M-1\n" | 581 | " N+M pages range from N to N+M-1\n" |
460 | " N,M pages range from N to M-1\n" | 582 | " N,M pages range from N to M-1\n" |
461 | " N, pages range from N to end\n" | 583 | " N, pages range from N to end\n" |
462 | " ,M pages range from 0 to M\n" | 584 | " ,M pages range from 0 to M-1\n" |
463 | "bits-spec:\n" | 585 | "bits-spec:\n" |
464 | " bit1,bit2 (flags & (bit1|bit2)) != 0\n" | 586 | " bit1,bit2 (flags & (bit1|bit2)) != 0\n" |
465 | " bit1,bit2=bit1 (flags & (bit1|bit2)) == bit1\n" | 587 | " bit1,bit2=bit1 (flags & (bit1|bit2)) == bit1\n" |
@@ -482,7 +604,7 @@ void usage(void) | |||
482 | "(r) raw mode bits (o) overloaded bits\n"); | 604 | "(r) raw mode bits (o) overloaded bits\n"); |
483 | } | 605 | } |
484 | 606 | ||
485 | unsigned long long parse_number(const char *str) | 607 | static unsigned long long parse_number(const char *str) |
486 | { | 608 | { |
487 | unsigned long long n; | 609 | unsigned long long n; |
488 | 610 | ||
@@ -494,26 +616,62 @@ unsigned long long parse_number(const char *str) | |||
494 | return n; | 616 | return n; |
495 | } | 617 | } |
496 | 618 | ||
497 | void parse_pid(const char *str) | 619 | static void parse_pid(const char *str) |
498 | { | 620 | { |
621 | FILE *file; | ||
622 | char buf[5000]; | ||
623 | |||
499 | opt_pid = parse_number(str); | 624 | opt_pid = parse_number(str); |
500 | } | ||
501 | 625 | ||
502 | void parse_file(const char *name) | 626 | sprintf(buf, "/proc/%d/pagemap", opt_pid); |
503 | { | 627 | pagemap_fd = open(buf, O_RDONLY); |
628 | if (pagemap_fd < 0) { | ||
629 | perror(buf); | ||
630 | exit(EXIT_FAILURE); | ||
631 | } | ||
632 | |||
633 | sprintf(buf, "/proc/%d/maps", opt_pid); | ||
634 | file = fopen(buf, "r"); | ||
635 | if (!file) { | ||
636 | perror(buf); | ||
637 | exit(EXIT_FAILURE); | ||
638 | } | ||
639 | |||
640 | while (fgets(buf, sizeof(buf), file) != NULL) { | ||
641 | unsigned long vm_start; | ||
642 | unsigned long vm_end; | ||
643 | unsigned long long pgoff; | ||
644 | int major, minor; | ||
645 | char r, w, x, s; | ||
646 | unsigned long ino; | ||
647 | int n; | ||
648 | |||
649 | n = sscanf(buf, "%lx-%lx %c%c%c%c %llx %x:%x %lu", | ||
650 | &vm_start, | ||
651 | &vm_end, | ||
652 | &r, &w, &x, &s, | ||
653 | &pgoff, | ||
654 | &major, &minor, | ||
655 | &ino); | ||
656 | if (n < 10) { | ||
657 | fprintf(stderr, "unexpected line: %s\n", buf); | ||
658 | continue; | ||
659 | } | ||
660 | pg_start[nr_vmas] = vm_start / page_size; | ||
661 | pg_end[nr_vmas] = vm_end / page_size; | ||
662 | if (++nr_vmas >= MAX_VMAS) { | ||
663 | fprintf(stderr, "too many VMAs\n"); | ||
664 | break; | ||
665 | } | ||
666 | } | ||
667 | fclose(file); | ||
504 | } | 668 | } |
505 | 669 | ||
506 | void add_addr_range(unsigned long offset, unsigned long size) | 670 | static void parse_file(const char *name) |
507 | { | 671 | { |
508 | if (nr_addr_ranges >= MAX_ADDR_RANGES) | ||
509 | fatal("too much addr ranges\n"); | ||
510 | |||
511 | opt_offset[nr_addr_ranges] = offset; | ||
512 | opt_size[nr_addr_ranges] = size; | ||
513 | nr_addr_ranges++; | ||
514 | } | 672 | } |
515 | 673 | ||
516 | void parse_addr_range(const char *optarg) | 674 | static void parse_addr_range(const char *optarg) |
517 | { | 675 | { |
518 | unsigned long offset; | 676 | unsigned long offset; |
519 | unsigned long size; | 677 | unsigned long size; |
@@ -547,7 +705,7 @@ void parse_addr_range(const char *optarg) | |||
547 | add_addr_range(offset, size); | 705 | add_addr_range(offset, size); |
548 | } | 706 | } |
549 | 707 | ||
550 | void add_bits_filter(uint64_t mask, uint64_t bits) | 708 | static void add_bits_filter(uint64_t mask, uint64_t bits) |
551 | { | 709 | { |
552 | if (nr_bit_filters >= MAX_BIT_FILTERS) | 710 | if (nr_bit_filters >= MAX_BIT_FILTERS) |
553 | fatal("too much bit filters\n"); | 711 | fatal("too much bit filters\n"); |
@@ -557,7 +715,7 @@ void add_bits_filter(uint64_t mask, uint64_t bits) | |||
557 | nr_bit_filters++; | 715 | nr_bit_filters++; |
558 | } | 716 | } |
559 | 717 | ||
560 | uint64_t parse_flag_name(const char *str, int len) | 718 | static uint64_t parse_flag_name(const char *str, int len) |
561 | { | 719 | { |
562 | int i; | 720 | int i; |
563 | 721 | ||
@@ -577,7 +735,7 @@ uint64_t parse_flag_name(const char *str, int len) | |||
577 | return parse_number(str); | 735 | return parse_number(str); |
578 | } | 736 | } |
579 | 737 | ||
580 | uint64_t parse_flag_names(const char *str, int all) | 738 | static uint64_t parse_flag_names(const char *str, int all) |
581 | { | 739 | { |
582 | const char *p = str; | 740 | const char *p = str; |
583 | uint64_t flags = 0; | 741 | uint64_t flags = 0; |
@@ -596,7 +754,7 @@ uint64_t parse_flag_names(const char *str, int all) | |||
596 | return flags; | 754 | return flags; |
597 | } | 755 | } |
598 | 756 | ||
599 | void parse_bits_mask(const char *optarg) | 757 | static void parse_bits_mask(const char *optarg) |
600 | { | 758 | { |
601 | uint64_t mask; | 759 | uint64_t mask; |
602 | uint64_t bits; | 760 | uint64_t bits; |
@@ -621,7 +779,7 @@ void parse_bits_mask(const char *optarg) | |||
621 | } | 779 | } |
622 | 780 | ||
623 | 781 | ||
624 | struct option opts[] = { | 782 | static struct option opts[] = { |
625 | { "raw" , 0, NULL, 'r' }, | 783 | { "raw" , 0, NULL, 'r' }, |
626 | { "pid" , 1, NULL, 'p' }, | 784 | { "pid" , 1, NULL, 'p' }, |
627 | { "file" , 1, NULL, 'f' }, | 785 | { "file" , 1, NULL, 'f' }, |
@@ -676,8 +834,10 @@ int main(int argc, char *argv[]) | |||
676 | } | 834 | } |
677 | } | 835 | } |
678 | 836 | ||
837 | if (opt_list && opt_pid) | ||
838 | printf("voffset\t"); | ||
679 | if (opt_list == 1) | 839 | if (opt_list == 1) |
680 | printf("offset\tcount\tflags\n"); | 840 | printf("offset\tlen\tflags\n"); |
681 | if (opt_list == 2) | 841 | if (opt_list == 2) |
682 | printf("offset\tflags\n"); | 842 | printf("offset\tflags\n"); |
683 | 843 | ||
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c index df3227605d59..92e729f4b676 100644 --- a/Documentation/vm/slabinfo.c +++ b/Documentation/vm/slabinfo.c | |||
@@ -87,7 +87,7 @@ int page_size; | |||
87 | 87 | ||
88 | regex_t pattern; | 88 | regex_t pattern; |
89 | 89 | ||
90 | void fatal(const char *x, ...) | 90 | static void fatal(const char *x, ...) |
91 | { | 91 | { |
92 | va_list ap; | 92 | va_list ap; |
93 | 93 | ||
@@ -97,7 +97,7 @@ void fatal(const char *x, ...) | |||
97 | exit(EXIT_FAILURE); | 97 | exit(EXIT_FAILURE); |
98 | } | 98 | } |
99 | 99 | ||
100 | void usage(void) | 100 | static void usage(void) |
101 | { | 101 | { |
102 | printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n" | 102 | printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n" |
103 | "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" | 103 | "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" |
@@ -131,7 +131,7 @@ void usage(void) | |||
131 | ); | 131 | ); |
132 | } | 132 | } |
133 | 133 | ||
134 | unsigned long read_obj(const char *name) | 134 | static unsigned long read_obj(const char *name) |
135 | { | 135 | { |
136 | FILE *f = fopen(name, "r"); | 136 | FILE *f = fopen(name, "r"); |
137 | 137 | ||
@@ -151,7 +151,7 @@ unsigned long read_obj(const char *name) | |||
151 | /* | 151 | /* |
152 | * Get the contents of an attribute | 152 | * Get the contents of an attribute |
153 | */ | 153 | */ |
154 | unsigned long get_obj(const char *name) | 154 | static unsigned long get_obj(const char *name) |
155 | { | 155 | { |
156 | if (!read_obj(name)) | 156 | if (!read_obj(name)) |
157 | return 0; | 157 | return 0; |
@@ -159,7 +159,7 @@ unsigned long get_obj(const char *name) | |||
159 | return atol(buffer); | 159 | return atol(buffer); |
160 | } | 160 | } |
161 | 161 | ||
162 | unsigned long get_obj_and_str(const char *name, char **x) | 162 | static unsigned long get_obj_and_str(const char *name, char **x) |
163 | { | 163 | { |
164 | unsigned long result = 0; | 164 | unsigned long result = 0; |
165 | char *p; | 165 | char *p; |
@@ -178,7 +178,7 @@ unsigned long get_obj_and_str(const char *name, char **x) | |||
178 | return result; | 178 | return result; |
179 | } | 179 | } |
180 | 180 | ||
181 | void set_obj(struct slabinfo *s, const char *name, int n) | 181 | static void set_obj(struct slabinfo *s, const char *name, int n) |
182 | { | 182 | { |
183 | char x[100]; | 183 | char x[100]; |
184 | FILE *f; | 184 | FILE *f; |
@@ -192,7 +192,7 @@ void set_obj(struct slabinfo *s, const char *name, int n) | |||
192 | fclose(f); | 192 | fclose(f); |
193 | } | 193 | } |
194 | 194 | ||
195 | unsigned long read_slab_obj(struct slabinfo *s, const char *name) | 195 | static unsigned long read_slab_obj(struct slabinfo *s, const char *name) |
196 | { | 196 | { |
197 | char x[100]; | 197 | char x[100]; |
198 | FILE *f; | 198 | FILE *f; |
@@ -215,7 +215,7 @@ unsigned long read_slab_obj(struct slabinfo *s, const char *name) | |||
215 | /* | 215 | /* |
216 | * Put a size string together | 216 | * Put a size string together |
217 | */ | 217 | */ |
218 | int store_size(char *buffer, unsigned long value) | 218 | static int store_size(char *buffer, unsigned long value) |
219 | { | 219 | { |
220 | unsigned long divisor = 1; | 220 | unsigned long divisor = 1; |
221 | char trailer = 0; | 221 | char trailer = 0; |
@@ -247,7 +247,7 @@ int store_size(char *buffer, unsigned long value) | |||
247 | return n; | 247 | return n; |
248 | } | 248 | } |
249 | 249 | ||
250 | void decode_numa_list(int *numa, char *t) | 250 | static void decode_numa_list(int *numa, char *t) |
251 | { | 251 | { |
252 | int node; | 252 | int node; |
253 | int nr; | 253 | int nr; |
@@ -272,7 +272,7 @@ void decode_numa_list(int *numa, char *t) | |||
272 | } | 272 | } |
273 | } | 273 | } |
274 | 274 | ||
275 | void slab_validate(struct slabinfo *s) | 275 | static void slab_validate(struct slabinfo *s) |
276 | { | 276 | { |
277 | if (strcmp(s->name, "*") == 0) | 277 | if (strcmp(s->name, "*") == 0) |
278 | return; | 278 | return; |
@@ -280,7 +280,7 @@ void slab_validate(struct slabinfo *s) | |||
280 | set_obj(s, "validate", 1); | 280 | set_obj(s, "validate", 1); |
281 | } | 281 | } |
282 | 282 | ||
283 | void slab_shrink(struct slabinfo *s) | 283 | static void slab_shrink(struct slabinfo *s) |
284 | { | 284 | { |
285 | if (strcmp(s->name, "*") == 0) | 285 | if (strcmp(s->name, "*") == 0) |
286 | return; | 286 | return; |
@@ -290,7 +290,7 @@ void slab_shrink(struct slabinfo *s) | |||
290 | 290 | ||
291 | int line = 0; | 291 | int line = 0; |
292 | 292 | ||
293 | void first_line(void) | 293 | static void first_line(void) |
294 | { | 294 | { |
295 | if (show_activity) | 295 | if (show_activity) |
296 | printf("Name Objects Alloc Free %%Fast Fallb O\n"); | 296 | printf("Name Objects Alloc Free %%Fast Fallb O\n"); |
@@ -302,7 +302,7 @@ void first_line(void) | |||
302 | /* | 302 | /* |
303 | * Find the shortest alias of a slab | 303 | * Find the shortest alias of a slab |
304 | */ | 304 | */ |
305 | struct aliasinfo *find_one_alias(struct slabinfo *find) | 305 | static struct aliasinfo *find_one_alias(struct slabinfo *find) |
306 | { | 306 | { |
307 | struct aliasinfo *a; | 307 | struct aliasinfo *a; |
308 | struct aliasinfo *best = NULL; | 308 | struct aliasinfo *best = NULL; |
@@ -318,18 +318,18 @@ struct aliasinfo *find_one_alias(struct slabinfo *find) | |||
318 | return best; | 318 | return best; |
319 | } | 319 | } |
320 | 320 | ||
321 | unsigned long slab_size(struct slabinfo *s) | 321 | static unsigned long slab_size(struct slabinfo *s) |
322 | { | 322 | { |
323 | return s->slabs * (page_size << s->order); | 323 | return s->slabs * (page_size << s->order); |
324 | } | 324 | } |
325 | 325 | ||
326 | unsigned long slab_activity(struct slabinfo *s) | 326 | static unsigned long slab_activity(struct slabinfo *s) |
327 | { | 327 | { |
328 | return s->alloc_fastpath + s->free_fastpath + | 328 | return s->alloc_fastpath + s->free_fastpath + |
329 | s->alloc_slowpath + s->free_slowpath; | 329 | s->alloc_slowpath + s->free_slowpath; |
330 | } | 330 | } |
331 | 331 | ||
332 | void slab_numa(struct slabinfo *s, int mode) | 332 | static void slab_numa(struct slabinfo *s, int mode) |
333 | { | 333 | { |
334 | int node; | 334 | int node; |
335 | 335 | ||
@@ -374,7 +374,7 @@ void slab_numa(struct slabinfo *s, int mode) | |||
374 | line++; | 374 | line++; |
375 | } | 375 | } |
376 | 376 | ||
377 | void show_tracking(struct slabinfo *s) | 377 | static void show_tracking(struct slabinfo *s) |
378 | { | 378 | { |
379 | printf("\n%s: Kernel object allocation\n", s->name); | 379 | printf("\n%s: Kernel object allocation\n", s->name); |
380 | printf("-----------------------------------------------------------------------\n"); | 380 | printf("-----------------------------------------------------------------------\n"); |
@@ -392,7 +392,7 @@ void show_tracking(struct slabinfo *s) | |||
392 | 392 | ||
393 | } | 393 | } |
394 | 394 | ||
395 | void ops(struct slabinfo *s) | 395 | static void ops(struct slabinfo *s) |
396 | { | 396 | { |
397 | if (strcmp(s->name, "*") == 0) | 397 | if (strcmp(s->name, "*") == 0) |
398 | return; | 398 | return; |
@@ -405,14 +405,14 @@ void ops(struct slabinfo *s) | |||
405 | printf("\n%s has no kmem_cache operations\n", s->name); | 405 | printf("\n%s has no kmem_cache operations\n", s->name); |
406 | } | 406 | } |
407 | 407 | ||
408 | const char *onoff(int x) | 408 | static const char *onoff(int x) |
409 | { | 409 | { |
410 | if (x) | 410 | if (x) |
411 | return "On "; | 411 | return "On "; |
412 | return "Off"; | 412 | return "Off"; |
413 | } | 413 | } |
414 | 414 | ||
415 | void slab_stats(struct slabinfo *s) | 415 | static void slab_stats(struct slabinfo *s) |
416 | { | 416 | { |
417 | unsigned long total_alloc; | 417 | unsigned long total_alloc; |
418 | unsigned long total_free; | 418 | unsigned long total_free; |
@@ -477,7 +477,7 @@ void slab_stats(struct slabinfo *s) | |||
477 | s->deactivate_to_tail, (s->deactivate_to_tail * 100) / total); | 477 | s->deactivate_to_tail, (s->deactivate_to_tail * 100) / total); |
478 | } | 478 | } |
479 | 479 | ||
480 | void report(struct slabinfo *s) | 480 | static void report(struct slabinfo *s) |
481 | { | 481 | { |
482 | if (strcmp(s->name, "*") == 0) | 482 | if (strcmp(s->name, "*") == 0) |
483 | return; | 483 | return; |
@@ -518,7 +518,7 @@ void report(struct slabinfo *s) | |||
518 | slab_stats(s); | 518 | slab_stats(s); |
519 | } | 519 | } |
520 | 520 | ||
521 | void slabcache(struct slabinfo *s) | 521 | static void slabcache(struct slabinfo *s) |
522 | { | 522 | { |
523 | char size_str[20]; | 523 | char size_str[20]; |
524 | char dist_str[40]; | 524 | char dist_str[40]; |
@@ -593,7 +593,7 @@ void slabcache(struct slabinfo *s) | |||
593 | /* | 593 | /* |
594 | * Analyze debug options. Return false if something is amiss. | 594 | * Analyze debug options. Return false if something is amiss. |
595 | */ | 595 | */ |
596 | int debug_opt_scan(char *opt) | 596 | static int debug_opt_scan(char *opt) |
597 | { | 597 | { |
598 | if (!opt || !opt[0] || strcmp(opt, "-") == 0) | 598 | if (!opt || !opt[0] || strcmp(opt, "-") == 0) |
599 | return 1; | 599 | return 1; |
@@ -642,7 +642,7 @@ int debug_opt_scan(char *opt) | |||
642 | return 1; | 642 | return 1; |
643 | } | 643 | } |
644 | 644 | ||
645 | int slab_empty(struct slabinfo *s) | 645 | static int slab_empty(struct slabinfo *s) |
646 | { | 646 | { |
647 | if (s->objects > 0) | 647 | if (s->objects > 0) |
648 | return 0; | 648 | return 0; |
@@ -657,7 +657,7 @@ int slab_empty(struct slabinfo *s) | |||
657 | return 1; | 657 | return 1; |
658 | } | 658 | } |
659 | 659 | ||
660 | void slab_debug(struct slabinfo *s) | 660 | static void slab_debug(struct slabinfo *s) |
661 | { | 661 | { |
662 | if (strcmp(s->name, "*") == 0) | 662 | if (strcmp(s->name, "*") == 0) |
663 | return; | 663 | return; |
@@ -717,7 +717,7 @@ void slab_debug(struct slabinfo *s) | |||
717 | set_obj(s, "trace", 1); | 717 | set_obj(s, "trace", 1); |
718 | } | 718 | } |
719 | 719 | ||
720 | void totals(void) | 720 | static void totals(void) |
721 | { | 721 | { |
722 | struct slabinfo *s; | 722 | struct slabinfo *s; |
723 | 723 | ||
@@ -976,7 +976,7 @@ void totals(void) | |||
976 | b1, b2, b3); | 976 | b1, b2, b3); |
977 | } | 977 | } |
978 | 978 | ||
979 | void sort_slabs(void) | 979 | static void sort_slabs(void) |
980 | { | 980 | { |
981 | struct slabinfo *s1,*s2; | 981 | struct slabinfo *s1,*s2; |
982 | 982 | ||
@@ -1005,7 +1005,7 @@ void sort_slabs(void) | |||
1005 | } | 1005 | } |
1006 | } | 1006 | } |
1007 | 1007 | ||
1008 | void sort_aliases(void) | 1008 | static void sort_aliases(void) |
1009 | { | 1009 | { |
1010 | struct aliasinfo *a1,*a2; | 1010 | struct aliasinfo *a1,*a2; |
1011 | 1011 | ||
@@ -1030,7 +1030,7 @@ void sort_aliases(void) | |||
1030 | } | 1030 | } |
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | void link_slabs(void) | 1033 | static void link_slabs(void) |
1034 | { | 1034 | { |
1035 | struct aliasinfo *a; | 1035 | struct aliasinfo *a; |
1036 | struct slabinfo *s; | 1036 | struct slabinfo *s; |
@@ -1048,7 +1048,7 @@ void link_slabs(void) | |||
1048 | } | 1048 | } |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | void alias(void) | 1051 | static void alias(void) |
1052 | { | 1052 | { |
1053 | struct aliasinfo *a; | 1053 | struct aliasinfo *a; |
1054 | char *active = NULL; | 1054 | char *active = NULL; |
@@ -1079,7 +1079,7 @@ void alias(void) | |||
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | 1081 | ||
1082 | void rename_slabs(void) | 1082 | static void rename_slabs(void) |
1083 | { | 1083 | { |
1084 | struct slabinfo *s; | 1084 | struct slabinfo *s; |
1085 | struct aliasinfo *a; | 1085 | struct aliasinfo *a; |
@@ -1102,12 +1102,12 @@ void rename_slabs(void) | |||
1102 | } | 1102 | } |
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | int slab_mismatch(char *slab) | 1105 | static int slab_mismatch(char *slab) |
1106 | { | 1106 | { |
1107 | return regexec(&pattern, slab, 0, NULL, 0); | 1107 | return regexec(&pattern, slab, 0, NULL, 0); |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | void read_slab_dir(void) | 1110 | static void read_slab_dir(void) |
1111 | { | 1111 | { |
1112 | DIR *dir; | 1112 | DIR *dir; |
1113 | struct dirent *de; | 1113 | struct dirent *de; |
@@ -1209,7 +1209,7 @@ void read_slab_dir(void) | |||
1209 | fatal("Too many aliases\n"); | 1209 | fatal("Too many aliases\n"); |
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | void output_slabs(void) | 1212 | static void output_slabs(void) |
1213 | { | 1213 | { |
1214 | struct slabinfo *slab; | 1214 | struct slabinfo *slab; |
1215 | 1215 | ||
diff --git a/Documentation/watchdog/src/watchdog-test.c b/Documentation/watchdog/src/watchdog-test.c index 65f6c19cb865..a750532ffcf8 100644 --- a/Documentation/watchdog/src/watchdog-test.c +++ b/Documentation/watchdog/src/watchdog-test.c | |||
@@ -18,7 +18,7 @@ int fd; | |||
18 | * the PC Watchdog card to reset its internal timer so it doesn't trigger | 18 | * the PC Watchdog card to reset its internal timer so it doesn't trigger |
19 | * a computer reset. | 19 | * a computer reset. |
20 | */ | 20 | */ |
21 | void keep_alive(void) | 21 | static void keep_alive(void) |
22 | { | 22 | { |
23 | int dummy; | 23 | int dummy; |
24 | 24 | ||
diff --git a/Documentation/x86/earlyprintk.txt b/Documentation/x86/earlyprintk.txt index 607b1a016064..f19802c0f485 100644 --- a/Documentation/x86/earlyprintk.txt +++ b/Documentation/x86/earlyprintk.txt | |||
@@ -7,7 +7,7 @@ and two USB cables, connected like this: | |||
7 | 7 | ||
8 | [host/target] <-------> [USB debug key] <-------> [client/console] | 8 | [host/target] <-------> [USB debug key] <-------> [client/console] |
9 | 9 | ||
10 | 1. There are three specific hardware requirements: | 10 | 1. There are a number of specific hardware requirements: |
11 | 11 | ||
12 | a.) Host/target system needs to have USB debug port capability. | 12 | a.) Host/target system needs to have USB debug port capability. |
13 | 13 | ||
@@ -42,7 +42,35 @@ and two USB cables, connected like this: | |||
42 | This is a small blue plastic connector with two USB connections, | 42 | This is a small blue plastic connector with two USB connections, |
43 | it draws power from its USB connections. | 43 | it draws power from its USB connections. |
44 | 44 | ||
45 | c.) Thirdly, you need a second client/console system with a regular USB port. | 45 | c.) You need a second client/console system with a high speed USB 2.0 |
46 | port. | ||
47 | |||
48 | d.) The Netchip device must be plugged directly into the physical | ||
49 | debug port on the "host/target" system. You cannot use a USB hub in | ||
50 | between the physical debug port and the "host/target" system. | ||
51 | |||
52 | The EHCI debug controller is bound to a specific physical USB | ||
53 | port and the Netchip device will only work as an early printk | ||
54 | device in this port. The EHCI host controllers are electrically | ||
55 | wired such that the EHCI debug controller is hooked up to the | ||
56 | first physical and there is no way to change this via software. | ||
57 | You can find the physical port through experimentation by trying | ||
58 | each physical port on the system and rebooting. Or you can try | ||
59 | and use lsusb or look at the kernel info messages emitted by the | ||
60 | usb stack when you plug a usb device into various ports on the | ||
61 | "host/target" system. | ||
62 | |||
63 | Some hardware vendors do not expose the usb debug port with a | ||
64 | physical connector and if you find such a device send a complaint | ||
65 | to the hardware vendor, because there is no reason not to wire | ||
66 | this port into one of the physically accessible ports. | ||
67 | |||
68 | e.) It is also important to note, that many versions of the Netchip | ||
69 | device require the "client/console" system to be plugged into the | ||
70 | right and side of the device (with the product logo facing up and | ||
71 | readable left to right). The reason being is that the 5 volt | ||
72 | power supply is taken from only one side of the device and it | ||
73 | must be the side that does not get rebooted. | ||
46 | 74 | ||
47 | 2. Software requirements: | 75 | 2. Software requirements: |
48 | 76 | ||
@@ -56,6 +84,13 @@ and two USB cables, connected like this: | |||
56 | (If you are using Grub, append it to the 'kernel' line in | 84 | (If you are using Grub, append it to the 'kernel' line in |
57 | /etc/grub.conf) | 85 | /etc/grub.conf) |
58 | 86 | ||
87 | On systems with more than one EHCI debug controller you must | ||
88 | specify the correct EHCI debug controller number. The ordering | ||
89 | comes from the PCI bus enumeration of the EHCI controllers. The | ||
90 | default with no number argument is "0" the first EHCI debug | ||
91 | controller. To use the second EHCI debug controller, you would | ||
92 | use the command line: "earlyprintk=dbgp1" | ||
93 | |||
59 | NOTE: normally earlyprintk console gets turned off once the | 94 | NOTE: normally earlyprintk console gets turned off once the |
60 | regular console is alive - use "earlyprintk=dbgp,keep" to keep | 95 | regular console is alive - use "earlyprintk=dbgp,keep" to keep |
61 | this channel open beyond early bootup. This can be useful for | 96 | this channel open beyond early bootup. This can be useful for |