diff options
157 files changed, 2701 insertions, 656 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 b/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 new file mode 100644 index 000000000000..aa11dbdd794b --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 | |||
@@ -0,0 +1,56 @@ | |||
1 | What: /sys/class/backlight/<backlight>/<ambient light zone>_max | ||
2 | What: /sys/class/backlight/<backlight>/l1_daylight_max | ||
3 | What: /sys/class/backlight/<backlight>/l2_bright_max | ||
4 | What: /sys/class/backlight/<backlight>/l3_office_max | ||
5 | What: /sys/class/backlight/<backlight>/l4_indoor_max | ||
6 | What: /sys/class/backlight/<backlight>/l5_dark_max | ||
7 | Date: Mai 2011 | ||
8 | KernelVersion: 2.6.40 | ||
9 | Contact: device-drivers-devel@blackfin.uclinux.org | ||
10 | Description: | ||
11 | Control the maximum brightness for <ambient light zone> | ||
12 | on this <backlight>. Values are between 0 and 127. This file | ||
13 | will also show the brightness level stored for this | ||
14 | <ambient light zone>. | ||
15 | |||
16 | What: /sys/class/backlight/<backlight>/<ambient light zone>_dim | ||
17 | What: /sys/class/backlight/<backlight>/l2_bright_dim | ||
18 | What: /sys/class/backlight/<backlight>/l3_office_dim | ||
19 | What: /sys/class/backlight/<backlight>/l4_indoor_dim | ||
20 | What: /sys/class/backlight/<backlight>/l5_dark_dim | ||
21 | Date: Mai 2011 | ||
22 | KernelVersion: 2.6.40 | ||
23 | Contact: device-drivers-devel@blackfin.uclinux.org | ||
24 | Description: | ||
25 | Control the dim brightness for <ambient light zone> | ||
26 | on this <backlight>. Values are between 0 and 127, typically | ||
27 | set to 0. Full off when the backlight is disabled. | ||
28 | This file will also show the dim brightness level stored for | ||
29 | this <ambient light zone>. | ||
30 | |||
31 | What: /sys/class/backlight/<backlight>/ambient_light_level | ||
32 | Date: Mai 2011 | ||
33 | KernelVersion: 2.6.40 | ||
34 | Contact: device-drivers-devel@blackfin.uclinux.org | ||
35 | Description: | ||
36 | Get conversion value of the light sensor. | ||
37 | This value is updated every 80 ms (when the light sensor | ||
38 | is enabled). Returns integer between 0 (dark) and | ||
39 | 8000 (max ambient brightness) | ||
40 | |||
41 | What: /sys/class/backlight/<backlight>/ambient_light_zone | ||
42 | Date: Mai 2011 | ||
43 | KernelVersion: 2.6.40 | ||
44 | Contact: device-drivers-devel@blackfin.uclinux.org | ||
45 | Description: | ||
46 | Get/Set current ambient light zone. Reading returns | ||
47 | integer between 1..5 (1 = daylight, 2 = bright, ..., 5 = dark). | ||
48 | Writing a value between 1..5 forces the backlight controller | ||
49 | to enter the corresponding ambient light zone. | ||
50 | Writing 0 returns to normal/automatic ambient light level | ||
51 | operation. The ambient light sensing feature on these devices | ||
52 | is an extension to the API documented in | ||
53 | Documentation/ABI/stable/sysfs-class-backlight. | ||
54 | It can be enabled by writing the value stored in | ||
55 | /sys/class/backlight/<backlight>/max_brightness to | ||
56 | /sys/class/backlight/<backlight>/brightness. \ No newline at end of file | ||
diff --git a/Documentation/accounting/cgroupstats.txt b/Documentation/accounting/cgroupstats.txt index eda40fd39cad..d16a9849e60e 100644 --- a/Documentation/accounting/cgroupstats.txt +++ b/Documentation/accounting/cgroupstats.txt | |||
@@ -21,7 +21,7 @@ information will not be available. | |||
21 | To extract cgroup statistics a utility very similar to getdelays.c | 21 | To extract cgroup statistics a utility very similar to getdelays.c |
22 | has been developed, the sample output of the utility is shown below | 22 | has been developed, the sample output of the utility is shown below |
23 | 23 | ||
24 | ~/balbir/cgroupstats # ./getdelays -C "/cgroup/a" | 24 | ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a" |
25 | sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 | 25 | sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 |
26 | ~/balbir/cgroupstats # ./getdelays -C "/cgroup" | 26 | ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup" |
27 | sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2 | 27 | sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2 |
diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt index 465351d4cf85..cd45c8ea7463 100644 --- a/Documentation/cgroups/blkio-controller.txt +++ b/Documentation/cgroups/blkio-controller.txt | |||
@@ -28,16 +28,19 @@ cgroups. Here is what you can do. | |||
28 | - Enable group scheduling in CFQ | 28 | - Enable group scheduling in CFQ |
29 | CONFIG_CFQ_GROUP_IOSCHED=y | 29 | CONFIG_CFQ_GROUP_IOSCHED=y |
30 | 30 | ||
31 | - Compile and boot into kernel and mount IO controller (blkio). | 31 | - Compile and boot into kernel and mount IO controller (blkio); see |
32 | cgroups.txt, Why are cgroups needed?. | ||
32 | 33 | ||
33 | mount -t cgroup -o blkio none /cgroup | 34 | mount -t tmpfs cgroup_root /sys/fs/cgroup |
35 | mkdir /sys/fs/cgroup/blkio | ||
36 | mount -t cgroup -o blkio none /sys/fs/cgroup/blkio | ||
34 | 37 | ||
35 | - Create two cgroups | 38 | - Create two cgroups |
36 | mkdir -p /cgroup/test1/ /cgroup/test2 | 39 | mkdir -p /sys/fs/cgroup/blkio/test1/ /sys/fs/cgroup/blkio/test2 |
37 | 40 | ||
38 | - Set weights of group test1 and test2 | 41 | - Set weights of group test1 and test2 |
39 | echo 1000 > /cgroup/test1/blkio.weight | 42 | echo 1000 > /sys/fs/cgroup/blkio/test1/blkio.weight |
40 | echo 500 > /cgroup/test2/blkio.weight | 43 | echo 500 > /sys/fs/cgroup/blkio/test2/blkio.weight |
41 | 44 | ||
42 | - Create two same size files (say 512MB each) on same disk (file1, file2) and | 45 | - Create two same size files (say 512MB each) on same disk (file1, file2) and |
43 | launch two dd threads in different cgroup to read those files. | 46 | launch two dd threads in different cgroup to read those files. |
@@ -46,12 +49,12 @@ cgroups. Here is what you can do. | |||
46 | echo 3 > /proc/sys/vm/drop_caches | 49 | echo 3 > /proc/sys/vm/drop_caches |
47 | 50 | ||
48 | dd if=/mnt/sdb/zerofile1 of=/dev/null & | 51 | dd if=/mnt/sdb/zerofile1 of=/dev/null & |
49 | echo $! > /cgroup/test1/tasks | 52 | echo $! > /sys/fs/cgroup/blkio/test1/tasks |
50 | cat /cgroup/test1/tasks | 53 | cat /sys/fs/cgroup/blkio/test1/tasks |
51 | 54 | ||
52 | dd if=/mnt/sdb/zerofile2 of=/dev/null & | 55 | dd if=/mnt/sdb/zerofile2 of=/dev/null & |
53 | echo $! > /cgroup/test2/tasks | 56 | echo $! > /sys/fs/cgroup/blkio/test2/tasks |
54 | cat /cgroup/test2/tasks | 57 | cat /sys/fs/cgroup/blkio/test2/tasks |
55 | 58 | ||
56 | - At macro level, first dd should finish first. To get more precise data, keep | 59 | - At macro level, first dd should finish first. To get more precise data, keep |
57 | on looking at (with the help of script), at blkio.disk_time and | 60 | on looking at (with the help of script), at blkio.disk_time and |
@@ -68,13 +71,13 @@ Throttling/Upper Limit policy | |||
68 | - Enable throttling in block layer | 71 | - Enable throttling in block layer |
69 | CONFIG_BLK_DEV_THROTTLING=y | 72 | CONFIG_BLK_DEV_THROTTLING=y |
70 | 73 | ||
71 | - Mount blkio controller | 74 | - Mount blkio controller (see cgroups.txt, Why are cgroups needed?) |
72 | mount -t cgroup -o blkio none /cgroup/blkio | 75 | mount -t cgroup -o blkio none /sys/fs/cgroup/blkio |
73 | 76 | ||
74 | - Specify a bandwidth rate on particular device for root group. The format | 77 | - Specify a bandwidth rate on particular device for root group. The format |
75 | for policy is "<major>:<minor> <byes_per_second>". | 78 | for policy is "<major>:<minor> <byes_per_second>". |
76 | 79 | ||
77 | echo "8:16 1048576" > /cgroup/blkio/blkio.read_bps_device | 80 | echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.read_bps_device |
78 | 81 | ||
79 | Above will put a limit of 1MB/second on reads happening for root group | 82 | Above will put a limit of 1MB/second on reads happening for root group |
80 | on device having major/minor number 8:16. | 83 | on device having major/minor number 8:16. |
@@ -108,7 +111,7 @@ Hierarchical Cgroups | |||
108 | CFQ and throttling will practically treat all groups at same level. | 111 | CFQ and throttling will practically treat all groups at same level. |
109 | 112 | ||
110 | pivot | 113 | pivot |
111 | / | \ \ | 114 | / / \ \ |
112 | root test1 test2 test3 | 115 | root test1 test2 test3 |
113 | 116 | ||
114 | Down the line we can implement hierarchical accounting/control support | 117 | Down the line we can implement hierarchical accounting/control support |
@@ -149,7 +152,7 @@ Proportional weight policy files | |||
149 | 152 | ||
150 | Following is the format. | 153 | Following is the format. |
151 | 154 | ||
152 | #echo dev_maj:dev_minor weight > /path/to/cgroup/blkio.weight_device | 155 | # echo dev_maj:dev_minor weight > blkio.weight_device |
153 | Configure weight=300 on /dev/sdb (8:16) in this cgroup | 156 | Configure weight=300 on /dev/sdb (8:16) in this cgroup |
154 | # echo 8:16 300 > blkio.weight_device | 157 | # echo 8:16 300 > blkio.weight_device |
155 | # cat blkio.weight_device | 158 | # cat blkio.weight_device |
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index 0ed99f08f1f3..cd67e90003c0 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -138,11 +138,11 @@ With the ability to classify tasks differently for different resources | |||
138 | the admin can easily set up a script which receives exec notifications | 138 | the admin can easily set up a script which receives exec notifications |
139 | and depending on who is launching the browser he can | 139 | and depending on who is launching the browser he can |
140 | 140 | ||
141 | # echo browser_pid > /mnt/<restype>/<userclass>/tasks | 141 | # echo browser_pid > /sys/fs/cgroup/<restype>/<userclass>/tasks |
142 | 142 | ||
143 | With only a single hierarchy, he now would potentially have to create | 143 | With only a single hierarchy, he now would potentially have to create |
144 | a separate cgroup for every browser launched and associate it with | 144 | a separate cgroup for every browser launched and associate it with |
145 | approp network and other resource class. This may lead to | 145 | appropriate network and other resource class. This may lead to |
146 | proliferation of such cgroups. | 146 | proliferation of such cgroups. |
147 | 147 | ||
148 | Also lets say that the administrator would like to give enhanced network | 148 | Also lets say that the administrator would like to give enhanced network |
@@ -153,9 +153,9 @@ apps enhanced CPU power, | |||
153 | With ability to write pids directly to resource classes, it's just a | 153 | With ability to write pids directly to resource classes, it's just a |
154 | matter of : | 154 | matter of : |
155 | 155 | ||
156 | # echo pid > /mnt/network/<new_class>/tasks | 156 | # echo pid > /sys/fs/cgroup/network/<new_class>/tasks |
157 | (after some time) | 157 | (after some time) |
158 | # echo pid > /mnt/network/<orig_class>/tasks | 158 | # echo pid > /sys/fs/cgroup/network/<orig_class>/tasks |
159 | 159 | ||
160 | Without this ability, he would have to split the cgroup into | 160 | Without this ability, he would have to split the cgroup into |
161 | multiple separate ones and then associate the new cgroups with the | 161 | multiple separate ones and then associate the new cgroups with the |
@@ -310,21 +310,24 @@ subsystem, this is the case for the cpuset. | |||
310 | To start a new job that is to be contained within a cgroup, using | 310 | To start a new job that is to be contained within a cgroup, using |
311 | the "cpuset" cgroup subsystem, the steps are something like: | 311 | the "cpuset" cgroup subsystem, the steps are something like: |
312 | 312 | ||
313 | 1) mkdir /dev/cgroup | 313 | 1) mount -t tmpfs cgroup_root /sys/fs/cgroup |
314 | 2) mount -t cgroup -ocpuset cpuset /dev/cgroup | 314 | 2) mkdir /sys/fs/cgroup/cpuset |
315 | 3) Create the new cgroup by doing mkdir's and write's (or echo's) in | 315 | 3) mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset |
316 | the /dev/cgroup virtual file system. | 316 | 4) Create the new cgroup by doing mkdir's and write's (or echo's) in |
317 | 4) Start a task that will be the "founding father" of the new job. | 317 | the /sys/fs/cgroup virtual file system. |
318 | 5) Attach that task to the new cgroup by writing its pid to the | 318 | 5) Start a task that will be the "founding father" of the new job. |
319 | /dev/cgroup tasks file for that cgroup. | 319 | 6) Attach that task to the new cgroup by writing its pid to the |
320 | 6) fork, exec or clone the job tasks from this founding father task. | 320 | /sys/fs/cgroup/cpuset/tasks file for that cgroup. |
321 | 7) fork, exec or clone the job tasks from this founding father task. | ||
321 | 322 | ||
322 | For example, the following sequence of commands will setup a cgroup | 323 | For example, the following sequence of commands will setup a cgroup |
323 | named "Charlie", containing just CPUs 2 and 3, and Memory Node 1, | 324 | named "Charlie", containing just CPUs 2 and 3, and Memory Node 1, |
324 | and then start a subshell 'sh' in that cgroup: | 325 | and then start a subshell 'sh' in that cgroup: |
325 | 326 | ||
326 | mount -t cgroup cpuset -ocpuset /dev/cgroup | 327 | mount -t tmpfs cgroup_root /sys/fs/cgroup |
327 | cd /dev/cgroup | 328 | mkdir /sys/fs/cgroup/cpuset |
329 | mount -t cgroup cpuset -ocpuset /sys/fs/cgroup/cpuset | ||
330 | cd /sys/fs/cgroup/cpuset | ||
328 | mkdir Charlie | 331 | mkdir Charlie |
329 | cd Charlie | 332 | cd Charlie |
330 | /bin/echo 2-3 > cpuset.cpus | 333 | /bin/echo 2-3 > cpuset.cpus |
@@ -345,7 +348,7 @@ Creating, modifying, using the cgroups can be done through the cgroup | |||
345 | virtual filesystem. | 348 | virtual filesystem. |
346 | 349 | ||
347 | To mount a cgroup hierarchy with all available subsystems, type: | 350 | To mount a cgroup hierarchy with all available subsystems, type: |
348 | # mount -t cgroup xxx /dev/cgroup | 351 | # mount -t cgroup xxx /sys/fs/cgroup |
349 | 352 | ||
350 | The "xxx" is not interpreted by the cgroup code, but will appear in | 353 | The "xxx" is not interpreted by the cgroup code, but will appear in |
351 | /proc/mounts so may be any useful identifying string that you like. | 354 | /proc/mounts so may be any useful identifying string that you like. |
@@ -354,23 +357,32 @@ Note: Some subsystems do not work without some user input first. For instance, | |||
354 | if cpusets are enabled the user will have to populate the cpus and mems files | 357 | if cpusets are enabled the user will have to populate the cpus and mems files |
355 | for each new cgroup created before that group can be used. | 358 | for each new cgroup created before that group can be used. |
356 | 359 | ||
360 | As explained in section `1.2 Why are cgroups needed?' you should create | ||
361 | different hierarchies of cgroups for each single resource or group of | ||
362 | resources you want to control. Therefore, you should mount a tmpfs on | ||
363 | /sys/fs/cgroup and create directories for each cgroup resource or resource | ||
364 | group. | ||
365 | |||
366 | # mount -t tmpfs cgroup_root /sys/fs/cgroup | ||
367 | # mkdir /sys/fs/cgroup/rg1 | ||
368 | |||
357 | To mount a cgroup hierarchy with just the cpuset and memory | 369 | To mount a cgroup hierarchy with just the cpuset and memory |
358 | subsystems, type: | 370 | subsystems, type: |
359 | # mount -t cgroup -o cpuset,memory hier1 /dev/cgroup | 371 | # mount -t cgroup -o cpuset,memory hier1 /sys/fs/cgroup/rg1 |
360 | 372 | ||
361 | To change the set of subsystems bound to a mounted hierarchy, just | 373 | To change the set of subsystems bound to a mounted hierarchy, just |
362 | remount with different options: | 374 | remount with different options: |
363 | # mount -o remount,cpuset,blkio hier1 /dev/cgroup | 375 | # mount -o remount,cpuset,blkio hier1 /sys/fs/cgroup/rg1 |
364 | 376 | ||
365 | Now memory is removed from the hierarchy and blkio is added. | 377 | Now memory is removed from the hierarchy and blkio is added. |
366 | 378 | ||
367 | Note this will add blkio to the hierarchy but won't remove memory or | 379 | Note this will add blkio to the hierarchy but won't remove memory or |
368 | cpuset, because the new options are appended to the old ones: | 380 | cpuset, because the new options are appended to the old ones: |
369 | # mount -o remount,blkio /dev/cgroup | 381 | # mount -o remount,blkio /sys/fs/cgroup/rg1 |
370 | 382 | ||
371 | To Specify a hierarchy's release_agent: | 383 | To Specify a hierarchy's release_agent: |
372 | # mount -t cgroup -o cpuset,release_agent="/sbin/cpuset_release_agent" \ | 384 | # mount -t cgroup -o cpuset,release_agent="/sbin/cpuset_release_agent" \ |
373 | xxx /dev/cgroup | 385 | xxx /sys/fs/cgroup/rg1 |
374 | 386 | ||
375 | Note that specifying 'release_agent' more than once will return failure. | 387 | Note that specifying 'release_agent' more than once will return failure. |
376 | 388 | ||
@@ -379,17 +391,17 @@ when the hierarchy consists of a single (root) cgroup. Supporting | |||
379 | the ability to arbitrarily bind/unbind subsystems from an existing | 391 | the ability to arbitrarily bind/unbind subsystems from an existing |
380 | cgroup hierarchy is intended to be implemented in the future. | 392 | cgroup hierarchy is intended to be implemented in the future. |
381 | 393 | ||
382 | Then under /dev/cgroup you can find a tree that corresponds to the | 394 | Then under /sys/fs/cgroup/rg1 you can find a tree that corresponds to the |
383 | tree of the cgroups in the system. For instance, /dev/cgroup | 395 | tree of the cgroups in the system. For instance, /sys/fs/cgroup/rg1 |
384 | is the cgroup that holds the whole system. | 396 | is the cgroup that holds the whole system. |
385 | 397 | ||
386 | If you want to change the value of release_agent: | 398 | If you want to change the value of release_agent: |
387 | # echo "/sbin/new_release_agent" > /dev/cgroup/release_agent | 399 | # echo "/sbin/new_release_agent" > /sys/fs/cgroup/rg1/release_agent |
388 | 400 | ||
389 | It can also be changed via remount. | 401 | It can also be changed via remount. |
390 | 402 | ||
391 | If you want to create a new cgroup under /dev/cgroup: | 403 | If you want to create a new cgroup under /sys/fs/cgroup/rg1: |
392 | # cd /dev/cgroup | 404 | # cd /sys/fs/cgroup/rg1 |
393 | # mkdir my_cgroup | 405 | # mkdir my_cgroup |
394 | 406 | ||
395 | Now you want to do something with this cgroup. | 407 | Now you want to do something with this cgroup. |
diff --git a/Documentation/cgroups/cpuacct.txt b/Documentation/cgroups/cpuacct.txt index 8b930946c52a..9ad85df4b983 100644 --- a/Documentation/cgroups/cpuacct.txt +++ b/Documentation/cgroups/cpuacct.txt | |||
@@ -10,26 +10,25 @@ directly present in its group. | |||
10 | 10 | ||
11 | Accounting groups can be created by first mounting the cgroup filesystem. | 11 | Accounting groups can be created by first mounting the cgroup filesystem. |
12 | 12 | ||
13 | # mkdir /cgroups | 13 | # mount -t cgroup -ocpuacct none /sys/fs/cgroup |
14 | # mount -t cgroup -ocpuacct none /cgroups | 14 | |
15 | 15 | With the above step, the initial or the parent accounting group becomes | |
16 | With the above step, the initial or the parent accounting group | 16 | visible at /sys/fs/cgroup. At bootup, this group includes all the tasks in |
17 | becomes visible at /cgroups. At bootup, this group includes all the | 17 | the system. /sys/fs/cgroup/tasks lists the tasks in this cgroup. |
18 | tasks in the system. /cgroups/tasks lists the tasks in this cgroup. | 18 | /sys/fs/cgroup/cpuacct.usage gives the CPU time (in nanoseconds) obtained |
19 | /cgroups/cpuacct.usage gives the CPU time (in nanoseconds) obtained by | 19 | by this group which is essentially the CPU time obtained by all the tasks |
20 | this group which is essentially the CPU time obtained by all the tasks | ||
21 | in the system. | 20 | in the system. |
22 | 21 | ||
23 | New accounting groups can be created under the parent group /cgroups. | 22 | New accounting groups can be created under the parent group /sys/fs/cgroup. |
24 | 23 | ||
25 | # cd /cgroups | 24 | # cd /sys/fs/cgroup |
26 | # mkdir g1 | 25 | # mkdir g1 |
27 | # echo $$ > g1 | 26 | # echo $$ > g1 |
28 | 27 | ||
29 | The above steps create a new group g1 and move the current shell | 28 | The above steps create a new group g1 and move the current shell |
30 | process (bash) into it. CPU time consumed by this bash and its children | 29 | process (bash) into it. CPU time consumed by this bash and its children |
31 | can be obtained from g1/cpuacct.usage and the same is accumulated in | 30 | can be obtained from g1/cpuacct.usage and the same is accumulated in |
32 | /cgroups/cpuacct.usage also. | 31 | /sys/fs/cgroup/cpuacct.usage also. |
33 | 32 | ||
34 | cpuacct.stat file lists a few statistics which further divide the | 33 | cpuacct.stat file lists a few statistics which further divide the |
35 | CPU time obtained by the cgroup into user and system times. Currently | 34 | CPU time obtained by the cgroup into user and system times. Currently |
diff --git a/Documentation/cgroups/cpusets.txt b/Documentation/cgroups/cpusets.txt index 98a30829af7a..5b0d78e55ccc 100644 --- a/Documentation/cgroups/cpusets.txt +++ b/Documentation/cgroups/cpusets.txt | |||
@@ -661,21 +661,21 @@ than stress the kernel. | |||
661 | 661 | ||
662 | To start a new job that is to be contained within a cpuset, the steps are: | 662 | To start a new job that is to be contained within a cpuset, the steps are: |
663 | 663 | ||
664 | 1) mkdir /dev/cpuset | 664 | 1) mkdir /sys/fs/cgroup/cpuset |
665 | 2) mount -t cgroup -ocpuset cpuset /dev/cpuset | 665 | 2) mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset |
666 | 3) Create the new cpuset by doing mkdir's and write's (or echo's) in | 666 | 3) Create the new cpuset by doing mkdir's and write's (or echo's) in |
667 | the /dev/cpuset virtual file system. | 667 | the /sys/fs/cgroup/cpuset virtual file system. |
668 | 4) Start a task that will be the "founding father" of the new job. | 668 | 4) Start a task that will be the "founding father" of the new job. |
669 | 5) Attach that task to the new cpuset by writing its pid to the | 669 | 5) Attach that task to the new cpuset by writing its pid to the |
670 | /dev/cpuset tasks file for that cpuset. | 670 | /sys/fs/cgroup/cpuset tasks file for that cpuset. |
671 | 6) fork, exec or clone the job tasks from this founding father task. | 671 | 6) fork, exec or clone the job tasks from this founding father task. |
672 | 672 | ||
673 | For example, the following sequence of commands will setup a cpuset | 673 | For example, the following sequence of commands will setup a cpuset |
674 | named "Charlie", containing just CPUs 2 and 3, and Memory Node 1, | 674 | named "Charlie", containing just CPUs 2 and 3, and Memory Node 1, |
675 | and then start a subshell 'sh' in that cpuset: | 675 | and then start a subshell 'sh' in that cpuset: |
676 | 676 | ||
677 | mount -t cgroup -ocpuset cpuset /dev/cpuset | 677 | mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset |
678 | cd /dev/cpuset | 678 | cd /sys/fs/cgroup/cpuset |
679 | mkdir Charlie | 679 | mkdir Charlie |
680 | cd Charlie | 680 | cd Charlie |
681 | /bin/echo 2-3 > cpuset.cpus | 681 | /bin/echo 2-3 > cpuset.cpus |
@@ -710,14 +710,14 @@ Creating, modifying, using the cpusets can be done through the cpuset | |||
710 | virtual filesystem. | 710 | virtual filesystem. |
711 | 711 | ||
712 | To mount it, type: | 712 | To mount it, type: |
713 | # mount -t cgroup -o cpuset cpuset /dev/cpuset | 713 | # mount -t cgroup -o cpuset cpuset /sys/fs/cgroup/cpuset |
714 | 714 | ||
715 | Then under /dev/cpuset you can find a tree that corresponds to the | 715 | Then under /sys/fs/cgroup/cpuset you can find a tree that corresponds to the |
716 | tree of the cpusets in the system. For instance, /dev/cpuset | 716 | tree of the cpusets in the system. For instance, /sys/fs/cgroup/cpuset |
717 | is the cpuset that holds the whole system. | 717 | is the cpuset that holds the whole system. |
718 | 718 | ||
719 | If you want to create a new cpuset under /dev/cpuset: | 719 | If you want to create a new cpuset under /sys/fs/cgroup/cpuset: |
720 | # cd /dev/cpuset | 720 | # cd /sys/fs/cgroup/cpuset |
721 | # mkdir my_cpuset | 721 | # mkdir my_cpuset |
722 | 722 | ||
723 | Now you want to do something with this cpuset. | 723 | Now you want to do something with this cpuset. |
@@ -765,12 +765,12 @@ wrapper around the cgroup filesystem. | |||
765 | 765 | ||
766 | The command | 766 | The command |
767 | 767 | ||
768 | mount -t cpuset X /dev/cpuset | 768 | mount -t cpuset X /sys/fs/cgroup/cpuset |
769 | 769 | ||
770 | is equivalent to | 770 | is equivalent to |
771 | 771 | ||
772 | mount -t cgroup -ocpuset,noprefix X /dev/cpuset | 772 | mount -t cgroup -ocpuset,noprefix X /sys/fs/cgroup/cpuset |
773 | echo "/sbin/cpuset_release_agent" > /dev/cpuset/release_agent | 773 | echo "/sbin/cpuset_release_agent" > /sys/fs/cgroup/cpuset/release_agent |
774 | 774 | ||
775 | 2.2 Adding/removing cpus | 775 | 2.2 Adding/removing cpus |
776 | ------------------------ | 776 | ------------------------ |
diff --git a/Documentation/cgroups/devices.txt b/Documentation/cgroups/devices.txt index 57ca4c89fe5c..16624a7f8222 100644 --- a/Documentation/cgroups/devices.txt +++ b/Documentation/cgroups/devices.txt | |||
@@ -22,16 +22,16 @@ removed from the child(ren). | |||
22 | An entry is added using devices.allow, and removed using | 22 | An entry is added using devices.allow, and removed using |
23 | devices.deny. For instance | 23 | devices.deny. For instance |
24 | 24 | ||
25 | echo 'c 1:3 mr' > /cgroups/1/devices.allow | 25 | echo 'c 1:3 mr' > /sys/fs/cgroup/1/devices.allow |
26 | 26 | ||
27 | allows cgroup 1 to read and mknod the device usually known as | 27 | allows cgroup 1 to read and mknod the device usually known as |
28 | /dev/null. Doing | 28 | /dev/null. Doing |
29 | 29 | ||
30 | echo a > /cgroups/1/devices.deny | 30 | echo a > /sys/fs/cgroup/1/devices.deny |
31 | 31 | ||
32 | will remove the default 'a *:* rwm' entry. Doing | 32 | will remove the default 'a *:* rwm' entry. Doing |
33 | 33 | ||
34 | echo a > /cgroups/1/devices.allow | 34 | echo a > /sys/fs/cgroup/1/devices.allow |
35 | 35 | ||
36 | will add the 'a *:* rwm' entry to the whitelist. | 36 | will add the 'a *:* rwm' entry to the whitelist. |
37 | 37 | ||
diff --git a/Documentation/cgroups/freezer-subsystem.txt b/Documentation/cgroups/freezer-subsystem.txt index 41f37fea1276..c21d77742a07 100644 --- a/Documentation/cgroups/freezer-subsystem.txt +++ b/Documentation/cgroups/freezer-subsystem.txt | |||
@@ -59,28 +59,28 @@ is non-freezable. | |||
59 | 59 | ||
60 | * Examples of usage : | 60 | * Examples of usage : |
61 | 61 | ||
62 | # mkdir /containers | 62 | # mkdir /sys/fs/cgroup/freezer |
63 | # mount -t cgroup -ofreezer freezer /containers | 63 | # mount -t cgroup -ofreezer freezer /sys/fs/cgroup/freezer |
64 | # mkdir /containers/0 | 64 | # mkdir /sys/fs/cgroup/freezer/0 |
65 | # echo $some_pid > /containers/0/tasks | 65 | # echo $some_pid > /sys/fs/cgroup/freezer/0/tasks |
66 | 66 | ||
67 | to get status of the freezer subsystem : | 67 | to get status of the freezer subsystem : |
68 | 68 | ||
69 | # cat /containers/0/freezer.state | 69 | # cat /sys/fs/cgroup/freezer/0/freezer.state |
70 | THAWED | 70 | THAWED |
71 | 71 | ||
72 | to freeze all tasks in the container : | 72 | to freeze all tasks in the container : |
73 | 73 | ||
74 | # echo FROZEN > /containers/0/freezer.state | 74 | # echo FROZEN > /sys/fs/cgroup/freezer/0/freezer.state |
75 | # cat /containers/0/freezer.state | 75 | # cat /sys/fs/cgroup/freezer/0/freezer.state |
76 | FREEZING | 76 | FREEZING |
77 | # cat /containers/0/freezer.state | 77 | # cat /sys/fs/cgroup/freezer/0/freezer.state |
78 | FROZEN | 78 | FROZEN |
79 | 79 | ||
80 | to unfreeze all tasks in the container : | 80 | to unfreeze all tasks in the container : |
81 | 81 | ||
82 | # echo THAWED > /containers/0/freezer.state | 82 | # echo THAWED > /sys/fs/cgroup/freezer/0/freezer.state |
83 | # cat /containers/0/freezer.state | 83 | # cat /sys/fs/cgroup/freezer/0/freezer.state |
84 | THAWED | 84 | THAWED |
85 | 85 | ||
86 | This is the basic mechanism which should do the right thing for user space task | 86 | This is the basic mechanism which should do the right thing for user space task |
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 7c163477fcd8..06eb6d957c83 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -1,8 +1,8 @@ | |||
1 | Memory Resource Controller | 1 | Memory Resource Controller |
2 | 2 | ||
3 | NOTE: The Memory Resource Controller has been generically been referred | 3 | NOTE: The Memory Resource Controller has generically been referred to as the |
4 | to as the memory controller in this document. Do not confuse memory | 4 | memory controller in this document. Do not confuse memory controller |
5 | controller used here with the memory controller that is used in hardware. | 5 | used here with the memory controller that is used in hardware. |
6 | 6 | ||
7 | (For editors) | 7 | (For editors) |
8 | In this document: | 8 | In this document: |
@@ -70,6 +70,7 @@ Brief summary of control files. | |||
70 | (See sysctl's vm.swappiness) | 70 | (See sysctl's vm.swappiness) |
71 | memory.move_charge_at_immigrate # set/show controls of moving charges | 71 | memory.move_charge_at_immigrate # set/show controls of moving charges |
72 | memory.oom_control # set/show oom controls. | 72 | memory.oom_control # set/show oom controls. |
73 | memory.numa_stat # show the number of memory usage per numa node | ||
73 | 74 | ||
74 | 1. History | 75 | 1. History |
75 | 76 | ||
@@ -181,7 +182,7 @@ behind this approach is that a cgroup that aggressively uses a shared | |||
181 | page will eventually get charged for it (once it is uncharged from | 182 | page will eventually get charged for it (once it is uncharged from |
182 | the cgroup that brought it in -- this will happen on memory pressure). | 183 | the cgroup that brought it in -- this will happen on memory pressure). |
183 | 184 | ||
184 | Exception: If CONFIG_CGROUP_CGROUP_MEM_RES_CTLR_SWAP is not used.. | 185 | Exception: If CONFIG_CGROUP_CGROUP_MEM_RES_CTLR_SWAP is not used. |
185 | When you do swapoff and make swapped-out pages of shmem(tmpfs) to | 186 | When you do swapoff and make swapped-out pages of shmem(tmpfs) to |
186 | be backed into memory in force, charges for pages are accounted against the | 187 | be backed into memory in force, charges for pages are accounted against the |
187 | caller of swapoff rather than the users of shmem. | 188 | caller of swapoff rather than the users of shmem. |
@@ -213,7 +214,7 @@ affecting global LRU, memory+swap limit is better than just limiting swap from | |||
213 | OS point of view. | 214 | OS point of view. |
214 | 215 | ||
215 | * What happens when a cgroup hits memory.memsw.limit_in_bytes | 216 | * What happens when a cgroup hits memory.memsw.limit_in_bytes |
216 | When a cgroup his memory.memsw.limit_in_bytes, it's useless to do swap-out | 217 | When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out |
217 | in this cgroup. Then, swap-out will not be done by cgroup routine and file | 218 | in this cgroup. Then, swap-out will not be done by cgroup routine and file |
218 | caches are dropped. But as mentioned above, global LRU can do swapout memory | 219 | caches are dropped. But as mentioned above, global LRU can do swapout memory |
219 | from it for sanity of the system's memory management state. You can't forbid | 220 | from it for sanity of the system's memory management state. You can't forbid |
@@ -263,16 +264,17 @@ b. Enable CONFIG_RESOURCE_COUNTERS | |||
263 | c. Enable CONFIG_CGROUP_MEM_RES_CTLR | 264 | c. Enable CONFIG_CGROUP_MEM_RES_CTLR |
264 | d. Enable CONFIG_CGROUP_MEM_RES_CTLR_SWAP (to use swap extension) | 265 | d. Enable CONFIG_CGROUP_MEM_RES_CTLR_SWAP (to use swap extension) |
265 | 266 | ||
266 | 1. Prepare the cgroups | 267 | 1. Prepare the cgroups (see cgroups.txt, Why are cgroups needed?) |
267 | # mkdir -p /cgroups | 268 | # mount -t tmpfs none /sys/fs/cgroup |
268 | # mount -t cgroup none /cgroups -o memory | 269 | # mkdir /sys/fs/cgroup/memory |
270 | # mount -t cgroup none /sys/fs/cgroup/memory -o memory | ||
269 | 271 | ||
270 | 2. Make the new group and move bash into it | 272 | 2. Make the new group and move bash into it |
271 | # mkdir /cgroups/0 | 273 | # mkdir /sys/fs/cgroup/memory/0 |
272 | # echo $$ > /cgroups/0/tasks | 274 | # echo $$ > /sys/fs/cgroup/memory/0/tasks |
273 | 275 | ||
274 | Since now we're in the 0 cgroup, we can alter the memory limit: | 276 | Since now we're in the 0 cgroup, we can alter the memory limit: |
275 | # echo 4M > /cgroups/0/memory.limit_in_bytes | 277 | # echo 4M > /sys/fs/cgroup/memory/0/memory.limit_in_bytes |
276 | 278 | ||
277 | NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, | 279 | NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, |
278 | mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes, Gibibytes.) | 280 | mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes, Gibibytes.) |
@@ -280,11 +282,11 @@ mega or gigabytes. (Here, Kilo, Mega, Giga are Kibibytes, Mebibytes, Gibibytes.) | |||
280 | NOTE: We can write "-1" to reset the *.limit_in_bytes(unlimited). | 282 | NOTE: We can write "-1" to reset the *.limit_in_bytes(unlimited). |
281 | NOTE: We cannot set limits on the root cgroup any more. | 283 | NOTE: We cannot set limits on the root cgroup any more. |
282 | 284 | ||
283 | # cat /cgroups/0/memory.limit_in_bytes | 285 | # cat /sys/fs/cgroup/memory/0/memory.limit_in_bytes |
284 | 4194304 | 286 | 4194304 |
285 | 287 | ||
286 | We can check the usage: | 288 | We can check the usage: |
287 | # cat /cgroups/0/memory.usage_in_bytes | 289 | # cat /sys/fs/cgroup/memory/0/memory.usage_in_bytes |
288 | 1216512 | 290 | 1216512 |
289 | 291 | ||
290 | A successful write to this file does not guarantee a successful set of | 292 | A successful write to this file does not guarantee a successful set of |
@@ -464,6 +466,24 @@ value for efficient access. (Of course, when necessary, it's synchronized.) | |||
464 | If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) | 466 | If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) |
465 | value in memory.stat(see 5.2). | 467 | value in memory.stat(see 5.2). |
466 | 468 | ||
469 | 5.6 numa_stat | ||
470 | |||
471 | This is similar to numa_maps but operates on a per-memcg basis. This is | ||
472 | useful for providing visibility into the numa locality information within | ||
473 | an memcg since the pages are allowed to be allocated from any physical | ||
474 | node. One of the usecases is evaluating application performance by | ||
475 | combining this information with the application's cpu allocation. | ||
476 | |||
477 | We export "total", "file", "anon" and "unevictable" pages per-node for | ||
478 | each memcg. The ouput format of memory.numa_stat is: | ||
479 | |||
480 | total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ... | ||
481 | file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ... | ||
482 | anon=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ... | ||
483 | unevictable=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ... | ||
484 | |||
485 | And we have total = file + anon + unevictable. | ||
486 | |||
467 | 6. Hierarchy support | 487 | 6. Hierarchy support |
468 | 488 | ||
469 | The memory controller supports a deep hierarchy and hierarchical accounting. | 489 | The memory controller supports a deep hierarchy and hierarchical accounting. |
@@ -471,13 +491,13 @@ The hierarchy is created by creating the appropriate cgroups in the | |||
471 | cgroup filesystem. Consider for example, the following cgroup filesystem | 491 | cgroup filesystem. Consider for example, the following cgroup filesystem |
472 | hierarchy | 492 | hierarchy |
473 | 493 | ||
474 | root | 494 | root |
475 | / | \ | 495 | / | \ |
476 | / | \ | 496 | / | \ |
477 | a b c | 497 | a b c |
478 | | \ | 498 | | \ |
479 | | \ | 499 | | \ |
480 | d e | 500 | d e |
481 | 501 | ||
482 | In the diagram above, with hierarchical accounting enabled, all memory | 502 | In the diagram above, with hierarchical accounting enabled, all memory |
483 | usage of e, is accounted to its ancestors up until the root (i.e, c and root), | 503 | usage of e, is accounted to its ancestors up until the root (i.e, c and root), |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 1a9446b59153..72e238465b0b 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -481,23 +481,6 @@ Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | |||
481 | 481 | ||
482 | ---------------------------- | 482 | ---------------------------- |
483 | 483 | ||
484 | What: namespace cgroup (ns_cgroup) | ||
485 | When: 2.6.38 | ||
486 | Why: The ns_cgroup leads to some problems: | ||
487 | * cgroup creation is out-of-control | ||
488 | * cgroup name can conflict when pids are looping | ||
489 | * it is not possible to have a single process handling | ||
490 | a lot of namespaces without falling in a exponential creation time | ||
491 | * we may want to create a namespace without creating a cgroup | ||
492 | |||
493 | The ns_cgroup is replaced by a compatibility flag 'clone_children', | ||
494 | where a newly created cgroup will copy the parent cgroup values. | ||
495 | The userspace has to manually create a cgroup and add a task to | ||
496 | the 'tasks' file. | ||
497 | Who: Daniel Lezcano <daniel.lezcano@free.fr> | ||
498 | |||
499 | ---------------------------- | ||
500 | |||
501 | What: iwlwifi disable_hw_scan module parameters | 484 | What: iwlwifi disable_hw_scan module parameters |
502 | When: 2.6.40 | 485 | When: 2.6.40 |
503 | Why: Hareware scan is the prefer method for iwlwifi devices for | 486 | Why: Hareware scan is the prefer method for iwlwifi devices for |
diff --git a/Documentation/kmemleak.txt b/Documentation/kmemleak.txt index 090e6ee04536..51063e681ca4 100644 --- a/Documentation/kmemleak.txt +++ b/Documentation/kmemleak.txt | |||
@@ -11,7 +11,9 @@ with the difference that the orphan objects are not freed but only | |||
11 | reported via /sys/kernel/debug/kmemleak. A similar method is used by the | 11 | reported via /sys/kernel/debug/kmemleak. A similar method is used by the |
12 | Valgrind tool (memcheck --leak-check) to detect the memory leaks in | 12 | Valgrind tool (memcheck --leak-check) to detect the memory leaks in |
13 | user-space applications. | 13 | user-space applications. |
14 | Kmemleak is supported on x86, arm, powerpc, sparc, sh, microblaze and tile. | 14 | |
15 | Please check DEBUG_KMEMLEAK dependencies in lib/Kconfig.debug for supported | ||
16 | architectures. | ||
15 | 17 | ||
16 | Usage | 18 | Usage |
17 | ----- | 19 | ----- |
diff --git a/Documentation/md.txt b/Documentation/md.txt index 2366b1c8cf19..f0eee83ff78a 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt | |||
@@ -555,7 +555,7 @@ also have | |||
555 | sync_min | 555 | sync_min |
556 | sync_max | 556 | sync_max |
557 | The two values, given as numbers of sectors, indicate a range | 557 | The two values, given as numbers of sectors, indicate a range |
558 | withing the array where 'check'/'repair' will operate. Must be | 558 | within the array where 'check'/'repair' will operate. Must be |
559 | a multiple of chunk_size. When it reaches "sync_max" it will | 559 | a multiple of chunk_size. When it reaches "sync_max" it will |
560 | pause, rather than complete. | 560 | pause, rather than complete. |
561 | You can use 'select' or 'poll' on "sync_completed" to wait for | 561 | You can use 'select' or 'poll' on "sync_completed" to wait for |
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt index 1b5a5ddbc3ef..5df176ed59b8 100644 --- a/Documentation/printk-formats.txt +++ b/Documentation/printk-formats.txt | |||
@@ -9,7 +9,121 @@ If variable is of Type, use printk format specifier: | |||
9 | size_t %zu or %zx | 9 | size_t %zu or %zx |
10 | ssize_t %zd or %zx | 10 | ssize_t %zd or %zx |
11 | 11 | ||
12 | Raw pointer value SHOULD be printed with %p. | 12 | Raw pointer value SHOULD be printed with %p. The kernel supports |
13 | the following extended format specifiers for pointer types: | ||
14 | |||
15 | Symbols/Function Pointers: | ||
16 | |||
17 | %pF versatile_init+0x0/0x110 | ||
18 | %pf versatile_init | ||
19 | %pS versatile_init+0x0/0x110 | ||
20 | %ps versatile_init | ||
21 | %pB prev_fn_of_versatile_init+0x88/0x88 | ||
22 | |||
23 | For printing symbols and function pointers. The 'S' and 's' specifiers | ||
24 | result in the symbol name with ('S') or without ('s') offsets. Where | ||
25 | this is used on a kernel without KALLSYMS - the symbol address is | ||
26 | printed instead. | ||
27 | |||
28 | The 'B' specifier results in the symbol name with offsets and should be | ||
29 | used when printing stack backtraces. The specifier takes into | ||
30 | consideration the effect of compiler optimisations which may occur | ||
31 | when tail-call's are used and marked with the noreturn GCC attribute. | ||
32 | |||
33 | On ia64, ppc64 and parisc64 architectures function pointers are | ||
34 | actually function descriptors which must first be resolved. The 'F' and | ||
35 | 'f' specifiers perform this resolution and then provide the same | ||
36 | functionality as the 'S' and 's' specifiers. | ||
37 | |||
38 | Kernel Pointers: | ||
39 | |||
40 | %pK 0x01234567 or 0x0123456789abcdef | ||
41 | |||
42 | For printing kernel pointers which should be hidden from unprivileged | ||
43 | users. The behaviour of %pK depends on the kptr_restrict sysctl - see | ||
44 | Documentation/sysctl/kernel.txt for more details. | ||
45 | |||
46 | Struct Resources: | ||
47 | |||
48 | %pr [mem 0x60000000-0x6fffffff flags 0x2200] or | ||
49 | [mem 0x0000000060000000-0x000000006fffffff flags 0x2200] | ||
50 | %pR [mem 0x60000000-0x6fffffff pref] or | ||
51 | [mem 0x0000000060000000-0x000000006fffffff pref] | ||
52 | |||
53 | For printing struct resources. The 'R' and 'r' specifiers result in a | ||
54 | printed resource with ('R') or without ('r') a decoded flags member. | ||
55 | |||
56 | MAC/FDDI addresses: | ||
57 | |||
58 | %pM 00:01:02:03:04:05 | ||
59 | %pMF 00-01-02-03-04-05 | ||
60 | %pm 000102030405 | ||
61 | |||
62 | For printing 6-byte MAC/FDDI addresses in hex notation. The 'M' and 'm' | ||
63 | specifiers result in a printed address with ('M') or without ('m') byte | ||
64 | separators. The default byte separator is the colon (':'). | ||
65 | |||
66 | Where FDDI addresses are concerned the 'F' specifier can be used after | ||
67 | the 'M' specifier to use dash ('-') separators instead of the default | ||
68 | separator. | ||
69 | |||
70 | IPv4 addresses: | ||
71 | |||
72 | %pI4 1.2.3.4 | ||
73 | %pi4 001.002.003.004 | ||
74 | %p[Ii][hnbl] | ||
75 | |||
76 | For printing IPv4 dot-separated decimal addresses. The 'I4' and 'i4' | ||
77 | specifiers result in a printed address with ('i4') or without ('I4') | ||
78 | leading zeros. | ||
79 | |||
80 | The additional 'h', 'n', 'b', and 'l' specifiers are used to specify | ||
81 | host, network, big or little endian order addresses respectively. Where | ||
82 | no specifier is provided the default network/big endian order is used. | ||
83 | |||
84 | IPv6 addresses: | ||
85 | |||
86 | %pI6 0001:0002:0003:0004:0005:0006:0007:0008 | ||
87 | %pi6 00010002000300040005000600070008 | ||
88 | %pI6c 1:2:3:4:5:6:7:8 | ||
89 | |||
90 | For printing IPv6 network-order 16-bit hex addresses. The 'I6' and 'i6' | ||
91 | specifiers result in a printed address with ('I6') or without ('i6') | ||
92 | colon-separators. Leading zeros are always used. | ||
93 | |||
94 | The additional 'c' specifier can be used with the 'I' specifier to | ||
95 | print a compressed IPv6 address as described by | ||
96 | http://tools.ietf.org/html/rfc5952 | ||
97 | |||
98 | UUID/GUID addresses: | ||
99 | |||
100 | %pUb 00010203-0405-0607-0809-0a0b0c0d0e0f | ||
101 | %pUB 00010203-0405-0607-0809-0A0B0C0D0E0F | ||
102 | %pUl 03020100-0504-0706-0809-0a0b0c0e0e0f | ||
103 | %pUL 03020100-0504-0706-0809-0A0B0C0E0E0F | ||
104 | |||
105 | For printing 16-byte UUID/GUIDs addresses. The additional 'l', 'L', | ||
106 | 'b' and 'B' specifiers are used to specify a little endian order in | ||
107 | lower ('l') or upper case ('L') hex characters - and big endian order | ||
108 | in lower ('b') or upper case ('B') hex characters. | ||
109 | |||
110 | Where no additional specifiers are used the default little endian | ||
111 | order with lower case hex characters will be printed. | ||
112 | |||
113 | struct va_format: | ||
114 | |||
115 | %pV | ||
116 | |||
117 | For printing struct va_format structures. These contain a format string | ||
118 | and va_list as follows: | ||
119 | |||
120 | struct va_format { | ||
121 | const char *fmt; | ||
122 | va_list *va; | ||
123 | }; | ||
124 | |||
125 | Do not use this feature without some mechanism to verify the | ||
126 | correctness of the format string and va_list arguments. | ||
13 | 127 | ||
14 | u64 SHOULD be printed with %llu/%llx, (unsigned long long): | 128 | u64 SHOULD be printed with %llu/%llx, (unsigned long long): |
15 | 129 | ||
@@ -32,4 +146,5 @@ Reminder: sizeof() result is of type size_t. | |||
32 | Thank you for your cooperation and attention. | 146 | Thank you for your cooperation and attention. |
33 | 147 | ||
34 | 148 | ||
35 | By Randy Dunlap <rdunlap@xenotime.net> | 149 | By Randy Dunlap <rdunlap@xenotime.net> and |
150 | Andrew Murray <amurray@mpc-data.co.uk> | ||
diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt index 99961993257a..91ecff07cede 100644 --- a/Documentation/scheduler/sched-design-CFS.txt +++ b/Documentation/scheduler/sched-design-CFS.txt | |||
@@ -223,9 +223,10 @@ When CONFIG_FAIR_GROUP_SCHED is defined, a "cpu.shares" file is created for each | |||
223 | group created using the pseudo filesystem. See example steps below to create | 223 | group created using the pseudo filesystem. See example steps below to create |
224 | task groups and modify their CPU share using the "cgroups" pseudo filesystem. | 224 | task groups and modify their CPU share using the "cgroups" pseudo filesystem. |
225 | 225 | ||
226 | # mkdir /dev/cpuctl | 226 | # mount -t tmpfs cgroup_root /sys/fs/cgroup |
227 | # mount -t cgroup -ocpu none /dev/cpuctl | 227 | # mkdir /sys/fs/cgroup/cpu |
228 | # cd /dev/cpuctl | 228 | # mount -t cgroup -ocpu none /sys/fs/cgroup/cpu |
229 | # cd /sys/fs/cgroup/cpu | ||
229 | 230 | ||
230 | # mkdir multimedia # create "multimedia" group of tasks | 231 | # mkdir multimedia # create "multimedia" group of tasks |
231 | # mkdir browser # create "browser" group of tasks | 232 | # mkdir browser # create "browser" group of tasks |
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt index 605b0d40329d..71b54d549987 100644 --- a/Documentation/scheduler/sched-rt-group.txt +++ b/Documentation/scheduler/sched-rt-group.txt | |||
@@ -129,9 +129,8 @@ priority! | |||
129 | Enabling CONFIG_RT_GROUP_SCHED lets you explicitly allocate real | 129 | Enabling CONFIG_RT_GROUP_SCHED lets you explicitly allocate real |
130 | CPU bandwidth to task groups. | 130 | CPU bandwidth to task groups. |
131 | 131 | ||
132 | This uses the /cgroup virtual file system and | 132 | This uses the cgroup virtual file system and "<cgroup>/cpu.rt_runtime_us" |
133 | "/cgroup/<cgroup>/cpu.rt_runtime_us" to control the CPU time reserved for each | 133 | to control the CPU time reserved for each control group. |
134 | control group. | ||
135 | 134 | ||
136 | For more information on working with control groups, you should read | 135 | For more information on working with control groups, you should read |
137 | Documentation/cgroups/cgroups.txt as well. | 136 | Documentation/cgroups/cgroups.txt as well. |
@@ -150,7 +149,7 @@ For now, this can be simplified to just the following (but see Future plans): | |||
150 | =============== | 149 | =============== |
151 | 150 | ||
152 | There is work in progress to make the scheduling period for each group | 151 | There is work in progress to make the scheduling period for each group |
153 | ("/cgroup/<cgroup>/cpu.rt_period_us") configurable as well. | 152 | ("<cgroup>/cpu.rt_period_us") configurable as well. |
154 | 153 | ||
155 | The constraint on the period is that a subgroup must have a smaller or | 154 | The constraint on the period is that a subgroup must have a smaller or |
156 | equal period to its parent. But realistically its not very useful _yet_ | 155 | equal period to its parent. But realistically its not very useful _yet_ |
diff --git a/Documentation/vm/hwpoison.txt b/Documentation/vm/hwpoison.txt index 12f9ba20ccb7..550068466605 100644 --- a/Documentation/vm/hwpoison.txt +++ b/Documentation/vm/hwpoison.txt | |||
@@ -129,12 +129,12 @@ Limit injection to pages owned by memgroup. Specified by inode number | |||
129 | of the memcg. | 129 | of the memcg. |
130 | 130 | ||
131 | Example: | 131 | Example: |
132 | mkdir /cgroup/hwpoison | 132 | mkdir /sys/fs/cgroup/mem/hwpoison |
133 | 133 | ||
134 | usemem -m 100 -s 1000 & | 134 | usemem -m 100 -s 1000 & |
135 | echo `jobs -p` > /cgroup/hwpoison/tasks | 135 | echo `jobs -p` > /sys/fs/cgroup/mem/hwpoison/tasks |
136 | 136 | ||
137 | memcg_ino=$(ls -id /cgroup/hwpoison | cut -f1 -d' ') | 137 | memcg_ino=$(ls -id /sys/fs/cgroup/mem/hwpoison | cut -f1 -d' ') |
138 | echo $memcg_ino > /debug/hwpoison/corrupt-filter-memcg | 138 | echo $memcg_ino > /debug/hwpoison/corrupt-filter-memcg |
139 | 139 | ||
140 | page-types -p `pidof init` --hwpoison # shall do nothing | 140 | page-types -p `pidof init` --hwpoison # shall do nothing |
diff --git a/MAINTAINERS b/MAINTAINERS index e50fc6eb99e0..6c59eb90fdf4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1889,7 +1889,6 @@ L: cpufreq@vger.kernel.org | |||
1889 | W: http://www.codemonkey.org.uk/projects/cpufreq/ | 1889 | W: http://www.codemonkey.org.uk/projects/cpufreq/ |
1890 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git | 1890 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git |
1891 | S: Maintained | 1891 | S: Maintained |
1892 | F: arch/x86/kernel/cpu/cpufreq/ | ||
1893 | F: drivers/cpufreq/ | 1892 | F: drivers/cpufreq/ |
1894 | F: include/linux/cpufreq.h | 1893 | F: include/linux/cpufreq.h |
1895 | 1894 | ||
@@ -3820,6 +3819,12 @@ S: Maintained | |||
3820 | F: drivers/leds/ | 3819 | F: drivers/leds/ |
3821 | F: include/linux/leds.h | 3820 | F: include/linux/leds.h |
3822 | 3821 | ||
3822 | LEGACY EEPROM DRIVER | ||
3823 | M: Jean Delvare <khali@linux-fr.org> | ||
3824 | S: Maintained | ||
3825 | F: Documentation/misc-devices/eeprom | ||
3826 | F: drivers/misc/eeprom/eeprom.c | ||
3827 | |||
3823 | LEGO USB Tower driver | 3828 | LEGO USB Tower driver |
3824 | M: Juergen Stuber <starblue@users.sourceforge.net> | 3829 | M: Juergen Stuber <starblue@users.sourceforge.net> |
3825 | L: legousb-devel@lists.sourceforge.net | 3830 | L: legousb-devel@lists.sourceforge.net |
@@ -4145,7 +4150,7 @@ F: include/linux/mm.h | |||
4145 | F: mm/ | 4150 | F: mm/ |
4146 | 4151 | ||
4147 | MEMORY RESOURCE CONTROLLER | 4152 | MEMORY RESOURCE CONTROLLER |
4148 | M: Balbir Singh <balbir@linux.vnet.ibm.com> | 4153 | M: Balbir Singh <bsingharora@gmail.com> |
4149 | M: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> | 4154 | M: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> |
4150 | M: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 4155 | M: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> |
4151 | L: linux-mm@kvack.org | 4156 | L: linux-mm@kvack.org |
@@ -4890,7 +4895,7 @@ F: mm/percpu*.c | |||
4890 | F: arch/*/include/asm/percpu.h | 4895 | F: arch/*/include/asm/percpu.h |
4891 | 4896 | ||
4892 | PER-TASK DELAY ACCOUNTING | 4897 | PER-TASK DELAY ACCOUNTING |
4893 | M: Balbir Singh <balbir@linux.vnet.ibm.com> | 4898 | M: Balbir Singh <bsingharora@gmail.com> |
4894 | S: Maintained | 4899 | S: Maintained |
4895 | F: include/linux/delayacct.h | 4900 | F: include/linux/delayacct.h |
4896 | F: kernel/delayacct.c | 4901 | F: kernel/delayacct.c |
@@ -6098,7 +6103,7 @@ F: include/target/ | |||
6098 | F: Documentation/target/ | 6103 | F: Documentation/target/ |
6099 | 6104 | ||
6100 | TASKSTATS STATISTICS INTERFACE | 6105 | TASKSTATS STATISTICS INTERFACE |
6101 | M: Balbir Singh <balbir@linux.vnet.ibm.com> | 6106 | M: Balbir Singh <bsingharora@gmail.com> |
6102 | S: Maintained | 6107 | S: Maintained |
6103 | F: Documentation/accounting/taskstats* | 6108 | F: Documentation/accounting/taskstats* |
6104 | F: include/linux/taskstats* | 6109 | F: include/linux/taskstats* |
@@ -6717,6 +6722,14 @@ S: Maintained | |||
6717 | F: Documentation/filesystems/vfat.txt | 6722 | F: Documentation/filesystems/vfat.txt |
6718 | F: fs/fat/ | 6723 | F: fs/fat/ |
6719 | 6724 | ||
6725 | VIDEOBUF2 FRAMEWORK | ||
6726 | M: Pawel Osciak <pawel@osciak.com> | ||
6727 | M: Marek Szyprowski <m.szyprowski@samsung.com> | ||
6728 | L: linux-media@vger.kernel.org | ||
6729 | S: Maintained | ||
6730 | F: drivers/media/video/videobuf2-* | ||
6731 | F: include/media/videobuf2-* | ||
6732 | |||
6720 | VIRTIO CONSOLE DRIVER | 6733 | VIRTIO CONSOLE DRIVER |
6721 | M: Amit Shah <amit.shah@redhat.com> | 6734 | M: Amit Shah <amit.shah@redhat.com> |
6722 | L: virtualization@lists.linux-foundation.org | 6735 | L: virtualization@lists.linux-foundation.org |
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 376f22130791..326f0a2d56e5 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -409,7 +409,7 @@ SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen) | |||
409 | return -EFAULT; | 409 | return -EFAULT; |
410 | 410 | ||
411 | len = namelen; | 411 | len = namelen; |
412 | if (namelen > 32) | 412 | if (len > 32) |
413 | len = 32; | 413 | len = 32; |
414 | 414 | ||
415 | down_read(&uts_sem); | 415 | down_read(&uts_sem); |
@@ -594,7 +594,7 @@ SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count) | |||
594 | down_read(&uts_sem); | 594 | down_read(&uts_sem); |
595 | res = sysinfo_table[offset]; | 595 | res = sysinfo_table[offset]; |
596 | len = strlen(res)+1; | 596 | len = strlen(res)+1; |
597 | if (len > count) | 597 | if ((unsigned long)len > (unsigned long)count) |
598 | len = count; | 598 | len = count; |
599 | if (copy_to_user(buf, res, len)) | 599 | if (copy_to_user(buf, res, len)) |
600 | err = -EFAULT; | 600 | err = -EFAULT; |
@@ -649,7 +649,7 @@ SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer, | |||
649 | return 1; | 649 | return 1; |
650 | 650 | ||
651 | case GSI_GET_HWRPB: | 651 | case GSI_GET_HWRPB: |
652 | if (nbytes < sizeof(*hwrpb)) | 652 | if (nbytes > sizeof(*hwrpb)) |
653 | return -EINVAL; | 653 | return -EINVAL; |
654 | if (copy_to_user(buffer, hwrpb, nbytes) != 0) | 654 | if (copy_to_user(buffer, hwrpb, nbytes) != 0) |
655 | return -EFAULT; | 655 | return -EFAULT; |
@@ -1008,6 +1008,7 @@ SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options, | |||
1008 | { | 1008 | { |
1009 | struct rusage r; | 1009 | struct rusage r; |
1010 | long ret, err; | 1010 | long ret, err; |
1011 | unsigned int status = 0; | ||
1011 | mm_segment_t old_fs; | 1012 | mm_segment_t old_fs; |
1012 | 1013 | ||
1013 | if (!ur) | 1014 | if (!ur) |
@@ -1016,13 +1017,15 @@ SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options, | |||
1016 | old_fs = get_fs(); | 1017 | old_fs = get_fs(); |
1017 | 1018 | ||
1018 | set_fs (KERNEL_DS); | 1019 | set_fs (KERNEL_DS); |
1019 | ret = sys_wait4(pid, ustatus, options, (struct rusage __user *) &r); | 1020 | ret = sys_wait4(pid, (unsigned int __user *) &status, options, |
1021 | (struct rusage __user *) &r); | ||
1020 | set_fs (old_fs); | 1022 | set_fs (old_fs); |
1021 | 1023 | ||
1022 | if (!access_ok(VERIFY_WRITE, ur, sizeof(*ur))) | 1024 | if (!access_ok(VERIFY_WRITE, ur, sizeof(*ur))) |
1023 | return -EFAULT; | 1025 | return -EFAULT; |
1024 | 1026 | ||
1025 | err = 0; | 1027 | err = 0; |
1028 | err |= put_user(status, ustatus); | ||
1026 | err |= __put_user(r.ru_utime.tv_sec, &ur->ru_utime.tv_sec); | 1029 | err |= __put_user(r.ru_utime.tv_sec, &ur->ru_utime.tv_sec); |
1027 | err |= __put_user(r.ru_utime.tv_usec, &ur->ru_utime.tv_usec); | 1030 | err |= __put_user(r.ru_utime.tv_usec, &ur->ru_utime.tv_usec); |
1028 | err |= __put_user(r.ru_stime.tv_sec, &ur->ru_stime.tv_sec); | 1031 | err |= __put_user(r.ru_stime.tv_sec, &ur->ru_stime.tv_sec); |
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index f9da41921c52..942fad97e447 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
@@ -691,9 +691,9 @@ proc_types: | |||
691 | 691 | ||
692 | .word 0x41069260 @ ARM926EJ-S (v5TEJ) | 692 | .word 0x41069260 @ ARM926EJ-S (v5TEJ) |
693 | .word 0xff0ffff0 | 693 | .word 0xff0ffff0 |
694 | b __arm926ejs_mmu_cache_on | 694 | W(b) __arm926ejs_mmu_cache_on |
695 | b __armv4_mmu_cache_off | 695 | W(b) __armv4_mmu_cache_off |
696 | b __armv5tej_mmu_cache_flush | 696 | W(b) __armv5tej_mmu_cache_flush |
697 | 697 | ||
698 | .word 0x00007000 @ ARM7 IDs | 698 | .word 0x00007000 @ ARM7 IDs |
699 | .word 0x0000f000 | 699 | .word 0x0000f000 |
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig index 889922ad229c..67b5abb6f857 100644 --- a/arch/arm/configs/davinci_all_defconfig +++ b/arch/arm/configs/davinci_all_defconfig | |||
@@ -157,7 +157,7 @@ CONFIG_LEDS_GPIO=m | |||
157 | CONFIG_LEDS_TRIGGERS=y | 157 | CONFIG_LEDS_TRIGGERS=y |
158 | CONFIG_LEDS_TRIGGER_TIMER=m | 158 | CONFIG_LEDS_TRIGGER_TIMER=m |
159 | CONFIG_LEDS_TRIGGER_HEARTBEAT=m | 159 | CONFIG_LEDS_TRIGGER_HEARTBEAT=m |
160 | CONFIG_RTC_CLASS=m | 160 | CONFIG_RTC_CLASS=y |
161 | CONFIG_EXT2_FS=y | 161 | CONFIG_EXT2_FS=y |
162 | CONFIG_EXT3_FS=y | 162 | CONFIG_EXT3_FS=y |
163 | CONFIG_XFS_FS=m | 163 | CONFIG_XFS_FS=m |
diff --git a/arch/arm/configs/netx_defconfig b/arch/arm/configs/netx_defconfig index 316af5479d90..9c0ad7993986 100644 --- a/arch/arm/configs/netx_defconfig +++ b/arch/arm/configs/netx_defconfig | |||
@@ -60,7 +60,7 @@ CONFIG_FB_ARMCLCD=y | |||
60 | # CONFIG_VGA_CONSOLE is not set | 60 | # CONFIG_VGA_CONSOLE is not set |
61 | CONFIG_FRAMEBUFFER_CONSOLE=y | 61 | CONFIG_FRAMEBUFFER_CONSOLE=y |
62 | CONFIG_LOGO=y | 62 | CONFIG_LOGO=y |
63 | CONFIG_RTC_CLASS=m | 63 | CONFIG_RTC_CLASS=y |
64 | CONFIG_INOTIFY=y | 64 | CONFIG_INOTIFY=y |
65 | CONFIG_TMPFS=y | 65 | CONFIG_TMPFS=y |
66 | CONFIG_JFFS2_FS=y | 66 | CONFIG_JFFS2_FS=y |
diff --git a/arch/arm/configs/viper_defconfig b/arch/arm/configs/viper_defconfig index 8b0c717378fa..1d01ddd33122 100644 --- a/arch/arm/configs/viper_defconfig +++ b/arch/arm/configs/viper_defconfig | |||
@@ -142,7 +142,7 @@ CONFIG_USB_GADGETFS=m | |||
142 | CONFIG_USB_FILE_STORAGE=m | 142 | CONFIG_USB_FILE_STORAGE=m |
143 | CONFIG_USB_G_SERIAL=m | 143 | CONFIG_USB_G_SERIAL=m |
144 | CONFIG_USB_G_PRINTER=m | 144 | CONFIG_USB_G_PRINTER=m |
145 | CONFIG_RTC_CLASS=m | 145 | CONFIG_RTC_CLASS=y |
146 | CONFIG_RTC_DRV_DS1307=m | 146 | CONFIG_RTC_DRV_DS1307=m |
147 | CONFIG_RTC_DRV_SA1100=m | 147 | CONFIG_RTC_DRV_SA1100=m |
148 | CONFIG_EXT2_FS=m | 148 | CONFIG_EXT2_FS=m |
diff --git a/arch/arm/configs/xcep_defconfig b/arch/arm/configs/xcep_defconfig index 5b5504143647..721832ffe2d7 100644 --- a/arch/arm/configs/xcep_defconfig +++ b/arch/arm/configs/xcep_defconfig | |||
@@ -73,7 +73,7 @@ CONFIG_SENSORS_MAX6650=m | |||
73 | # CONFIG_VGA_CONSOLE is not set | 73 | # CONFIG_VGA_CONSOLE is not set |
74 | # CONFIG_HID_SUPPORT is not set | 74 | # CONFIG_HID_SUPPORT is not set |
75 | # CONFIG_USB_SUPPORT is not set | 75 | # CONFIG_USB_SUPPORT is not set |
76 | CONFIG_RTC_CLASS=m | 76 | CONFIG_RTC_CLASS=y |
77 | CONFIG_RTC_DRV_SA1100=m | 77 | CONFIG_RTC_DRV_SA1100=m |
78 | CONFIG_DMADEVICES=y | 78 | CONFIG_DMADEVICES=y |
79 | # CONFIG_DNOTIFY is not set | 79 | # CONFIG_DNOTIFY is not set |
diff --git a/arch/arm/configs/zeus_defconfig b/arch/arm/configs/zeus_defconfig index 960f65514d88..59577ad3f4ef 100644 --- a/arch/arm/configs/zeus_defconfig +++ b/arch/arm/configs/zeus_defconfig | |||
@@ -158,7 +158,7 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=m | |||
158 | CONFIG_LEDS_TRIGGER_BACKLIGHT=m | 158 | CONFIG_LEDS_TRIGGER_BACKLIGHT=m |
159 | CONFIG_LEDS_TRIGGER_GPIO=m | 159 | CONFIG_LEDS_TRIGGER_GPIO=m |
160 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=m | 160 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=m |
161 | CONFIG_RTC_CLASS=m | 161 | CONFIG_RTC_CLASS=y |
162 | CONFIG_RTC_DRV_ISL1208=m | 162 | CONFIG_RTC_DRV_ISL1208=m |
163 | CONFIG_RTC_DRV_PXA=m | 163 | CONFIG_RTC_DRV_PXA=m |
164 | CONFIG_EXT2_FS=y | 164 | CONFIG_EXT2_FS=y |
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index a701e4226a6c..0cdd7b456cb2 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c | |||
@@ -76,6 +76,9 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) | |||
76 | unsigned long dt_root; | 76 | unsigned long dt_root; |
77 | const char *model; | 77 | const char *model; |
78 | 78 | ||
79 | if (!dt_phys) | ||
80 | return NULL; | ||
81 | |||
79 | devtree = phys_to_virt(dt_phys); | 82 | devtree = phys_to_virt(dt_phys); |
80 | 83 | ||
81 | /* check device tree validity */ | 84 | /* check device tree validity */ |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index e8d885676807..90c62cd51ca9 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -435,6 +435,10 @@ __irq_usr: | |||
435 | usr_entry | 435 | usr_entry |
436 | kuser_cmpxchg_check | 436 | kuser_cmpxchg_check |
437 | 437 | ||
438 | #ifdef CONFIG_IRQSOFF_TRACER | ||
439 | bl trace_hardirqs_off | ||
440 | #endif | ||
441 | |||
438 | get_thread_info tsk | 442 | get_thread_info tsk |
439 | #ifdef CONFIG_PREEMPT | 443 | #ifdef CONFIG_PREEMPT |
440 | ldr r8, [tsk, #TI_PREEMPT] @ get preempt count | 444 | ldr r8, [tsk, #TI_PREEMPT] @ get preempt count |
@@ -453,7 +457,7 @@ __irq_usr: | |||
453 | #endif | 457 | #endif |
454 | 458 | ||
455 | mov why, #0 | 459 | mov why, #0 |
456 | b ret_to_user | 460 | b ret_to_user_from_irq |
457 | UNWIND(.fnend ) | 461 | UNWIND(.fnend ) |
458 | ENDPROC(__irq_usr) | 462 | ENDPROC(__irq_usr) |
459 | 463 | ||
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 1e7b04a40a31..b2a27b6b0046 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -64,6 +64,7 @@ work_resched: | |||
64 | ENTRY(ret_to_user) | 64 | ENTRY(ret_to_user) |
65 | ret_slow_syscall: | 65 | ret_slow_syscall: |
66 | disable_irq @ disable interrupts | 66 | disable_irq @ disable interrupts |
67 | ENTRY(ret_to_user_from_irq) | ||
67 | ldr r1, [tsk, #TI_FLAGS] | 68 | ldr r1, [tsk, #TI_FLAGS] |
68 | tst r1, #_TIF_WORK_MASK | 69 | tst r1, #_TIF_WORK_MASK |
69 | bne work_pending | 70 | bne work_pending |
@@ -75,6 +76,7 @@ no_work_pending: | |||
75 | arch_ret_to_user r1, lr | 76 | arch_ret_to_user r1, lr |
76 | 77 | ||
77 | restore_user_regs fast = 0, offset = 0 | 78 | restore_user_regs fast = 0, offset = 0 |
79 | ENDPROC(ret_to_user_from_irq) | ||
78 | ENDPROC(ret_to_user) | 80 | ENDPROC(ret_to_user) |
79 | 81 | ||
80 | /* | 82 | /* |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index d52eec268b47..6807cb1e76dd 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -139,7 +139,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs) | |||
139 | fs = get_fs(); | 139 | fs = get_fs(); |
140 | set_fs(KERNEL_DS); | 140 | set_fs(KERNEL_DS); |
141 | 141 | ||
142 | for (i = -4; i < 1; i++) { | 142 | for (i = -4; i < 1 + !!thumb; i++) { |
143 | unsigned int val, bad; | 143 | unsigned int val, bad; |
144 | 144 | ||
145 | if (thumb) | 145 | if (thumb) |
@@ -563,7 +563,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
563 | if (!pmd_present(*pmd)) | 563 | if (!pmd_present(*pmd)) |
564 | goto bad_access; | 564 | goto bad_access; |
565 | pte = pte_offset_map_lock(mm, pmd, addr, &ptl); | 565 | pte = pte_offset_map_lock(mm, pmd, addr, &ptl); |
566 | if (!pte_present(*pte) || !pte_dirty(*pte)) { | 566 | if (!pte_present(*pte) || !pte_write(*pte) || !pte_dirty(*pte)) { |
567 | pte_unmap_unlock(pte, ptl); | 567 | pte_unmap_unlock(pte, ptl); |
568 | goto bad_access; | 568 | goto bad_access; |
569 | } | 569 | } |
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 4e66881c7aee..fc4e98ea7543 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
@@ -494,7 +494,7 @@ static struct platform_device da850_mcasp_device = { | |||
494 | .resource = da850_mcasp_resources, | 494 | .resource = da850_mcasp_resources, |
495 | }; | 495 | }; |
496 | 496 | ||
497 | struct platform_device davinci_pcm_device = { | 497 | static struct platform_device davinci_pcm_device = { |
498 | .name = "davinci-pcm-audio", | 498 | .name = "davinci-pcm-audio", |
499 | .id = -1, | 499 | .id = -1, |
500 | }; | 500 | }; |
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c index 8f4f736aa267..806a2f02b980 100644 --- a/arch/arm/mach-davinci/devices.c +++ b/arch/arm/mach-davinci/devices.c | |||
@@ -298,7 +298,7 @@ static void davinci_init_wdt(void) | |||
298 | 298 | ||
299 | /*-------------------------------------------------------------------------*/ | 299 | /*-------------------------------------------------------------------------*/ |
300 | 300 | ||
301 | struct platform_device davinci_pcm_device = { | 301 | static struct platform_device davinci_pcm_device = { |
302 | .name = "davinci-pcm-audio", | 302 | .name = "davinci-pcm-audio", |
303 | .id = -1, | 303 | .id = -1, |
304 | }; | 304 | }; |
diff --git a/arch/arm/mach-davinci/gpio.c b/arch/arm/mach-davinci/gpio.c index a0b838894ac9..e7221398e5af 100644 --- a/arch/arm/mach-davinci/gpio.c +++ b/arch/arm/mach-davinci/gpio.c | |||
@@ -252,9 +252,11 @@ static struct irq_chip gpio_irqchip = { | |||
252 | static void | 252 | static void |
253 | gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 253 | gpio_irq_handler(unsigned irq, struct irq_desc *desc) |
254 | { | 254 | { |
255 | struct davinci_gpio_regs __iomem *g = irq2regs(irq); | 255 | struct davinci_gpio_regs __iomem *g; |
256 | u32 mask = 0xffff; | 256 | u32 mask = 0xffff; |
257 | 257 | ||
258 | g = (__force struct davinci_gpio_regs __iomem *) irq_desc_get_handler_data(desc); | ||
259 | |||
258 | /* we only care about one bank */ | 260 | /* we only care about one bank */ |
259 | if (irq & 1) | 261 | if (irq & 1) |
260 | mask <<= 16; | 262 | mask <<= 16; |
@@ -422,8 +424,7 @@ static int __init davinci_gpio_irq_setup(void) | |||
422 | 424 | ||
423 | /* set up all irqs in this bank */ | 425 | /* set up all irqs in this bank */ |
424 | irq_set_chained_handler(bank_irq, gpio_irq_handler); | 426 | irq_set_chained_handler(bank_irq, gpio_irq_handler); |
425 | irq_set_chip_data(bank_irq, (__force void *)g); | 427 | irq_set_handler_data(bank_irq, (__force void *)g); |
426 | irq_set_handler_data(bank_irq, (void *)irq); | ||
427 | 428 | ||
428 | for (i = 0; i < 16 && gpio < ngpio; i++, irq++, gpio++) { | 429 | for (i = 0; i < 16 && gpio < ngpio; i++, irq++, gpio++) { |
429 | irq_set_chip(irq, &gpio_irqchip); | 430 | irq_set_chip(irq, &gpio_irqchip); |
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c index 5f1f9867fc70..121ad1d4fa39 100644 --- a/arch/arm/mach-footbridge/dc21285-timer.c +++ b/arch/arm/mach-footbridge/dc21285-timer.c | |||
@@ -103,6 +103,7 @@ static void __init footbridge_timer_init(void) | |||
103 | clockevents_calc_mult_shift(ce, mem_fclk_21285, 5); | 103 | clockevents_calc_mult_shift(ce, mem_fclk_21285, 5); |
104 | ce->max_delta_ns = clockevent_delta2ns(0xffffff, ce); | 104 | ce->max_delta_ns = clockevent_delta2ns(0xffffff, ce); |
105 | ce->min_delta_ns = clockevent_delta2ns(0x000004, ce); | 105 | ce->min_delta_ns = clockevent_delta2ns(0x000004, ce); |
106 | ce->cpumask = cpumask_of(smp_processor_id()); | ||
106 | 107 | ||
107 | clockevents_register_device(ce); | 108 | clockevents_register_device(ce); |
108 | } | 109 | } |
diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S index 30b971d65815..1be2eeb7a0a0 100644 --- a/arch/arm/mach-footbridge/include/mach/debug-macro.S +++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <asm/hardware/debug-8250.S> | 26 | #include <asm/hardware/debug-8250.S> |
27 | 27 | ||
28 | #else | 28 | #else |
29 | #include <mach/hardware.h> | ||
29 | /* For EBSA285 debugging */ | 30 | /* For EBSA285 debugging */ |
30 | .equ dc21285_high, ARMCSR_BASE & 0xff000000 | 31 | .equ dc21285_high, ARMCSR_BASE & 0xff000000 |
31 | .equ dc21285_low, ARMCSR_BASE & 0x00ffffff | 32 | .equ dc21285_low, ARMCSR_BASE & 0x00ffffff |
@@ -36,8 +37,8 @@ | |||
36 | .else | 37 | .else |
37 | mov \rp, #0 | 38 | mov \rp, #0 |
38 | .endif | 39 | .endif |
39 | orr \rv, \rp, #0x42000000 | 40 | orr \rv, \rp, #dc21285_high |
40 | orr \rp, \rp, #dc21285_high | 41 | orr \rp, \rp, #0x42000000 |
41 | .endm | 42 | .endm |
42 | 43 | ||
43 | .macro senduart,rd,rx | 44 | .macro senduart,rd,rx |
diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c index 65157a35dbba..54add60f94c9 100644 --- a/arch/arm/mach-mxs/ocotp.c +++ b/arch/arm/mach-mxs/ocotp.c | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | 18 | ||
19 | #include <asm/processor.h> /* for cpu_relax() */ | ||
20 | |||
19 | #include <mach/mxs.h> | 21 | #include <mach/mxs.h> |
20 | 22 | ||
21 | #define OCOTP_WORD_OFFSET 0x20 | 23 | #define OCOTP_WORD_OFFSET 0x20 |
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c index c95258c274c1..1e2aba23e0d6 100644 --- a/arch/arm/mach-shmobile/board-ag5evm.c +++ b/arch/arm/mach-shmobile/board-ag5evm.c | |||
@@ -382,10 +382,8 @@ void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state) | |||
382 | } | 382 | } |
383 | 383 | ||
384 | static struct sh_mobile_sdhi_info sh_sdhi1_platdata = { | 384 | static struct sh_mobile_sdhi_info sh_sdhi1_platdata = { |
385 | .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, | ||
386 | .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, | ||
387 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE, | 385 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE, |
388 | .tmio_caps = MMC_CAP_NONREMOVABLE, | 386 | .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ, |
389 | .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 387 | .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
390 | .set_pwr = ag5evm_sdhi1_set_pwr, | 388 | .set_pwr = ag5evm_sdhi1_set_pwr, |
391 | }; | 389 | }; |
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 776f20560e72..7e1d37584321 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -126,7 +126,7 @@ | |||
126 | * ------+--------------------+--------------------+------- | 126 | * ------+--------------------+--------------------+------- |
127 | * IRQ0 | ICR1A.IRQ0SA=0010 | SDHI2 card detect | Low | 127 | * IRQ0 | ICR1A.IRQ0SA=0010 | SDHI2 card detect | Low |
128 | * IRQ6 | ICR1A.IRQ6SA=0011 | Ether(LAN9220) | High | 128 | * IRQ6 | ICR1A.IRQ6SA=0011 | Ether(LAN9220) | High |
129 | * IRQ7 | ICR1A.IRQ7SA=0010 | LCD Tuch Panel | Low | 129 | * IRQ7 | ICR1A.IRQ7SA=0010 | LCD Touch Panel | Low |
130 | * IRQ8 | ICR2A.IRQ8SA=0010 | MMC/SD card detect | Low | 130 | * IRQ8 | ICR2A.IRQ8SA=0010 | MMC/SD card detect | Low |
131 | * IRQ9 | ICR2A.IRQ9SA=0010 | KEY(TCA6408) | Low | 131 | * IRQ9 | ICR2A.IRQ9SA=0010 | KEY(TCA6408) | Low |
132 | * IRQ21 | ICR4A.IRQ21SA=0011 | Sensor(ADXL345) | High | 132 | * IRQ21 | ICR4A.IRQ21SA=0011 | Sensor(ADXL345) | High |
@@ -165,10 +165,10 @@ | |||
165 | * USB1 can become Host by r8a66597, and become Function by renesas_usbhs. | 165 | * USB1 can become Host by r8a66597, and become Function by renesas_usbhs. |
166 | * But don't select both drivers in same time. | 166 | * But don't select both drivers in same time. |
167 | * These uses same IRQ number for request_irq(), and aren't supporting | 167 | * These uses same IRQ number for request_irq(), and aren't supporting |
168 | * IRQF_SHARD / IORESOURCE_IRQ_SHAREABLE. | 168 | * IRQF_SHARED / IORESOURCE_IRQ_SHAREABLE. |
169 | * | 169 | * |
170 | * Actually these are old/new version of USB driver. | 170 | * Actually these are old/new version of USB driver. |
171 | * This mean its register will be broken if it supports SHARD IRQ, | 171 | * This mean its register will be broken if it supports shared IRQ, |
172 | */ | 172 | */ |
173 | 173 | ||
174 | /* | 174 | /* |
@@ -562,7 +562,121 @@ out: | |||
562 | clk_put(hdmi_ick); | 562 | clk_put(hdmi_ick); |
563 | } | 563 | } |
564 | 564 | ||
565 | /* USB1 (Host) */ | 565 | /* USBHS0 is connected to CN22 which takes a USB Mini-B plug |
566 | * | ||
567 | * The sh7372 SoC has IRQ7 set aside for USBHS0 hotplug, | ||
568 | * but on this particular board IRQ7 is already used by | ||
569 | * the touch screen. This leaves us with software polling. | ||
570 | */ | ||
571 | #define USBHS0_POLL_INTERVAL (HZ * 5) | ||
572 | |||
573 | struct usbhs_private { | ||
574 | unsigned int usbphyaddr; | ||
575 | unsigned int usbcrcaddr; | ||
576 | struct renesas_usbhs_platform_info info; | ||
577 | struct delayed_work work; | ||
578 | struct platform_device *pdev; | ||
579 | }; | ||
580 | |||
581 | #define usbhs_get_priv(pdev) \ | ||
582 | container_of(renesas_usbhs_get_info(pdev), \ | ||
583 | struct usbhs_private, info) | ||
584 | |||
585 | #define usbhs_is_connected(priv) \ | ||
586 | (!((1 << 7) & __raw_readw(priv->usbcrcaddr))) | ||
587 | |||
588 | static int usbhs_get_vbus(struct platform_device *pdev) | ||
589 | { | ||
590 | return usbhs_is_connected(usbhs_get_priv(pdev)); | ||
591 | } | ||
592 | |||
593 | static void usbhs_phy_reset(struct platform_device *pdev) | ||
594 | { | ||
595 | struct usbhs_private *priv = usbhs_get_priv(pdev); | ||
596 | |||
597 | /* init phy */ | ||
598 | __raw_writew(0x8a0a, priv->usbcrcaddr); | ||
599 | } | ||
600 | |||
601 | static int usbhs0_get_id(struct platform_device *pdev) | ||
602 | { | ||
603 | return USBHS_GADGET; | ||
604 | } | ||
605 | |||
606 | static void usbhs0_work_function(struct work_struct *work) | ||
607 | { | ||
608 | struct usbhs_private *priv = container_of(work, struct usbhs_private, | ||
609 | work.work); | ||
610 | |||
611 | renesas_usbhs_call_notify_hotplug(priv->pdev); | ||
612 | schedule_delayed_work(&priv->work, USBHS0_POLL_INTERVAL); | ||
613 | } | ||
614 | |||
615 | static int usbhs0_hardware_init(struct platform_device *pdev) | ||
616 | { | ||
617 | struct usbhs_private *priv = usbhs_get_priv(pdev); | ||
618 | |||
619 | priv->pdev = pdev; | ||
620 | INIT_DELAYED_WORK(&priv->work, usbhs0_work_function); | ||
621 | schedule_delayed_work(&priv->work, USBHS0_POLL_INTERVAL); | ||
622 | return 0; | ||
623 | } | ||
624 | |||
625 | static void usbhs0_hardware_exit(struct platform_device *pdev) | ||
626 | { | ||
627 | struct usbhs_private *priv = usbhs_get_priv(pdev); | ||
628 | |||
629 | cancel_delayed_work_sync(&priv->work); | ||
630 | } | ||
631 | |||
632 | static struct usbhs_private usbhs0_private = { | ||
633 | .usbcrcaddr = 0xe605810c, /* USBCR2 */ | ||
634 | .info = { | ||
635 | .platform_callback = { | ||
636 | .hardware_init = usbhs0_hardware_init, | ||
637 | .hardware_exit = usbhs0_hardware_exit, | ||
638 | .phy_reset = usbhs_phy_reset, | ||
639 | .get_id = usbhs0_get_id, | ||
640 | .get_vbus = usbhs_get_vbus, | ||
641 | }, | ||
642 | .driver_param = { | ||
643 | .buswait_bwait = 4, | ||
644 | }, | ||
645 | }, | ||
646 | }; | ||
647 | |||
648 | static struct resource usbhs0_resources[] = { | ||
649 | [0] = { | ||
650 | .name = "USBHS0", | ||
651 | .start = 0xe6890000, | ||
652 | .end = 0xe68900e6 - 1, | ||
653 | .flags = IORESOURCE_MEM, | ||
654 | }, | ||
655 | [1] = { | ||
656 | .start = evt2irq(0x1ca0) /* USB0_USB0I0 */, | ||
657 | .flags = IORESOURCE_IRQ, | ||
658 | }, | ||
659 | }; | ||
660 | |||
661 | static struct platform_device usbhs0_device = { | ||
662 | .name = "renesas_usbhs", | ||
663 | .id = 0, | ||
664 | .dev = { | ||
665 | .platform_data = &usbhs0_private.info, | ||
666 | }, | ||
667 | .num_resources = ARRAY_SIZE(usbhs0_resources), | ||
668 | .resource = usbhs0_resources, | ||
669 | }; | ||
670 | |||
671 | /* USBHS1 is connected to CN31 which takes a USB Mini-AB plug | ||
672 | * | ||
673 | * Use J30 to select between Host and Function. This setting | ||
674 | * can however not be detected by software. Hotplug of USBHS1 | ||
675 | * is provided via IRQ8. | ||
676 | */ | ||
677 | #define IRQ8 evt2irq(0x0300) | ||
678 | |||
679 | /* USBHS1 USB Host support via r8a66597_hcd */ | ||
566 | static void usb1_host_port_power(int port, int power) | 680 | static void usb1_host_port_power(int port, int power) |
567 | { | 681 | { |
568 | if (!power) /* only power-on is supported for now */ | 682 | if (!power) /* only power-on is supported for now */ |
@@ -579,9 +693,9 @@ static struct r8a66597_platdata usb1_host_data = { | |||
579 | 693 | ||
580 | static struct resource usb1_host_resources[] = { | 694 | static struct resource usb1_host_resources[] = { |
581 | [0] = { | 695 | [0] = { |
582 | .name = "USBHS", | 696 | .name = "USBHS1", |
583 | .start = 0xE68B0000, | 697 | .start = 0xe68b0000, |
584 | .end = 0xE68B00E6 - 1, | 698 | .end = 0xe68b00e6 - 1, |
585 | .flags = IORESOURCE_MEM, | 699 | .flags = IORESOURCE_MEM, |
586 | }, | 700 | }, |
587 | [1] = { | 701 | [1] = { |
@@ -602,37 +716,14 @@ static struct platform_device usb1_host_device = { | |||
602 | .resource = usb1_host_resources, | 716 | .resource = usb1_host_resources, |
603 | }; | 717 | }; |
604 | 718 | ||
605 | /* USB1 (Function) */ | 719 | /* USBHS1 USB Function support via renesas_usbhs */ |
720 | |||
606 | #define USB_PHY_MODE (1 << 4) | 721 | #define USB_PHY_MODE (1 << 4) |
607 | #define USB_PHY_INT_EN ((1 << 3) | (1 << 2)) | 722 | #define USB_PHY_INT_EN ((1 << 3) | (1 << 2)) |
608 | #define USB_PHY_ON (1 << 1) | 723 | #define USB_PHY_ON (1 << 1) |
609 | #define USB_PHY_OFF (1 << 0) | 724 | #define USB_PHY_OFF (1 << 0) |
610 | #define USB_PHY_INT_CLR (USB_PHY_ON | USB_PHY_OFF) | 725 | #define USB_PHY_INT_CLR (USB_PHY_ON | USB_PHY_OFF) |
611 | 726 | ||
612 | struct usbhs_private { | ||
613 | unsigned int irq; | ||
614 | unsigned int usbphyaddr; | ||
615 | unsigned int usbcrcaddr; | ||
616 | struct renesas_usbhs_platform_info info; | ||
617 | }; | ||
618 | |||
619 | #define usbhs_get_priv(pdev) \ | ||
620 | container_of(renesas_usbhs_get_info(pdev), \ | ||
621 | struct usbhs_private, info) | ||
622 | |||
623 | #define usbhs_is_connected(priv) \ | ||
624 | (!((1 << 7) & __raw_readw(priv->usbcrcaddr))) | ||
625 | |||
626 | static int usbhs1_get_id(struct platform_device *pdev) | ||
627 | { | ||
628 | return USBHS_GADGET; | ||
629 | } | ||
630 | |||
631 | static int usbhs1_get_vbus(struct platform_device *pdev) | ||
632 | { | ||
633 | return usbhs_is_connected(usbhs_get_priv(pdev)); | ||
634 | } | ||
635 | |||
636 | static irqreturn_t usbhs1_interrupt(int irq, void *data) | 727 | static irqreturn_t usbhs1_interrupt(int irq, void *data) |
637 | { | 728 | { |
638 | struct platform_device *pdev = data; | 729 | struct platform_device *pdev = data; |
@@ -654,12 +745,10 @@ static int usbhs1_hardware_init(struct platform_device *pdev) | |||
654 | struct usbhs_private *priv = usbhs_get_priv(pdev); | 745 | struct usbhs_private *priv = usbhs_get_priv(pdev); |
655 | int ret; | 746 | int ret; |
656 | 747 | ||
657 | irq_set_irq_type(priv->irq, IRQ_TYPE_LEVEL_HIGH); | ||
658 | |||
659 | /* clear interrupt status */ | 748 | /* clear interrupt status */ |
660 | __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr); | 749 | __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr); |
661 | 750 | ||
662 | ret = request_irq(priv->irq, usbhs1_interrupt, 0, | 751 | ret = request_irq(IRQ8, usbhs1_interrupt, IRQF_TRIGGER_HIGH, |
663 | dev_name(&pdev->dev), pdev); | 752 | dev_name(&pdev->dev), pdev); |
664 | if (ret) { | 753 | if (ret) { |
665 | dev_err(&pdev->dev, "request_irq err\n"); | 754 | dev_err(&pdev->dev, "request_irq err\n"); |
@@ -679,15 +768,12 @@ static void usbhs1_hardware_exit(struct platform_device *pdev) | |||
679 | /* clear interrupt status */ | 768 | /* clear interrupt status */ |
680 | __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr); | 769 | __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->usbphyaddr); |
681 | 770 | ||
682 | free_irq(priv->irq, pdev); | 771 | free_irq(IRQ8, pdev); |
683 | } | 772 | } |
684 | 773 | ||
685 | static void usbhs1_phy_reset(struct platform_device *pdev) | 774 | static int usbhs1_get_id(struct platform_device *pdev) |
686 | { | 775 | { |
687 | struct usbhs_private *priv = usbhs_get_priv(pdev); | 776 | return USBHS_GADGET; |
688 | |||
689 | /* init phy */ | ||
690 | __raw_writew(0x8a0a, priv->usbcrcaddr); | ||
691 | } | 777 | } |
692 | 778 | ||
693 | static u32 usbhs1_pipe_cfg[] = { | 779 | static u32 usbhs1_pipe_cfg[] = { |
@@ -710,16 +796,15 @@ static u32 usbhs1_pipe_cfg[] = { | |||
710 | }; | 796 | }; |
711 | 797 | ||
712 | static struct usbhs_private usbhs1_private = { | 798 | static struct usbhs_private usbhs1_private = { |
713 | .irq = evt2irq(0x0300), /* IRQ8 */ | 799 | .usbphyaddr = 0xe60581e2, /* USBPHY1INTAP */ |
714 | .usbphyaddr = 0xE60581E2, /* USBPHY1INTAP */ | 800 | .usbcrcaddr = 0xe6058130, /* USBCR4 */ |
715 | .usbcrcaddr = 0xE6058130, /* USBCR4 */ | ||
716 | .info = { | 801 | .info = { |
717 | .platform_callback = { | 802 | .platform_callback = { |
718 | .hardware_init = usbhs1_hardware_init, | 803 | .hardware_init = usbhs1_hardware_init, |
719 | .hardware_exit = usbhs1_hardware_exit, | 804 | .hardware_exit = usbhs1_hardware_exit, |
720 | .phy_reset = usbhs1_phy_reset, | ||
721 | .get_id = usbhs1_get_id, | 805 | .get_id = usbhs1_get_id, |
722 | .get_vbus = usbhs1_get_vbus, | 806 | .phy_reset = usbhs_phy_reset, |
807 | .get_vbus = usbhs_get_vbus, | ||
723 | }, | 808 | }, |
724 | .driver_param = { | 809 | .driver_param = { |
725 | .buswait_bwait = 4, | 810 | .buswait_bwait = 4, |
@@ -731,9 +816,9 @@ static struct usbhs_private usbhs1_private = { | |||
731 | 816 | ||
732 | static struct resource usbhs1_resources[] = { | 817 | static struct resource usbhs1_resources[] = { |
733 | [0] = { | 818 | [0] = { |
734 | .name = "USBHS", | 819 | .name = "USBHS1", |
735 | .start = 0xE68B0000, | 820 | .start = 0xe68b0000, |
736 | .end = 0xE68B00E6 - 1, | 821 | .end = 0xe68b00e6 - 1, |
737 | .flags = IORESOURCE_MEM, | 822 | .flags = IORESOURCE_MEM, |
738 | }, | 823 | }, |
739 | [1] = { | 824 | [1] = { |
@@ -752,7 +837,6 @@ static struct platform_device usbhs1_device = { | |||
752 | .resource = usbhs1_resources, | 837 | .resource = usbhs1_resources, |
753 | }; | 838 | }; |
754 | 839 | ||
755 | |||
756 | /* LED */ | 840 | /* LED */ |
757 | static struct gpio_led mackerel_leds[] = { | 841 | static struct gpio_led mackerel_leds[] = { |
758 | { | 842 | { |
@@ -1203,6 +1287,7 @@ static struct platform_device *mackerel_devices[] __initdata = { | |||
1203 | &nor_flash_device, | 1287 | &nor_flash_device, |
1204 | &smc911x_device, | 1288 | &smc911x_device, |
1205 | &lcdc_device, | 1289 | &lcdc_device, |
1290 | &usbhs0_device, | ||
1206 | &usb1_host_device, | 1291 | &usb1_host_device, |
1207 | &usbhs1_device, | 1292 | &usbhs1_device, |
1208 | &leds_device, | 1293 | &leds_device, |
@@ -1301,6 +1386,7 @@ static void __init mackerel_map_io(void) | |||
1301 | 1386 | ||
1302 | #define GPIO_PORT9CR 0xE6051009 | 1387 | #define GPIO_PORT9CR 0xE6051009 |
1303 | #define GPIO_PORT10CR 0xE605100A | 1388 | #define GPIO_PORT10CR 0xE605100A |
1389 | #define GPIO_PORT167CR 0xE60520A7 | ||
1304 | #define GPIO_PORT168CR 0xE60520A8 | 1390 | #define GPIO_PORT168CR 0xE60520A8 |
1305 | #define SRCR4 0xe61580bc | 1391 | #define SRCR4 0xe61580bc |
1306 | #define USCCR1 0xE6058144 | 1392 | #define USCCR1 0xE6058144 |
@@ -1354,17 +1440,17 @@ static void __init mackerel_init(void) | |||
1354 | gpio_request(GPIO_PORT151, NULL); /* LCDDON */ | 1440 | gpio_request(GPIO_PORT151, NULL); /* LCDDON */ |
1355 | gpio_direction_output(GPIO_PORT151, 1); | 1441 | gpio_direction_output(GPIO_PORT151, 1); |
1356 | 1442 | ||
1357 | /* USB enable */ | 1443 | /* USBHS0 */ |
1358 | gpio_request(GPIO_FN_VBUS0_1, NULL); | 1444 | gpio_request(GPIO_FN_VBUS0_0, NULL); |
1359 | gpio_request(GPIO_FN_IDIN_1_18, NULL); | 1445 | gpio_pull_down(GPIO_PORT168CR); /* VBUS0_0 pull down */ |
1360 | gpio_request(GPIO_FN_PWEN_1_115, NULL); | 1446 | |
1361 | gpio_request(GPIO_FN_OVCN_1_114, NULL); | 1447 | /* USBHS1 */ |
1362 | gpio_request(GPIO_FN_EXTLP_1, NULL); | 1448 | gpio_request(GPIO_FN_VBUS0_1, NULL); |
1363 | gpio_request(GPIO_FN_OVCN2_1, NULL); | 1449 | gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */ |
1364 | gpio_pull_down(GPIO_PORT168CR); | 1450 | gpio_request(GPIO_FN_IDIN_1_113, NULL); |
1365 | 1451 | ||
1366 | /* setup USB phy */ | 1452 | /* USB phy tweak to make the r8a66597_hcd host driver work */ |
1367 | __raw_writew(0x8a0a, 0xE6058130); /* USBCR4 */ | 1453 | __raw_writew(0x8a0a, 0xe6058130); /* USBCR4 */ |
1368 | 1454 | ||
1369 | /* enable FSI2 port A (ak4643) */ | 1455 | /* enable FSI2 port A (ak4643) */ |
1370 | gpio_request(GPIO_FN_FSIAIBT, NULL); | 1456 | gpio_request(GPIO_FN_FSIAIBT, NULL); |
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c index 5d0e1503ece6..a911a60e7719 100644 --- a/arch/arm/mach-shmobile/intc-sh73a0.c +++ b/arch/arm/mach-shmobile/intc-sh73a0.c | |||
@@ -250,6 +250,11 @@ static irqreturn_t sh73a0_intcs_demux(int irq, void *dev_id) | |||
250 | return IRQ_HANDLED; | 250 | return IRQ_HANDLED; |
251 | } | 251 | } |
252 | 252 | ||
253 | static int sh73a0_set_wake(struct irq_data *data, unsigned int on) | ||
254 | { | ||
255 | return 0; /* always allow wakeup */ | ||
256 | } | ||
257 | |||
253 | void __init sh73a0_init_irq(void) | 258 | void __init sh73a0_init_irq(void) |
254 | { | 259 | { |
255 | void __iomem *gic_dist_base = __io(0xf0001000); | 260 | void __iomem *gic_dist_base = __io(0xf0001000); |
@@ -257,6 +262,7 @@ void __init sh73a0_init_irq(void) | |||
257 | void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE); | 262 | void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE); |
258 | 263 | ||
259 | gic_init(0, 29, gic_dist_base, gic_cpu_base); | 264 | gic_init(0, 29, gic_dist_base, gic_cpu_base); |
265 | gic_arch_extn.irq_set_wake = sh73a0_set_wake; | ||
260 | 266 | ||
261 | register_intc_controller(&intcs_desc); | 267 | register_intc_controller(&intcs_desc); |
262 | 268 | ||
diff --git a/arch/arm/mach-shmobile/setup-sh7367.c b/arch/arm/mach-shmobile/setup-sh7367.c index 2c10190dbb55..e546017f15de 100644 --- a/arch/arm/mach-shmobile/setup-sh7367.c +++ b/arch/arm/mach-shmobile/setup-sh7367.c | |||
@@ -38,7 +38,7 @@ static struct plat_sci_port scif0_platform_data = { | |||
38 | .flags = UPF_BOOT_AUTOCONF, | 38 | .flags = UPF_BOOT_AUTOCONF, |
39 | .scscr = SCSCR_RE | SCSCR_TE, | 39 | .scscr = SCSCR_RE | SCSCR_TE, |
40 | .scbrr_algo_id = SCBRR_ALGO_4, | 40 | .scbrr_algo_id = SCBRR_ALGO_4, |
41 | .type = PORT_SCIF, | 41 | .type = PORT_SCIFA, |
42 | .irqs = { evt2irq(0xc00), evt2irq(0xc00), | 42 | .irqs = { evt2irq(0xc00), evt2irq(0xc00), |
43 | evt2irq(0xc00), evt2irq(0xc00) }, | 43 | evt2irq(0xc00), evt2irq(0xc00) }, |
44 | }; | 44 | }; |
@@ -57,7 +57,7 @@ static struct plat_sci_port scif1_platform_data = { | |||
57 | .flags = UPF_BOOT_AUTOCONF, | 57 | .flags = UPF_BOOT_AUTOCONF, |
58 | .scscr = SCSCR_RE | SCSCR_TE, | 58 | .scscr = SCSCR_RE | SCSCR_TE, |
59 | .scbrr_algo_id = SCBRR_ALGO_4, | 59 | .scbrr_algo_id = SCBRR_ALGO_4, |
60 | .type = PORT_SCIF, | 60 | .type = PORT_SCIFA, |
61 | .irqs = { evt2irq(0xc20), evt2irq(0xc20), | 61 | .irqs = { evt2irq(0xc20), evt2irq(0xc20), |
62 | evt2irq(0xc20), evt2irq(0xc20) }, | 62 | evt2irq(0xc20), evt2irq(0xc20) }, |
63 | }; | 63 | }; |
@@ -76,7 +76,7 @@ static struct plat_sci_port scif2_platform_data = { | |||
76 | .flags = UPF_BOOT_AUTOCONF, | 76 | .flags = UPF_BOOT_AUTOCONF, |
77 | .scscr = SCSCR_RE | SCSCR_TE, | 77 | .scscr = SCSCR_RE | SCSCR_TE, |
78 | .scbrr_algo_id = SCBRR_ALGO_4, | 78 | .scbrr_algo_id = SCBRR_ALGO_4, |
79 | .type = PORT_SCIF, | 79 | .type = PORT_SCIFA, |
80 | .irqs = { evt2irq(0xc40), evt2irq(0xc40), | 80 | .irqs = { evt2irq(0xc40), evt2irq(0xc40), |
81 | evt2irq(0xc40), evt2irq(0xc40) }, | 81 | evt2irq(0xc40), evt2irq(0xc40) }, |
82 | }; | 82 | }; |
@@ -95,7 +95,7 @@ static struct plat_sci_port scif3_platform_data = { | |||
95 | .flags = UPF_BOOT_AUTOCONF, | 95 | .flags = UPF_BOOT_AUTOCONF, |
96 | .scscr = SCSCR_RE | SCSCR_TE, | 96 | .scscr = SCSCR_RE | SCSCR_TE, |
97 | .scbrr_algo_id = SCBRR_ALGO_4, | 97 | .scbrr_algo_id = SCBRR_ALGO_4, |
98 | .type = PORT_SCIF, | 98 | .type = PORT_SCIFA, |
99 | .irqs = { evt2irq(0xc60), evt2irq(0xc60), | 99 | .irqs = { evt2irq(0xc60), evt2irq(0xc60), |
100 | evt2irq(0xc60), evt2irq(0xc60) }, | 100 | evt2irq(0xc60), evt2irq(0xc60) }, |
101 | }; | 101 | }; |
@@ -114,7 +114,7 @@ static struct plat_sci_port scif4_platform_data = { | |||
114 | .flags = UPF_BOOT_AUTOCONF, | 114 | .flags = UPF_BOOT_AUTOCONF, |
115 | .scscr = SCSCR_RE | SCSCR_TE, | 115 | .scscr = SCSCR_RE | SCSCR_TE, |
116 | .scbrr_algo_id = SCBRR_ALGO_4, | 116 | .scbrr_algo_id = SCBRR_ALGO_4, |
117 | .type = PORT_SCIF, | 117 | .type = PORT_SCIFA, |
118 | .irqs = { evt2irq(0xd20), evt2irq(0xd20), | 118 | .irqs = { evt2irq(0xd20), evt2irq(0xd20), |
119 | evt2irq(0xd20), evt2irq(0xd20) }, | 119 | evt2irq(0xd20), evt2irq(0xd20) }, |
120 | }; | 120 | }; |
@@ -133,7 +133,7 @@ static struct plat_sci_port scif5_platform_data = { | |||
133 | .flags = UPF_BOOT_AUTOCONF, | 133 | .flags = UPF_BOOT_AUTOCONF, |
134 | .scscr = SCSCR_RE | SCSCR_TE, | 134 | .scscr = SCSCR_RE | SCSCR_TE, |
135 | .scbrr_algo_id = SCBRR_ALGO_4, | 135 | .scbrr_algo_id = SCBRR_ALGO_4, |
136 | .type = PORT_SCIF, | 136 | .type = PORT_SCIFA, |
137 | .irqs = { evt2irq(0xd40), evt2irq(0xd40), | 137 | .irqs = { evt2irq(0xd40), evt2irq(0xd40), |
138 | evt2irq(0xd40), evt2irq(0xd40) }, | 138 | evt2irq(0xd40), evt2irq(0xd40) }, |
139 | }; | 139 | }; |
@@ -152,7 +152,7 @@ static struct plat_sci_port scif6_platform_data = { | |||
152 | .flags = UPF_BOOT_AUTOCONF, | 152 | .flags = UPF_BOOT_AUTOCONF, |
153 | .scscr = SCSCR_RE | SCSCR_TE, | 153 | .scscr = SCSCR_RE | SCSCR_TE, |
154 | .scbrr_algo_id = SCBRR_ALGO_4, | 154 | .scbrr_algo_id = SCBRR_ALGO_4, |
155 | .type = PORT_SCIF, | 155 | .type = PORT_SCIFB, |
156 | .irqs = { evt2irq(0xd60), evt2irq(0xd60), | 156 | .irqs = { evt2irq(0xd60), evt2irq(0xd60), |
157 | evt2irq(0xd60), evt2irq(0xd60) }, | 157 | evt2irq(0xd60), evt2irq(0xd60) }, |
158 | }; | 158 | }; |
diff --git a/arch/arm/mach-u300/clock.h b/arch/arm/mach-u300/clock.h index c34f3ea3017c..4f50ca8f901e 100644 --- a/arch/arm/mach-u300/clock.h +++ b/arch/arm/mach-u300/clock.h | |||
@@ -31,7 +31,7 @@ struct clk { | |||
31 | bool reset; | 31 | bool reset; |
32 | __u16 clk_val; | 32 | __u16 clk_val; |
33 | __s8 usecount; | 33 | __s8 usecount; |
34 | __u32 res_reg; | 34 | void __iomem * res_reg; |
35 | __u16 res_mask; | 35 | __u16 res_mask; |
36 | 36 | ||
37 | bool hw_ctrld; | 37 | bool hw_ctrld; |
diff --git a/arch/arm/mach-u300/include/mach/u300-regs.h b/arch/arm/mach-u300/include/mach/u300-regs.h index 8b85df4c8d8f..035fdc9dbdb0 100644 --- a/arch/arm/mach-u300/include/mach/u300-regs.h +++ b/arch/arm/mach-u300/include/mach/u300-regs.h | |||
@@ -18,6 +18,12 @@ | |||
18 | * the defines are used for setting up the I/O memory mapping. | 18 | * the defines are used for setting up the I/O memory mapping. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifdef __ASSEMBLER__ | ||
22 | #define IOMEM(a) (a) | ||
23 | #else | ||
24 | #define IOMEM(a) (void __iomem *) a | ||
25 | #endif | ||
26 | |||
21 | /* NAND Flash CS0 */ | 27 | /* NAND Flash CS0 */ |
22 | #define U300_NAND_CS0_PHYS_BASE 0x80000000 | 28 | #define U300_NAND_CS0_PHYS_BASE 0x80000000 |
23 | 29 | ||
@@ -48,13 +54,6 @@ | |||
48 | #endif | 54 | #endif |
49 | 55 | ||
50 | /* | 56 | /* |
51 | * All the following peripherals are specified at their PHYSICAL address, | ||
52 | * so if you need to access them (in the kernel), you MUST use the macros | ||
53 | * defined in <asm/io.h> to map to the IO_ADDRESS_AHB() IO_ADDRESS_FAST() | ||
54 | * etc. | ||
55 | */ | ||
56 | |||
57 | /* | ||
58 | * AHB peripherals | 57 | * AHB peripherals |
59 | */ | 58 | */ |
60 | 59 | ||
@@ -63,11 +62,11 @@ | |||
63 | 62 | ||
64 | /* Vectored Interrupt Controller 0, servicing 32 interrupts */ | 63 | /* Vectored Interrupt Controller 0, servicing 32 interrupts */ |
65 | #define U300_INTCON0_BASE (U300_AHB_PER_PHYS_BASE+0x1000) | 64 | #define U300_INTCON0_BASE (U300_AHB_PER_PHYS_BASE+0x1000) |
66 | #define U300_INTCON0_VBASE (U300_AHB_PER_VIRT_BASE+0x1000) | 65 | #define U300_INTCON0_VBASE IOMEM(U300_AHB_PER_VIRT_BASE+0x1000) |
67 | 66 | ||
68 | /* Vectored Interrupt Controller 1, servicing 32 interrupts */ | 67 | /* Vectored Interrupt Controller 1, servicing 32 interrupts */ |
69 | #define U300_INTCON1_BASE (U300_AHB_PER_PHYS_BASE+0x2000) | 68 | #define U300_INTCON1_BASE (U300_AHB_PER_PHYS_BASE+0x2000) |
70 | #define U300_INTCON1_VBASE (U300_AHB_PER_VIRT_BASE+0x2000) | 69 | #define U300_INTCON1_VBASE IOMEM(U300_AHB_PER_VIRT_BASE+0x2000) |
71 | 70 | ||
72 | /* Memory Stick Pro (MSPRO) controller */ | 71 | /* Memory Stick Pro (MSPRO) controller */ |
73 | #define U300_MSPRO_BASE (U300_AHB_PER_PHYS_BASE+0x3000) | 72 | #define U300_MSPRO_BASE (U300_AHB_PER_PHYS_BASE+0x3000) |
@@ -115,7 +114,7 @@ | |||
115 | 114 | ||
116 | /* SYSCON */ | 115 | /* SYSCON */ |
117 | #define U300_SYSCON_BASE (U300_SLOW_PER_PHYS_BASE+0x1000) | 116 | #define U300_SYSCON_BASE (U300_SLOW_PER_PHYS_BASE+0x1000) |
118 | #define U300_SYSCON_VBASE (U300_SLOW_PER_VIRT_BASE+0x1000) | 117 | #define U300_SYSCON_VBASE IOMEM(U300_SLOW_PER_VIRT_BASE+0x1000) |
119 | 118 | ||
120 | /* Watchdog */ | 119 | /* Watchdog */ |
121 | #define U300_WDOG_BASE (U300_SLOW_PER_PHYS_BASE+0x2000) | 120 | #define U300_WDOG_BASE (U300_SLOW_PER_PHYS_BASE+0x2000) |
@@ -125,7 +124,7 @@ | |||
125 | 124 | ||
126 | /* APP side special timer */ | 125 | /* APP side special timer */ |
127 | #define U300_TIMER_APP_BASE (U300_SLOW_PER_PHYS_BASE+0x4000) | 126 | #define U300_TIMER_APP_BASE (U300_SLOW_PER_PHYS_BASE+0x4000) |
128 | #define U300_TIMER_APP_VBASE (U300_SLOW_PER_VIRT_BASE+0x4000) | 127 | #define U300_TIMER_APP_VBASE IOMEM(U300_SLOW_PER_VIRT_BASE+0x4000) |
129 | 128 | ||
130 | /* Keypad */ | 129 | /* Keypad */ |
131 | #define U300_KEYPAD_BASE (U300_SLOW_PER_PHYS_BASE+0x5000) | 130 | #define U300_KEYPAD_BASE (U300_SLOW_PER_PHYS_BASE+0x5000) |
@@ -181,5 +180,4 @@ | |||
181 | * Virtual accessor macros for static devices | 180 | * Virtual accessor macros for static devices |
182 | */ | 181 | */ |
183 | 182 | ||
184 | |||
185 | #endif | 183 | #endif |
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index 891cf44591e0..18d7fa0603c2 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c | |||
@@ -411,8 +411,7 @@ static void __init u300_timer_init(void) | |||
411 | /* Use general purpose timer 2 as clock source */ | 411 | /* Use general purpose timer 2 as clock source */ |
412 | if (clocksource_mmio_init(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC, | 412 | if (clocksource_mmio_init(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC, |
413 | "GPT2", rate, 300, 32, clocksource_mmio_readl_up)) | 413 | "GPT2", rate, 300, 32, clocksource_mmio_readl_up)) |
414 | printk(KERN_ERR "timer: failed to initialize clock " | 414 | pr_err("timer: failed to initialize U300 clock source\n"); |
415 | "source %s\n", clocksource_u300_1mhz.name); | ||
416 | 415 | ||
417 | clockevents_calc_mult_shift(&clockevent_u300_1mhz, | 416 | clockevents_calc_mult_shift(&clockevent_u300_1mhz, |
418 | rate, APPTIMER_MIN_RANGE); | 417 | rate, APPTIMER_MIN_RANGE); |
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 285edcd2da2a..9e6b93b1a043 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -46,12 +46,6 @@ static struct map_desc v2m_io_desc[] __initdata = { | |||
46 | }, | 46 | }, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static void __init v2m_init_early(void) | ||
50 | { | ||
51 | ct_desc->init_early(); | ||
52 | versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000); | ||
53 | } | ||
54 | |||
55 | static void __init v2m_timer_init(void) | 49 | static void __init v2m_timer_init(void) |
56 | { | 50 | { |
57 | u32 scctrl; | 51 | u32 scctrl; |
@@ -365,6 +359,13 @@ static struct clk_lookup v2m_lookups[] = { | |||
365 | }, | 359 | }, |
366 | }; | 360 | }; |
367 | 361 | ||
362 | static void __init v2m_init_early(void) | ||
363 | { | ||
364 | ct_desc->init_early(); | ||
365 | clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups)); | ||
366 | versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000); | ||
367 | } | ||
368 | |||
368 | static void v2m_power_off(void) | 369 | static void v2m_power_off(void) |
369 | { | 370 | { |
370 | if (v2m_cfg_write(SYS_CFG_SHUTDOWN | SYS_CFG_SITE_MB, 0)) | 371 | if (v2m_cfg_write(SYS_CFG_SHUTDOWN | SYS_CFG_SITE_MB, 0)) |
@@ -418,8 +419,6 @@ static void __init v2m_init(void) | |||
418 | { | 419 | { |
419 | int i; | 420 | int i; |
420 | 421 | ||
421 | clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups)); | ||
422 | |||
423 | platform_device_register(&v2m_pcie_i2c_device); | 422 | platform_device_register(&v2m_pcie_i2c_device); |
424 | platform_device_register(&v2m_ddc_i2c_device); | 423 | platform_device_register(&v2m_ddc_i2c_device); |
425 | platform_device_register(&v2m_flash_device); | 424 | platform_device_register(&v2m_flash_device); |
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 8bfae964b133..b0ee9ba3cfab 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c | |||
@@ -24,7 +24,9 @@ DEFINE_PER_CPU(struct mm_struct *, current_mm); | |||
24 | 24 | ||
25 | /* | 25 | /* |
26 | * We fork()ed a process, and we need a new context for the child | 26 | * We fork()ed a process, and we need a new context for the child |
27 | * to run in. | 27 | * to run in. We reserve version 0 for initial tasks so we will |
28 | * always allocate an ASID. The ASID 0 is reserved for the TTBR | ||
29 | * register changing sequence. | ||
28 | */ | 30 | */ |
29 | void __init_new_context(struct task_struct *tsk, struct mm_struct *mm) | 31 | void __init_new_context(struct task_struct *tsk, struct mm_struct *mm) |
30 | { | 32 | { |
@@ -34,11 +36,8 @@ void __init_new_context(struct task_struct *tsk, struct mm_struct *mm) | |||
34 | 36 | ||
35 | static void flush_context(void) | 37 | static void flush_context(void) |
36 | { | 38 | { |
37 | u32 ttb; | 39 | /* set the reserved ASID before flushing the TLB */ |
38 | /* Copy TTBR1 into TTBR0 */ | 40 | asm("mcr p15, 0, %0, c13, c0, 1\n" : : "r" (0)); |
39 | asm volatile("mrc p15, 0, %0, c2, c0, 1\n" | ||
40 | "mcr p15, 0, %0, c2, c0, 0" | ||
41 | : "=r" (ttb)); | ||
42 | isb(); | 41 | isb(); |
43 | local_flush_tlb_all(); | 42 | local_flush_tlb_all(); |
44 | if (icache_is_vivt_asid_tagged()) { | 43 | if (icache_is_vivt_asid_tagged()) { |
@@ -94,7 +93,7 @@ static void reset_context(void *info) | |||
94 | return; | 93 | return; |
95 | 94 | ||
96 | smp_rmb(); | 95 | smp_rmb(); |
97 | asid = cpu_last_asid + cpu; | 96 | asid = cpu_last_asid + cpu + 1; |
98 | 97 | ||
99 | flush_context(); | 98 | flush_context(); |
100 | set_mm_context(mm, asid); | 99 | set_mm_context(mm, asid); |
@@ -144,13 +143,13 @@ void __new_context(struct mm_struct *mm) | |||
144 | * to start a new version and flush the TLB. | 143 | * to start a new version and flush the TLB. |
145 | */ | 144 | */ |
146 | if (unlikely((asid & ~ASID_MASK) == 0)) { | 145 | if (unlikely((asid & ~ASID_MASK) == 0)) { |
147 | asid = cpu_last_asid + smp_processor_id(); | 146 | asid = cpu_last_asid + smp_processor_id() + 1; |
148 | flush_context(); | 147 | flush_context(); |
149 | #ifdef CONFIG_SMP | 148 | #ifdef CONFIG_SMP |
150 | smp_wmb(); | 149 | smp_wmb(); |
151 | smp_call_function(reset_context, NULL, 1); | 150 | smp_call_function(reset_context, NULL, 1); |
152 | #endif | 151 | #endif |
153 | cpu_last_asid += NR_CPUS - 1; | 152 | cpu_last_asid += NR_CPUS; |
154 | } | 153 | } |
155 | 154 | ||
156 | set_mm_context(mm, asid); | 155 | set_mm_context(mm, asid); |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 2c2cce9cd8c8..c19571c40a21 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -331,6 +331,12 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) | |||
331 | #endif | 331 | #endif |
332 | #ifdef CONFIG_BLK_DEV_INITRD | 332 | #ifdef CONFIG_BLK_DEV_INITRD |
333 | if (phys_initrd_size && | 333 | if (phys_initrd_size && |
334 | !memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) { | ||
335 | pr_err("INITRD: 0x%08lx+0x%08lx is not a memory region - disabling initrd\n", | ||
336 | phys_initrd_start, phys_initrd_size); | ||
337 | phys_initrd_start = phys_initrd_size = 0; | ||
338 | } | ||
339 | if (phys_initrd_size && | ||
334 | memblock_is_region_reserved(phys_initrd_start, phys_initrd_size)) { | 340 | memblock_is_region_reserved(phys_initrd_start, phys_initrd_size)) { |
335 | pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region - disabling initrd\n", | 341 | pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region - disabling initrd\n", |
336 | phys_initrd_start, phys_initrd_size); | 342 | phys_initrd_start, phys_initrd_size); |
@@ -635,7 +641,8 @@ void __init mem_init(void) | |||
635 | " modules : 0x%08lx - 0x%08lx (%4ld MB)\n" | 641 | " modules : 0x%08lx - 0x%08lx (%4ld MB)\n" |
636 | " .init : 0x%p" " - 0x%p" " (%4d kB)\n" | 642 | " .init : 0x%p" " - 0x%p" " (%4d kB)\n" |
637 | " .text : 0x%p" " - 0x%p" " (%4d kB)\n" | 643 | " .text : 0x%p" " - 0x%p" " (%4d kB)\n" |
638 | " .data : 0x%p" " - 0x%p" " (%4d kB)\n", | 644 | " .data : 0x%p" " - 0x%p" " (%4d kB)\n" |
645 | " .bss : 0x%p" " - 0x%p" " (%4d kB)\n", | ||
639 | 646 | ||
640 | MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) + | 647 | MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) + |
641 | (PAGE_SIZE)), | 648 | (PAGE_SIZE)), |
@@ -657,7 +664,8 @@ void __init mem_init(void) | |||
657 | 664 | ||
658 | MLK_ROUNDUP(__init_begin, __init_end), | 665 | MLK_ROUNDUP(__init_begin, __init_end), |
659 | MLK_ROUNDUP(_text, _etext), | 666 | MLK_ROUNDUP(_text, _etext), |
660 | MLK_ROUNDUP(_sdata, _edata)); | 667 | MLK_ROUNDUP(_sdata, _edata), |
668 | MLK_ROUNDUP(__bss_start, __bss_stop)); | ||
661 | 669 | ||
662 | #undef MLK | 670 | #undef MLK |
663 | #undef MLM | 671 | #undef MLM |
diff --git a/arch/arm/mm/proc-arm7tdmi.S b/arch/arm/mm/proc-arm7tdmi.S index e4c165ca6696..537ffcb0646d 100644 --- a/arch/arm/mm/proc-arm7tdmi.S +++ b/arch/arm/mm/proc-arm7tdmi.S | |||
@@ -146,7 +146,7 @@ __arm7tdmi_proc_info: | |||
146 | .long 0 | 146 | .long 0 |
147 | .long 0 | 147 | .long 0 |
148 | .long v4_cache_fns | 148 | .long v4_cache_fns |
149 | .size __arm7tdmi_proc_info, . - __arm7dmi_proc_info | 149 | .size __arm7tdmi_proc_info, . - __arm7tdmi_proc_info |
150 | 150 | ||
151 | .type __triscenda7_proc_info, #object | 151 | .type __triscenda7_proc_info, #object |
152 | __triscenda7_proc_info: | 152 | __triscenda7_proc_info: |
diff --git a/arch/arm/mm/proc-arm9tdmi.S b/arch/arm/mm/proc-arm9tdmi.S index 7b7ebd4d096d..546b54da1005 100644 --- a/arch/arm/mm/proc-arm9tdmi.S +++ b/arch/arm/mm/proc-arm9tdmi.S | |||
@@ -116,7 +116,7 @@ __arm9tdmi_proc_info: | |||
116 | .long 0 | 116 | .long 0 |
117 | .long 0 | 117 | .long 0 |
118 | .long v4_cache_fns | 118 | .long v4_cache_fns |
119 | .size __arm9tdmi_proc_info, . - __arm9dmi_proc_info | 119 | .size __arm9tdmi_proc_info, . - __arm9tdmi_proc_info |
120 | 120 | ||
121 | .type __p2001_proc_info, #object | 121 | .type __p2001_proc_info, #object |
122 | __p2001_proc_info: | 122 | __p2001_proc_info: |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index b3b566ec83d3..3c3867850a30 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -108,16 +108,18 @@ ENTRY(cpu_v7_switch_mm) | |||
108 | #ifdef CONFIG_ARM_ERRATA_430973 | 108 | #ifdef CONFIG_ARM_ERRATA_430973 |
109 | mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB | 109 | mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB |
110 | #endif | 110 | #endif |
111 | mrc p15, 0, r2, c2, c0, 1 @ load TTB 1 | 111 | #ifdef CONFIG_ARM_ERRATA_754322 |
112 | mcr p15, 0, r2, c2, c0, 0 @ into TTB 0 | 112 | dsb |
113 | #endif | ||
114 | mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID | ||
115 | isb | ||
116 | 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | ||
113 | isb | 117 | isb |
114 | #ifdef CONFIG_ARM_ERRATA_754322 | 118 | #ifdef CONFIG_ARM_ERRATA_754322 |
115 | dsb | 119 | dsb |
116 | #endif | 120 | #endif |
117 | mcr p15, 0, r1, c13, c0, 1 @ set context ID | 121 | mcr p15, 0, r1, c13, c0, 1 @ set context ID |
118 | isb | 122 | isb |
119 | mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | ||
120 | isb | ||
121 | #endif | 123 | #endif |
122 | mov pc, lr | 124 | mov pc, lr |
123 | ENDPROC(cpu_v7_switch_mm) | 125 | ENDPROC(cpu_v7_switch_mm) |
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c index 3538b85ede91..b130f60ca6b7 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-dma.c +++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c | |||
@@ -139,7 +139,7 @@ static struct sdma_script_start_addrs addr_imx35_to2 = { | |||
139 | #endif | 139 | #endif |
140 | 140 | ||
141 | #ifdef CONFIG_SOC_IMX51 | 141 | #ifdef CONFIG_SOC_IMX51 |
142 | static struct sdma_script_start_addrs addr_imx51_to1 = { | 142 | static struct sdma_script_start_addrs addr_imx51 = { |
143 | .ap_2_ap_addr = 642, | 143 | .ap_2_ap_addr = 642, |
144 | .uart_2_mcu_addr = 817, | 144 | .uart_2_mcu_addr = 817, |
145 | .mcu_2_app_addr = 747, | 145 | .mcu_2_app_addr = 747, |
@@ -196,7 +196,9 @@ static int __init imxXX_add_imx_dma(void) | |||
196 | 196 | ||
197 | #if defined(CONFIG_SOC_IMX51) | 197 | #if defined(CONFIG_SOC_IMX51) |
198 | if (cpu_is_mx51()) { | 198 | if (cpu_is_mx51()) { |
199 | imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51_to1; | 199 | int to_version = mx51_revision() >> 4; |
200 | imx51_imx_sdma_data.pdata.to_version = to_version; | ||
201 | imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51; | ||
200 | ret = imx_add_imx_sdma(&imx51_imx_sdma_data); | 202 | ret = imx_add_imx_sdma(&imx51_imx_sdma_data); |
201 | } else | 203 | } else |
202 | #endif | 204 | #endif |
diff --git a/arch/avr32/configs/atngw100_defconfig b/arch/avr32/configs/atngw100_defconfig index 6f9ca56de1f6..a06bfccc2840 100644 --- a/arch/avr32/configs/atngw100_defconfig +++ b/arch/avr32/configs/atngw100_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/atngw100_evklcd100_defconfig b/arch/avr32/configs/atngw100_evklcd100_defconfig index 7eece0af34c9..d8f1fe80d210 100644 --- a/arch/avr32/configs/atngw100_evklcd100_defconfig +++ b/arch/avr32/configs/atngw100_evklcd100_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/atngw100_evklcd101_defconfig b/arch/avr32/configs/atngw100_evklcd101_defconfig index 387eb9d6e423..d4c5b19ec950 100644 --- a/arch/avr32/configs/atngw100_evklcd101_defconfig +++ b/arch/avr32/configs/atngw100_evklcd101_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/atngw100_mrmt_defconfig b/arch/avr32/configs/atngw100_mrmt_defconfig index 19f6ceeeff7b..77ca4f905d2c 100644 --- a/arch/avr32/configs/atngw100_mrmt_defconfig +++ b/arch/avr32/configs/atngw100_mrmt_defconfig | |||
@@ -7,6 +7,7 @@ CONFIG_BSD_PROCESS_ACCT_V3=y | |||
7 | CONFIG_LOG_BUF_SHIFT=14 | 7 | CONFIG_LOG_BUF_SHIFT=14 |
8 | CONFIG_SYSFS_DEPRECATED_V2=y | 8 | CONFIG_SYSFS_DEPRECATED_V2=y |
9 | CONFIG_BLK_DEV_INITRD=y | 9 | CONFIG_BLK_DEV_INITRD=y |
10 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
10 | # CONFIG_SYSCTL_SYSCALL is not set | 11 | # CONFIG_SYSCTL_SYSCALL is not set |
11 | # CONFIG_BASE_FULL is not set | 12 | # CONFIG_BASE_FULL is not set |
12 | # CONFIG_SLUB_DEBUG is not set | 13 | # CONFIG_SLUB_DEBUG is not set |
@@ -109,7 +110,7 @@ CONFIG_LEDS_GPIO=y | |||
109 | CONFIG_LEDS_TRIGGERS=y | 110 | CONFIG_LEDS_TRIGGERS=y |
110 | CONFIG_LEDS_TRIGGER_TIMER=y | 111 | CONFIG_LEDS_TRIGGER_TIMER=y |
111 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 112 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
112 | CONFIG_RTC_CLASS=m | 113 | CONFIG_RTC_CLASS=y |
113 | CONFIG_RTC_DRV_S35390A=m | 114 | CONFIG_RTC_DRV_S35390A=m |
114 | CONFIG_RTC_DRV_AT32AP700X=m | 115 | CONFIG_RTC_DRV_AT32AP700X=m |
115 | CONFIG_DMADEVICES=y | 116 | CONFIG_DMADEVICES=y |
diff --git a/arch/avr32/configs/atngw100mkii_defconfig b/arch/avr32/configs/atngw100mkii_defconfig index f0fe237133a9..6e0dca4d3131 100644 --- a/arch/avr32/configs/atngw100mkii_defconfig +++ b/arch/avr32/configs/atngw100mkii_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/atngw100mkii_evklcd100_defconfig b/arch/avr32/configs/atngw100mkii_evklcd100_defconfig index e4a7c1dc8380..7f2a344a5fa8 100644 --- a/arch/avr32/configs/atngw100mkii_evklcd100_defconfig +++ b/arch/avr32/configs/atngw100mkii_evklcd100_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/atngw100mkii_evklcd101_defconfig b/arch/avr32/configs/atngw100mkii_evklcd101_defconfig index 6f37f70c2c37..085eeba88f67 100644 --- a/arch/avr32/configs/atngw100mkii_evklcd101_defconfig +++ b/arch/avr32/configs/atngw100mkii_evklcd101_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/atstk1002_defconfig b/arch/avr32/configs/atstk1002_defconfig index 4fb01f5ab42f..d1a887e64055 100644 --- a/arch/avr32/configs/atstk1002_defconfig +++ b/arch/avr32/configs/atstk1002_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/atstk1003_defconfig b/arch/avr32/configs/atstk1003_defconfig index 9faaf9b900f2..956f2819ad45 100644 --- a/arch/avr32/configs/atstk1003_defconfig +++ b/arch/avr32/configs/atstk1003_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/atstk1004_defconfig b/arch/avr32/configs/atstk1004_defconfig index 3d2a5d85f970..40c69f38c61a 100644 --- a/arch/avr32/configs/atstk1004_defconfig +++ b/arch/avr32/configs/atstk1004_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/atstk1006_defconfig b/arch/avr32/configs/atstk1006_defconfig index 1ed8f22d4fe2..511eb8af356d 100644 --- a/arch/avr32/configs/atstk1006_defconfig +++ b/arch/avr32/configs/atstk1006_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_POSIX_MQUEUE=y | |||
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_RELAY=y | 6 | CONFIG_RELAY=y |
7 | CONFIG_BLK_DEV_INITRD=y | 7 | CONFIG_BLK_DEV_INITRD=y |
8 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
8 | # CONFIG_SYSCTL_SYSCALL is not set | 9 | # CONFIG_SYSCTL_SYSCALL is not set |
9 | # CONFIG_BASE_FULL is not set | 10 | # CONFIG_BASE_FULL is not set |
10 | # CONFIG_COMPAT_BRK is not set | 11 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/favr-32_defconfig b/arch/avr32/configs/favr-32_defconfig index aeadc955db32..19973b06170c 100644 --- a/arch/avr32/configs/favr-32_defconfig +++ b/arch/avr32/configs/favr-32_defconfig | |||
@@ -6,6 +6,7 @@ CONFIG_LOG_BUF_SHIFT=14 | |||
6 | CONFIG_SYSFS_DEPRECATED_V2=y | 6 | CONFIG_SYSFS_DEPRECATED_V2=y |
7 | CONFIG_RELAY=y | 7 | CONFIG_RELAY=y |
8 | CONFIG_BLK_DEV_INITRD=y | 8 | CONFIG_BLK_DEV_INITRD=y |
9 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
9 | # CONFIG_SYSCTL_SYSCALL is not set | 10 | # CONFIG_SYSCTL_SYSCALL is not set |
10 | # CONFIG_BASE_FULL is not set | 11 | # CONFIG_BASE_FULL is not set |
11 | # CONFIG_COMPAT_BRK is not set | 12 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/hammerhead_defconfig b/arch/avr32/configs/hammerhead_defconfig index 1692beeb7ed3..6f45681196d1 100644 --- a/arch/avr32/configs/hammerhead_defconfig +++ b/arch/avr32/configs/hammerhead_defconfig | |||
@@ -7,6 +7,7 @@ CONFIG_BSD_PROCESS_ACCT_V3=y | |||
7 | CONFIG_LOG_BUF_SHIFT=14 | 7 | CONFIG_LOG_BUF_SHIFT=14 |
8 | CONFIG_SYSFS_DEPRECATED_V2=y | 8 | CONFIG_SYSFS_DEPRECATED_V2=y |
9 | CONFIG_BLK_DEV_INITRD=y | 9 | CONFIG_BLK_DEV_INITRD=y |
10 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
10 | # CONFIG_SYSCTL_SYSCALL is not set | 11 | # CONFIG_SYSCTL_SYSCALL is not set |
11 | # CONFIG_BASE_FULL is not set | 12 | # CONFIG_BASE_FULL is not set |
12 | # CONFIG_COMPAT_BRK is not set | 13 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/configs/merisc_defconfig b/arch/avr32/configs/merisc_defconfig index 8b670a6530bf..3befab966827 100644 --- a/arch/avr32/configs/merisc_defconfig +++ b/arch/avr32/configs/merisc_defconfig | |||
@@ -7,6 +7,7 @@ CONFIG_BSD_PROCESS_ACCT_V3=y | |||
7 | CONFIG_LOG_BUF_SHIFT=14 | 7 | CONFIG_LOG_BUF_SHIFT=14 |
8 | CONFIG_SYSFS_DEPRECATED_V2=y | 8 | CONFIG_SYSFS_DEPRECATED_V2=y |
9 | CONFIG_BLK_DEV_INITRD=y | 9 | CONFIG_BLK_DEV_INITRD=y |
10 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
10 | # CONFIG_SYSCTL_SYSCALL is not set | 11 | # CONFIG_SYSCTL_SYSCALL is not set |
11 | # CONFIG_BASE_FULL is not set | 12 | # CONFIG_BASE_FULL is not set |
12 | CONFIG_MODULES=y | 13 | CONFIG_MODULES=y |
diff --git a/arch/avr32/configs/mimc200_defconfig b/arch/avr32/configs/mimc200_defconfig index 5a51f2e7ffb9..1bee51f22154 100644 --- a/arch/avr32/configs/mimc200_defconfig +++ b/arch/avr32/configs/mimc200_defconfig | |||
@@ -7,6 +7,7 @@ CONFIG_BSD_PROCESS_ACCT_V3=y | |||
7 | CONFIG_LOG_BUF_SHIFT=14 | 7 | CONFIG_LOG_BUF_SHIFT=14 |
8 | CONFIG_SYSFS_DEPRECATED_V2=y | 8 | CONFIG_SYSFS_DEPRECATED_V2=y |
9 | CONFIG_BLK_DEV_INITRD=y | 9 | CONFIG_BLK_DEV_INITRD=y |
10 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
10 | # CONFIG_SYSCTL_SYSCALL is not set | 11 | # CONFIG_SYSCTL_SYSCALL is not set |
11 | # CONFIG_BASE_FULL is not set | 12 | # CONFIG_BASE_FULL is not set |
12 | # CONFIG_COMPAT_BRK is not set | 13 | # CONFIG_COMPAT_BRK is not set |
diff --git a/arch/avr32/include/asm/processor.h b/arch/avr32/include/asm/processor.h index 49a88f5a9d2f..108502bc6770 100644 --- a/arch/avr32/include/asm/processor.h +++ b/arch/avr32/include/asm/processor.h | |||
@@ -131,7 +131,6 @@ struct thread_struct { | |||
131 | */ | 131 | */ |
132 | #define start_thread(regs, new_pc, new_sp) \ | 132 | #define start_thread(regs, new_pc, new_sp) \ |
133 | do { \ | 133 | do { \ |
134 | set_fs(USER_DS); \ | ||
135 | memset(regs, 0, sizeof(*regs)); \ | 134 | memset(regs, 0, sizeof(*regs)); \ |
136 | regs->sr = MODE_USER; \ | 135 | regs->sr = MODE_USER; \ |
137 | regs->pc = new_pc & ~1; \ | 136 | regs->pc = new_pc & ~1; \ |
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index aa677e2a3823..7fbf0dcb9afe 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c | |||
@@ -1043,8 +1043,9 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) | |||
1043 | data->regs = (void __iomem *)pdev->resource[0].start; | 1043 | data->regs = (void __iomem *)pdev->resource[0].start; |
1044 | } | 1044 | } |
1045 | 1045 | ||
1046 | pdev->id = line; | ||
1046 | pdata = pdev->dev.platform_data; | 1047 | pdata = pdev->dev.platform_data; |
1047 | pdata->num = portnr; | 1048 | pdata->num = line; |
1048 | at32_usarts[line] = pdev; | 1049 | at32_usarts[line] = pdev; |
1049 | } | 1050 | } |
1050 | 1051 | ||
diff --git a/arch/avr32/mach-at32ap/include/mach/cpu.h b/arch/avr32/mach-at32ap/include/mach/cpu.h index 9c96a130f3a8..8181293115e4 100644 --- a/arch/avr32/mach-at32ap/include/mach/cpu.h +++ b/arch/avr32/mach-at32ap/include/mach/cpu.h | |||
@@ -31,8 +31,20 @@ | |||
31 | #define cpu_is_at91sam9263() (0) | 31 | #define cpu_is_at91sam9263() (0) |
32 | #define cpu_is_at91sam9rl() (0) | 32 | #define cpu_is_at91sam9rl() (0) |
33 | #define cpu_is_at91cap9() (0) | 33 | #define cpu_is_at91cap9() (0) |
34 | #define cpu_is_at91cap9_revB() (0) | ||
35 | #define cpu_is_at91cap9_revC() (0) | ||
34 | #define cpu_is_at91sam9g10() (0) | 36 | #define cpu_is_at91sam9g10() (0) |
37 | #define cpu_is_at91sam9g20() (0) | ||
35 | #define cpu_is_at91sam9g45() (0) | 38 | #define cpu_is_at91sam9g45() (0) |
36 | #define cpu_is_at91sam9g45es() (0) | 39 | #define cpu_is_at91sam9g45es() (0) |
40 | #define cpu_is_at91sam9m10() (0) | ||
41 | #define cpu_is_at91sam9g46() (0) | ||
42 | #define cpu_is_at91sam9m11() (0) | ||
43 | #define cpu_is_at91sam9x5() (0) | ||
44 | #define cpu_is_at91sam9g15() (0) | ||
45 | #define cpu_is_at91sam9g35() (0) | ||
46 | #define cpu_is_at91sam9x35() (0) | ||
47 | #define cpu_is_at91sam9g25() (0) | ||
48 | #define cpu_is_at91sam9x25() (0) | ||
37 | 49 | ||
38 | #endif /* __ASM_ARCH_CPU_H */ | 50 | #endif /* __ASM_ARCH_CPU_H */ |
diff --git a/arch/avr32/mach-at32ap/intc.c b/arch/avr32/mach-at32ap/intc.c index 3e3646186c9f..c9ac2f8e8f64 100644 --- a/arch/avr32/mach-at32ap/intc.c +++ b/arch/avr32/mach-at32ap/intc.c | |||
@@ -167,14 +167,12 @@ static int intc_suspend(void) | |||
167 | return 0; | 167 | return 0; |
168 | } | 168 | } |
169 | 169 | ||
170 | static int intc_resume(void) | 170 | static void intc_resume(void) |
171 | { | 171 | { |
172 | int i; | 172 | int i; |
173 | 173 | ||
174 | for (i = 0; i < 64; i++) | 174 | for (i = 0; i < 64; i++) |
175 | intc_writel(&intc0, INTPR0 + 4 * i, intc0.saved_ipr[i]); | 175 | intc_writel(&intc0, INTPR0 + 4 * i, intc0.saved_ipr[i]); |
176 | |||
177 | return 0; | ||
178 | } | 176 | } |
179 | #else | 177 | #else |
180 | #define intc_suspend NULL | 178 | #define intc_suspend NULL |
diff --git a/arch/blackfin/configs/CM-BF548_defconfig b/arch/blackfin/configs/CM-BF548_defconfig index 31d954216c05..9f1d08401fca 100644 --- a/arch/blackfin/configs/CM-BF548_defconfig +++ b/arch/blackfin/configs/CM-BF548_defconfig | |||
@@ -112,7 +112,7 @@ CONFIG_USB_G_SERIAL=m | |||
112 | CONFIG_USB_G_PRINTER=m | 112 | CONFIG_USB_G_PRINTER=m |
113 | CONFIG_MMC=m | 113 | CONFIG_MMC=m |
114 | CONFIG_SDH_BFIN=m | 114 | CONFIG_SDH_BFIN=m |
115 | CONFIG_RTC_CLASS=m | 115 | CONFIG_RTC_CLASS=y |
116 | CONFIG_RTC_DRV_BFIN=m | 116 | CONFIG_RTC_DRV_BFIN=m |
117 | CONFIG_EXT2_FS=m | 117 | CONFIG_EXT2_FS=m |
118 | # CONFIG_DNOTIFY is not set | 118 | # CONFIG_DNOTIFY is not set |
diff --git a/arch/m68k/Kconfig.nommu b/arch/m68k/Kconfig.nommu index fc98f9b9d4d2..b004dc1b1710 100644 --- a/arch/m68k/Kconfig.nommu +++ b/arch/m68k/Kconfig.nommu | |||
@@ -14,6 +14,33 @@ config GENERIC_CLOCKEVENTS | |||
14 | bool | 14 | bool |
15 | default n | 15 | default n |
16 | 16 | ||
17 | config M68000 | ||
18 | bool | ||
19 | help | ||
20 | The Freescale (was Motorola) 68000 CPU is the first generation of | ||
21 | the well known M68K family of processors. The CPU core as well as | ||
22 | being available as a stand alone CPU was also used in many | ||
23 | System-On-Chip devices (eg 68328, 68302, etc). It does not contain | ||
24 | a paging MMU. | ||
25 | |||
26 | config MCPU32 | ||
27 | bool | ||
28 | help | ||
29 | The Freescale (was then Motorola) CPU32 is a CPU core that is | ||
30 | based on the 68020 processor. For the most part it is used in | ||
31 | System-On-Chip parts, and does not contain a paging MMU. | ||
32 | |||
33 | config COLDFIRE | ||
34 | bool | ||
35 | select GENERIC_GPIO | ||
36 | select ARCH_REQUIRE_GPIOLIB | ||
37 | help | ||
38 | The Freescale ColdFire family of processors is a modern derivitive | ||
39 | of the 68000 processor family. They are mainly targeted at embedded | ||
40 | applications, and are all System-On-Chip (SOC) devices, as opposed | ||
41 | to stand alone CPUs. They implement a subset of the original 68000 | ||
42 | processor instruction set. | ||
43 | |||
17 | config COLDFIRE_SW_A7 | 44 | config COLDFIRE_SW_A7 |
18 | bool | 45 | bool |
19 | default n | 46 | default n |
@@ -36,26 +63,31 @@ choice | |||
36 | 63 | ||
37 | config M68328 | 64 | config M68328 |
38 | bool "MC68328" | 65 | bool "MC68328" |
66 | select M68000 | ||
39 | help | 67 | help |
40 | Motorola 68328 processor support. | 68 | Motorola 68328 processor support. |
41 | 69 | ||
42 | config M68EZ328 | 70 | config M68EZ328 |
43 | bool "MC68EZ328" | 71 | bool "MC68EZ328" |
72 | select M68000 | ||
44 | help | 73 | help |
45 | Motorola 68EX328 processor support. | 74 | Motorola 68EX328 processor support. |
46 | 75 | ||
47 | config M68VZ328 | 76 | config M68VZ328 |
48 | bool "MC68VZ328" | 77 | bool "MC68VZ328" |
78 | select M68000 | ||
49 | help | 79 | help |
50 | Motorola 68VZ328 processor support. | 80 | Motorola 68VZ328 processor support. |
51 | 81 | ||
52 | config M68360 | 82 | config M68360 |
53 | bool "MC68360" | 83 | bool "MC68360" |
84 | select MCPU32 | ||
54 | help | 85 | help |
55 | Motorola 68360 processor support. | 86 | Motorola 68360 processor support. |
56 | 87 | ||
57 | config M5206 | 88 | config M5206 |
58 | bool "MCF5206" | 89 | bool "MCF5206" |
90 | select COLDFIRE | ||
59 | select COLDFIRE_SW_A7 | 91 | select COLDFIRE_SW_A7 |
60 | select HAVE_MBAR | 92 | select HAVE_MBAR |
61 | help | 93 | help |
@@ -63,6 +95,7 @@ config M5206 | |||
63 | 95 | ||
64 | config M5206e | 96 | config M5206e |
65 | bool "MCF5206e" | 97 | bool "MCF5206e" |
98 | select COLDFIRE | ||
66 | select COLDFIRE_SW_A7 | 99 | select COLDFIRE_SW_A7 |
67 | select HAVE_MBAR | 100 | select HAVE_MBAR |
68 | help | 101 | help |
@@ -70,6 +103,7 @@ config M5206e | |||
70 | 103 | ||
71 | config M520x | 104 | config M520x |
72 | bool "MCF520x" | 105 | bool "MCF520x" |
106 | select COLDFIRE | ||
73 | select GENERIC_CLOCKEVENTS | 107 | select GENERIC_CLOCKEVENTS |
74 | select HAVE_CACHE_SPLIT | 108 | select HAVE_CACHE_SPLIT |
75 | help | 109 | help |
@@ -77,6 +111,7 @@ config M520x | |||
77 | 111 | ||
78 | config M523x | 112 | config M523x |
79 | bool "MCF523x" | 113 | bool "MCF523x" |
114 | select COLDFIRE | ||
80 | select GENERIC_CLOCKEVENTS | 115 | select GENERIC_CLOCKEVENTS |
81 | select HAVE_CACHE_SPLIT | 116 | select HAVE_CACHE_SPLIT |
82 | select HAVE_IPSBAR | 117 | select HAVE_IPSBAR |
@@ -85,6 +120,7 @@ config M523x | |||
85 | 120 | ||
86 | config M5249 | 121 | config M5249 |
87 | bool "MCF5249" | 122 | bool "MCF5249" |
123 | select COLDFIRE | ||
88 | select COLDFIRE_SW_A7 | 124 | select COLDFIRE_SW_A7 |
89 | select HAVE_MBAR | 125 | select HAVE_MBAR |
90 | help | 126 | help |
@@ -92,6 +128,7 @@ config M5249 | |||
92 | 128 | ||
93 | config M5271 | 129 | config M5271 |
94 | bool "MCF5271" | 130 | bool "MCF5271" |
131 | select COLDFIRE | ||
95 | select HAVE_CACHE_SPLIT | 132 | select HAVE_CACHE_SPLIT |
96 | select HAVE_IPSBAR | 133 | select HAVE_IPSBAR |
97 | help | 134 | help |
@@ -99,6 +136,7 @@ config M5271 | |||
99 | 136 | ||
100 | config M5272 | 137 | config M5272 |
101 | bool "MCF5272" | 138 | bool "MCF5272" |
139 | select COLDFIRE | ||
102 | select COLDFIRE_SW_A7 | 140 | select COLDFIRE_SW_A7 |
103 | select HAVE_MBAR | 141 | select HAVE_MBAR |
104 | help | 142 | help |
@@ -106,6 +144,7 @@ config M5272 | |||
106 | 144 | ||
107 | config M5275 | 145 | config M5275 |
108 | bool "MCF5275" | 146 | bool "MCF5275" |
147 | select COLDFIRE | ||
109 | select HAVE_CACHE_SPLIT | 148 | select HAVE_CACHE_SPLIT |
110 | select HAVE_IPSBAR | 149 | select HAVE_IPSBAR |
111 | help | 150 | help |
@@ -113,6 +152,7 @@ config M5275 | |||
113 | 152 | ||
114 | config M528x | 153 | config M528x |
115 | bool "MCF528x" | 154 | bool "MCF528x" |
155 | select COLDFIRE | ||
116 | select GENERIC_CLOCKEVENTS | 156 | select GENERIC_CLOCKEVENTS |
117 | select HAVE_CACHE_SPLIT | 157 | select HAVE_CACHE_SPLIT |
118 | select HAVE_IPSBAR | 158 | select HAVE_IPSBAR |
@@ -121,6 +161,7 @@ config M528x | |||
121 | 161 | ||
122 | config M5307 | 162 | config M5307 |
123 | bool "MCF5307" | 163 | bool "MCF5307" |
164 | select COLDFIRE | ||
124 | select COLDFIRE_SW_A7 | 165 | select COLDFIRE_SW_A7 |
125 | select HAVE_CACHE_CB | 166 | select HAVE_CACHE_CB |
126 | select HAVE_MBAR | 167 | select HAVE_MBAR |
@@ -129,12 +170,14 @@ config M5307 | |||
129 | 170 | ||
130 | config M532x | 171 | config M532x |
131 | bool "MCF532x" | 172 | bool "MCF532x" |
173 | select COLDFIRE | ||
132 | select HAVE_CACHE_CB | 174 | select HAVE_CACHE_CB |
133 | help | 175 | help |
134 | Freescale (Motorola) ColdFire 532x processor support. | 176 | Freescale (Motorola) ColdFire 532x processor support. |
135 | 177 | ||
136 | config M5407 | 178 | config M5407 |
137 | bool "MCF5407" | 179 | bool "MCF5407" |
180 | select COLDFIRE | ||
138 | select COLDFIRE_SW_A7 | 181 | select COLDFIRE_SW_A7 |
139 | select HAVE_CACHE_CB | 182 | select HAVE_CACHE_CB |
140 | select HAVE_MBAR | 183 | select HAVE_MBAR |
@@ -143,6 +186,7 @@ config M5407 | |||
143 | 186 | ||
144 | config M547x | 187 | config M547x |
145 | bool "MCF547x" | 188 | bool "MCF547x" |
189 | select COLDFIRE | ||
146 | select HAVE_CACHE_CB | 190 | select HAVE_CACHE_CB |
147 | select HAVE_MBAR | 191 | select HAVE_MBAR |
148 | help | 192 | help |
@@ -150,6 +194,7 @@ config M547x | |||
150 | 194 | ||
151 | config M548x | 195 | config M548x |
152 | bool "MCF548x" | 196 | bool "MCF548x" |
197 | select COLDFIRE | ||
153 | select HAVE_CACHE_CB | 198 | select HAVE_CACHE_CB |
154 | select HAVE_MBAR | 199 | select HAVE_MBAR |
155 | help | 200 | help |
@@ -168,13 +213,6 @@ config M54xx | |||
168 | depends on (M548x || M547x) | 213 | depends on (M548x || M547x) |
169 | default y | 214 | default y |
170 | 215 | ||
171 | config COLDFIRE | ||
172 | bool | ||
173 | depends on (M5206 || M5206e || M520x || M523x || M5249 || M527x || M5272 || M528x || M5307 || M532x || M5407 || M54xx) | ||
174 | select GENERIC_GPIO | ||
175 | select ARCH_REQUIRE_GPIOLIB | ||
176 | default y | ||
177 | |||
178 | config CLOCK_SET | 216 | config CLOCK_SET |
179 | bool "Enable setting the CPU clock frequency" | 217 | bool "Enable setting the CPU clock frequency" |
180 | default n | 218 | default n |
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c index 33f82769547c..1b7a14d1a000 100644 --- a/arch/m68k/kernel/m68k_ksyms.c +++ b/arch/m68k/kernel/m68k_ksyms.c | |||
@@ -14,8 +14,7 @@ EXPORT_SYMBOL(__ashrdi3); | |||
14 | EXPORT_SYMBOL(__lshrdi3); | 14 | EXPORT_SYMBOL(__lshrdi3); |
15 | EXPORT_SYMBOL(__muldi3); | 15 | EXPORT_SYMBOL(__muldi3); |
16 | 16 | ||
17 | #if !defined(__mc68020__) && !defined(__mc68030__) && \ | 17 | #if defined(CONFIG_M68000) || defined(CONFIG_COLDFIRE) |
18 | !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcpu32__) | ||
19 | /* | 18 | /* |
20 | * Simpler 68k and ColdFire parts also need a few other gcc functions. | 19 | * Simpler 68k and ColdFire parts also need a few other gcc functions. |
21 | */ | 20 | */ |
diff --git a/arch/m68k/kernel/vmlinux.lds_no.S b/arch/m68k/kernel/vmlinux.lds_no.S index f4d715cdca0e..7dc4087a9545 100644 --- a/arch/m68k/kernel/vmlinux.lds_no.S +++ b/arch/m68k/kernel/vmlinux.lds_no.S | |||
@@ -84,52 +84,52 @@ SECTIONS { | |||
84 | /* Kernel symbol table: Normal symbols */ | 84 | /* Kernel symbol table: Normal symbols */ |
85 | . = ALIGN(4); | 85 | . = ALIGN(4); |
86 | __start___ksymtab = .; | 86 | __start___ksymtab = .; |
87 | *(__ksymtab) | 87 | *(SORT(___ksymtab+*)) |
88 | __stop___ksymtab = .; | 88 | __stop___ksymtab = .; |
89 | 89 | ||
90 | /* Kernel symbol table: GPL-only symbols */ | 90 | /* Kernel symbol table: GPL-only symbols */ |
91 | __start___ksymtab_gpl = .; | 91 | __start___ksymtab_gpl = .; |
92 | *(__ksymtab_gpl) | 92 | *(SORT(___ksymtab_gpl+*)) |
93 | __stop___ksymtab_gpl = .; | 93 | __stop___ksymtab_gpl = .; |
94 | 94 | ||
95 | /* Kernel symbol table: Normal unused symbols */ | 95 | /* Kernel symbol table: Normal unused symbols */ |
96 | __start___ksymtab_unused = .; | 96 | __start___ksymtab_unused = .; |
97 | *(__ksymtab_unused) | 97 | *(SORT(___ksymtab_unused+*)) |
98 | __stop___ksymtab_unused = .; | 98 | __stop___ksymtab_unused = .; |
99 | 99 | ||
100 | /* Kernel symbol table: GPL-only unused symbols */ | 100 | /* Kernel symbol table: GPL-only unused symbols */ |
101 | __start___ksymtab_unused_gpl = .; | 101 | __start___ksymtab_unused_gpl = .; |
102 | *(__ksymtab_unused_gpl) | 102 | *(SORT(___ksymtab_unused_gpl+*)) |
103 | __stop___ksymtab_unused_gpl = .; | 103 | __stop___ksymtab_unused_gpl = .; |
104 | 104 | ||
105 | /* Kernel symbol table: GPL-future symbols */ | 105 | /* Kernel symbol table: GPL-future symbols */ |
106 | __start___ksymtab_gpl_future = .; | 106 | __start___ksymtab_gpl_future = .; |
107 | *(__ksymtab_gpl_future) | 107 | *(SORT(___ksymtab_gpl_future+*)) |
108 | __stop___ksymtab_gpl_future = .; | 108 | __stop___ksymtab_gpl_future = .; |
109 | 109 | ||
110 | /* Kernel symbol table: Normal symbols */ | 110 | /* Kernel symbol table: Normal symbols */ |
111 | __start___kcrctab = .; | 111 | __start___kcrctab = .; |
112 | *(__kcrctab) | 112 | *(SORT(___kcrctab+*)) |
113 | __stop___kcrctab = .; | 113 | __stop___kcrctab = .; |
114 | 114 | ||
115 | /* Kernel symbol table: GPL-only symbols */ | 115 | /* Kernel symbol table: GPL-only symbols */ |
116 | __start___kcrctab_gpl = .; | 116 | __start___kcrctab_gpl = .; |
117 | *(__kcrctab_gpl) | 117 | *(SORT(___kcrctab_gpl+*)) |
118 | __stop___kcrctab_gpl = .; | 118 | __stop___kcrctab_gpl = .; |
119 | 119 | ||
120 | /* Kernel symbol table: Normal unused symbols */ | 120 | /* Kernel symbol table: Normal unused symbols */ |
121 | __start___kcrctab_unused = .; | 121 | __start___kcrctab_unused = .; |
122 | *(__kcrctab_unused) | 122 | *(SORT(___kcrctab_unused+*)) |
123 | __stop___kcrctab_unused = .; | 123 | __stop___kcrctab_unused = .; |
124 | 124 | ||
125 | /* Kernel symbol table: GPL-only unused symbols */ | 125 | /* Kernel symbol table: GPL-only unused symbols */ |
126 | __start___kcrctab_unused_gpl = .; | 126 | __start___kcrctab_unused_gpl = .; |
127 | *(__kcrctab_unused_gpl) | 127 | *(SORT(___kcrctab_unused_gpl+*)) |
128 | __stop___kcrctab_unused_gpl = .; | 128 | __stop___kcrctab_unused_gpl = .; |
129 | 129 | ||
130 | /* Kernel symbol table: GPL-future symbols */ | 130 | /* Kernel symbol table: GPL-future symbols */ |
131 | __start___kcrctab_gpl_future = .; | 131 | __start___kcrctab_gpl_future = .; |
132 | *(__kcrctab_gpl_future) | 132 | *(SORT(___kcrctab_gpl_future+*)) |
133 | __stop___kcrctab_gpl_future = .; | 133 | __stop___kcrctab_gpl_future = .; |
134 | 134 | ||
135 | /* Kernel symbol table: strings */ | 135 | /* Kernel symbol table: strings */ |
diff --git a/arch/m68k/lib/memcpy.c b/arch/m68k/lib/memcpy.c index 62182c81e91c..064889316974 100644 --- a/arch/m68k/lib/memcpy.c +++ b/arch/m68k/lib/memcpy.c | |||
@@ -34,8 +34,10 @@ void *memcpy(void *to, const void *from, size_t n) | |||
34 | if (temp) { | 34 | if (temp) { |
35 | long *lto = to; | 35 | long *lto = to; |
36 | const long *lfrom = from; | 36 | const long *lfrom = from; |
37 | #if defined(__mc68020__) || defined(__mc68030__) || \ | 37 | #if defined(CONFIG_M68000) || defined(CONFIG_COLDFIRE) |
38 | defined(__mc68040__) || defined(__mc68060__) || defined(__mcpu32__) | 38 | for (; temp; temp--) |
39 | *lto++ = *lfrom++; | ||
40 | #else | ||
39 | asm volatile ( | 41 | asm volatile ( |
40 | " movel %2,%3\n" | 42 | " movel %2,%3\n" |
41 | " andw #7,%3\n" | 43 | " andw #7,%3\n" |
@@ -56,9 +58,6 @@ void *memcpy(void *to, const void *from, size_t n) | |||
56 | " jpl 4b" | 58 | " jpl 4b" |
57 | : "=a" (lfrom), "=a" (lto), "=d" (temp), "=&d" (temp1) | 59 | : "=a" (lfrom), "=a" (lto), "=d" (temp), "=&d" (temp1) |
58 | : "0" (lfrom), "1" (lto), "2" (temp)); | 60 | : "0" (lfrom), "1" (lto), "2" (temp)); |
59 | #else | ||
60 | for (; temp; temp--) | ||
61 | *lto++ = *lfrom++; | ||
62 | #endif | 61 | #endif |
63 | to = lto; | 62 | to = lto; |
64 | from = lfrom; | 63 | from = lfrom; |
diff --git a/arch/m68k/lib/memset.c b/arch/m68k/lib/memset.c index f649e6a2e644..8a7639f0a2fe 100644 --- a/arch/m68k/lib/memset.c +++ b/arch/m68k/lib/memset.c | |||
@@ -32,8 +32,10 @@ void *memset(void *s, int c, size_t count) | |||
32 | temp = count >> 2; | 32 | temp = count >> 2; |
33 | if (temp) { | 33 | if (temp) { |
34 | long *ls = s; | 34 | long *ls = s; |
35 | #if defined(__mc68020__) || defined(__mc68030__) || \ | 35 | #if defined(CONFIG_M68000) || defined(CONFIG_COLDFIRE) |
36 | defined(__mc68040__) || defined(__mc68060__) || defined(__mcpu32__) | 36 | for (; temp; temp--) |
37 | *ls++ = c; | ||
38 | #else | ||
37 | size_t temp1; | 39 | size_t temp1; |
38 | asm volatile ( | 40 | asm volatile ( |
39 | " movel %1,%2\n" | 41 | " movel %1,%2\n" |
@@ -55,9 +57,6 @@ void *memset(void *s, int c, size_t count) | |||
55 | " jpl 1b" | 57 | " jpl 1b" |
56 | : "=a" (ls), "=d" (temp), "=&d" (temp1) | 58 | : "=a" (ls), "=d" (temp), "=&d" (temp1) |
57 | : "d" (c), "0" (ls), "1" (temp)); | 59 | : "d" (c), "0" (ls), "1" (temp)); |
58 | #else | ||
59 | for (; temp; temp--) | ||
60 | *ls++ = c; | ||
61 | #endif | 60 | #endif |
62 | s = ls; | 61 | s = ls; |
63 | } | 62 | } |
diff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c index 079bafca073e..79e928a525d0 100644 --- a/arch/m68k/lib/muldi3.c +++ b/arch/m68k/lib/muldi3.c | |||
@@ -19,17 +19,7 @@ along with GNU CC; see the file COPYING. If not, write to | |||
19 | the Free Software Foundation, 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. */ | 20 | Boston, MA 02111-1307, USA. */ |
21 | 21 | ||
22 | #if defined(__mc68020__) || defined(__mc68030__) || \ | 22 | #if defined(CONFIG_M68000) || defined(CONFIG_COLDFIRE) |
23 | defined(__mc68040__) || defined(__mc68060__) || defined(__mcpu32__) | ||
24 | |||
25 | #define umul_ppmm(w1, w0, u, v) \ | ||
26 | __asm__ ("mulu%.l %3,%1:%0" \ | ||
27 | : "=d" ((USItype)(w0)), \ | ||
28 | "=d" ((USItype)(w1)) \ | ||
29 | : "%0" ((USItype)(u)), \ | ||
30 | "dmi" ((USItype)(v))) | ||
31 | |||
32 | #else | ||
33 | 23 | ||
34 | #define SI_TYPE_SIZE 32 | 24 | #define SI_TYPE_SIZE 32 |
35 | #define __BITS4 (SI_TYPE_SIZE / 4) | 25 | #define __BITS4 (SI_TYPE_SIZE / 4) |
@@ -61,6 +51,15 @@ Boston, MA 02111-1307, USA. */ | |||
61 | (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0); \ | 51 | (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0); \ |
62 | } while (0) | 52 | } while (0) |
63 | 53 | ||
54 | #else | ||
55 | |||
56 | #define umul_ppmm(w1, w0, u, v) \ | ||
57 | __asm__ ("mulu%.l %3,%1:%0" \ | ||
58 | : "=d" ((USItype)(w0)), \ | ||
59 | "=d" ((USItype)(w1)) \ | ||
60 | : "%0" ((USItype)(u)), \ | ||
61 | "dmi" ((USItype)(v))) | ||
62 | |||
64 | #endif | 63 | #endif |
65 | 64 | ||
66 | #define __umulsidi3(u, v) \ | 65 | #define __umulsidi3(u, v) \ |
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig index 37862b2ce363..807c97eed8a8 100644 --- a/arch/mips/configs/mtx1_defconfig +++ b/arch/mips/configs/mtx1_defconfig | |||
@@ -678,7 +678,7 @@ CONFIG_LEDS_TRIGGERS=y | |||
678 | CONFIG_LEDS_TRIGGER_TIMER=y | 678 | CONFIG_LEDS_TRIGGER_TIMER=y |
679 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 679 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
680 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | 680 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y |
681 | CONFIG_RTC_CLASS=m | 681 | CONFIG_RTC_CLASS=y |
682 | CONFIG_RTC_INTF_DEV_UIE_EMUL=y | 682 | CONFIG_RTC_INTF_DEV_UIE_EMUL=y |
683 | CONFIG_RTC_DRV_TEST=m | 683 | CONFIG_RTC_DRV_TEST=m |
684 | CONFIG_RTC_DRV_DS1307=m | 684 | CONFIG_RTC_DRV_DS1307=m |
diff --git a/arch/powerpc/configs/52xx/pcm030_defconfig b/arch/powerpc/configs/52xx/pcm030_defconfig index 7f7e4a878602..22e719575c60 100644 --- a/arch/powerpc/configs/52xx/pcm030_defconfig +++ b/arch/powerpc/configs/52xx/pcm030_defconfig | |||
@@ -85,7 +85,7 @@ CONFIG_USB_OHCI_HCD=m | |||
85 | CONFIG_USB_OHCI_HCD_PPC_OF_BE=y | 85 | CONFIG_USB_OHCI_HCD_PPC_OF_BE=y |
86 | # CONFIG_USB_OHCI_HCD_PCI is not set | 86 | # CONFIG_USB_OHCI_HCD_PCI is not set |
87 | CONFIG_USB_STORAGE=m | 87 | CONFIG_USB_STORAGE=m |
88 | CONFIG_RTC_CLASS=m | 88 | CONFIG_RTC_CLASS=y |
89 | CONFIG_RTC_DRV_PCF8563=m | 89 | CONFIG_RTC_DRV_PCF8563=m |
90 | CONFIG_EXT2_FS=m | 90 | CONFIG_EXT2_FS=m |
91 | CONFIG_EXT3_FS=m | 91 | CONFIG_EXT3_FS=m |
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig index 6472322bf13b..185c292b0f1c 100644 --- a/arch/powerpc/configs/ps3_defconfig +++ b/arch/powerpc/configs/ps3_defconfig | |||
@@ -141,7 +141,7 @@ CONFIG_USB_EHCI_TT_NEWSCHED=y | |||
141 | # CONFIG_USB_EHCI_HCD_PPC_OF is not set | 141 | # CONFIG_USB_EHCI_HCD_PPC_OF is not set |
142 | CONFIG_USB_OHCI_HCD=m | 142 | CONFIG_USB_OHCI_HCD=m |
143 | CONFIG_USB_STORAGE=m | 143 | CONFIG_USB_STORAGE=m |
144 | CONFIG_RTC_CLASS=m | 144 | CONFIG_RTC_CLASS=y |
145 | CONFIG_RTC_DRV_PS3=m | 145 | CONFIG_RTC_DRV_PS3=m |
146 | CONFIG_EXT2_FS=m | 146 | CONFIG_EXT2_FS=m |
147 | CONFIG_EXT3_FS=m | 147 | CONFIG_EXT3_FS=m |
diff --git a/arch/sh/configs/titan_defconfig b/arch/sh/configs/titan_defconfig index 0f558914e760..e2cbd92d520b 100644 --- a/arch/sh/configs/titan_defconfig +++ b/arch/sh/configs/titan_defconfig | |||
@@ -227,7 +227,7 @@ CONFIG_USB_SERIAL=m | |||
227 | CONFIG_USB_SERIAL_GENERIC=y | 227 | CONFIG_USB_SERIAL_GENERIC=y |
228 | CONFIG_USB_SERIAL_ARK3116=m | 228 | CONFIG_USB_SERIAL_ARK3116=m |
229 | CONFIG_USB_SERIAL_PL2303=m | 229 | CONFIG_USB_SERIAL_PL2303=m |
230 | CONFIG_RTC_CLASS=m | 230 | CONFIG_RTC_CLASS=y |
231 | CONFIG_RTC_DRV_SH=m | 231 | CONFIG_RTC_DRV_SH=m |
232 | CONFIG_EXT2_FS=y | 232 | CONFIG_EXT2_FS=y |
233 | CONFIG_EXT3_FS=y | 233 | CONFIG_EXT3_FS=y |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index b511a011b7d0..adc66c3a1fef 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -632,14 +632,14 @@ late_initcall(uv_init_heartbeat); | |||
632 | 632 | ||
633 | /* Direct Legacy VGA I/O traffic to designated IOH */ | 633 | /* Direct Legacy VGA I/O traffic to designated IOH */ |
634 | int uv_set_vga_state(struct pci_dev *pdev, bool decode, | 634 | int uv_set_vga_state(struct pci_dev *pdev, bool decode, |
635 | unsigned int command_bits, bool change_bridge) | 635 | unsigned int command_bits, u32 flags) |
636 | { | 636 | { |
637 | int domain, bus, rc; | 637 | int domain, bus, rc; |
638 | 638 | ||
639 | PR_DEVEL("devfn %x decode %d cmd %x chg_brdg %d\n", | 639 | PR_DEVEL("devfn %x decode %d cmd %x flags %d\n", |
640 | pdev->devfn, decode, command_bits, change_bridge); | 640 | pdev->devfn, decode, command_bits, flags); |
641 | 641 | ||
642 | if (!change_bridge) | 642 | if (!(flags & PCI_VGA_STATE_CHANGE_BRIDGE)) |
643 | return 0; | 643 | return 0; |
644 | 644 | ||
645 | if ((command_bits & PCI_COMMAND_IO) == 0) | 645 | if ((command_bits & PCI_COMMAND_IO) == 0) |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 2e4928d45a2d..e1ba8cb24e4e 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -337,7 +337,7 @@ EXPORT_SYMBOL(boot_option_idle_override); | |||
337 | * Powermanagement idle function, if any.. | 337 | * Powermanagement idle function, if any.. |
338 | */ | 338 | */ |
339 | void (*pm_idle)(void); | 339 | void (*pm_idle)(void); |
340 | #if defined(CONFIG_APM_MODULE) && defined(CONFIG_APM_CPU_IDLE) | 340 | #ifdef CONFIG_APM_MODULE |
341 | EXPORT_SYMBOL(pm_idle); | 341 | EXPORT_SYMBOL(pm_idle); |
342 | #endif | 342 | #endif |
343 | 343 | ||
@@ -399,7 +399,7 @@ void default_idle(void) | |||
399 | cpu_relax(); | 399 | cpu_relax(); |
400 | } | 400 | } |
401 | } | 401 | } |
402 | #if defined(CONFIG_APM_MODULE) && defined(CONFIG_APM_CPU_IDLE) | 402 | #ifdef CONFIG_APM_MODULE |
403 | EXPORT_SYMBOL(default_idle); | 403 | EXPORT_SYMBOL(default_idle); |
404 | #endif | 404 | #endif |
405 | 405 | ||
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 051474c65b78..34d6a1cab8de 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -163,11 +163,32 @@ static irqreturn_t hpet_interrupt(int irq, void *data) | |||
163 | * This has the effect of treating non-periodic like periodic. | 163 | * This has the effect of treating non-periodic like periodic. |
164 | */ | 164 | */ |
165 | if ((devp->hd_flags & (HPET_IE | HPET_PERIODIC)) == HPET_IE) { | 165 | if ((devp->hd_flags & (HPET_IE | HPET_PERIODIC)) == HPET_IE) { |
166 | unsigned long m, t; | 166 | unsigned long m, t, mc, base, k; |
167 | struct hpet __iomem *hpet = devp->hd_hpet; | ||
168 | struct hpets *hpetp = devp->hd_hpets; | ||
167 | 169 | ||
168 | t = devp->hd_ireqfreq; | 170 | t = devp->hd_ireqfreq; |
169 | m = read_counter(&devp->hd_timer->hpet_compare); | 171 | m = read_counter(&devp->hd_timer->hpet_compare); |
170 | write_counter(t + m, &devp->hd_timer->hpet_compare); | 172 | mc = read_counter(&hpet->hpet_mc); |
173 | /* The time for the next interrupt would logically be t + m, | ||
174 | * however, if we are very unlucky and the interrupt is delayed | ||
175 | * for longer than t then we will completely miss the next | ||
176 | * interrupt if we set t + m and an application will hang. | ||
177 | * Therefore we need to make a more complex computation assuming | ||
178 | * that there exists a k for which the following is true: | ||
179 | * k * t + base < mc + delta | ||
180 | * (k + 1) * t + base > mc + delta | ||
181 | * where t is the interval in hpet ticks for the given freq, | ||
182 | * base is the theoretical start value 0 < base < t, | ||
183 | * mc is the main counter value at the time of the interrupt, | ||
184 | * delta is the time it takes to write the a value to the | ||
185 | * comparator. | ||
186 | * k may then be computed as (mc - base + delta) / t . | ||
187 | */ | ||
188 | base = mc % t; | ||
189 | k = (mc - base + hpetp->hp_delta) / t; | ||
190 | write_counter(t * (k + 1) + base, | ||
191 | &devp->hd_timer->hpet_compare); | ||
171 | } | 192 | } |
172 | 193 | ||
173 | if (devp->hd_flags & HPET_SHARED_IRQ) | 194 | if (devp->hd_flags & HPET_SHARED_IRQ) |
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index b60a4c263686..853f92d23ddb 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c | |||
@@ -387,6 +387,7 @@ static void __exit cpufreq_stats_exit(void) | |||
387 | unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier); | 387 | unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier); |
388 | for_each_online_cpu(cpu) { | 388 | for_each_online_cpu(cpu) { |
389 | cpufreq_stats_free_table(cpu); | 389 | cpufreq_stats_free_table(cpu); |
390 | cpufreq_stats_free_sysfs(cpu); | ||
390 | } | 391 | } |
391 | } | 392 | } |
392 | 393 | ||
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 3e257a50bf56..61e1ef90d4e5 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c | |||
@@ -46,10 +46,11 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev, | |||
46 | list_for_each_entry(entry, &dev->maplist, head) { | 46 | list_for_each_entry(entry, &dev->maplist, head) { |
47 | /* | 47 | /* |
48 | * Because the kernel-userspace ABI is fixed at a 32-bit offset | 48 | * Because the kernel-userspace ABI is fixed at a 32-bit offset |
49 | * while PCI resources may live above that, we ignore the map | 49 | * while PCI resources may live above that, we only compare the |
50 | * offset for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS. | 50 | * lower 32 bits of the map offset for maps of type |
51 | * It is assumed that each driver will have only one resource of | 51 | * _DRM_FRAMEBUFFER or _DRM_REGISTERS. |
52 | * each type. | 52 | * It is assumed that if a driver have more than one resource |
53 | * of each type, the lower 32 bits are different. | ||
53 | */ | 54 | */ |
54 | if (!entry->map || | 55 | if (!entry->map || |
55 | map->type != entry->map->type || | 56 | map->type != entry->map->type || |
@@ -59,9 +60,12 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev, | |||
59 | case _DRM_SHM: | 60 | case _DRM_SHM: |
60 | if (map->flags != _DRM_CONTAINS_LOCK) | 61 | if (map->flags != _DRM_CONTAINS_LOCK) |
61 | break; | 62 | break; |
63 | return entry; | ||
62 | case _DRM_REGISTERS: | 64 | case _DRM_REGISTERS: |
63 | case _DRM_FRAME_BUFFER: | 65 | case _DRM_FRAME_BUFFER: |
64 | return entry; | 66 | if ((entry->map->offset & 0xffffffff) == |
67 | (map->offset & 0xffffffff)) | ||
68 | return entry; | ||
65 | default: /* Make gcc happy */ | 69 | default: /* Make gcc happy */ |
66 | ; | 70 | ; |
67 | } | 71 | } |
@@ -183,9 +187,6 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset, | |||
183 | return -EINVAL; | 187 | return -EINVAL; |
184 | } | 188 | } |
185 | #endif | 189 | #endif |
186 | #ifdef __alpha__ | ||
187 | map->offset += dev->hose->mem_space->start; | ||
188 | #endif | ||
189 | /* Some drivers preinitialize some maps, without the X Server | 190 | /* Some drivers preinitialize some maps, without the X Server |
190 | * needing to be aware of it. Therefore, we just return success | 191 | * needing to be aware of it. Therefore, we just return success |
191 | * when the server tries to create a duplicate map. | 192 | * when the server tries to create a duplicate map. |
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 872747c5a544..21058e6ad2b8 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -1113,7 +1113,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data, | |||
1113 | if (card_res->count_fbs >= fb_count) { | 1113 | if (card_res->count_fbs >= fb_count) { |
1114 | copied = 0; | 1114 | copied = 0; |
1115 | fb_id = (uint32_t __user *)(unsigned long)card_res->fb_id_ptr; | 1115 | fb_id = (uint32_t __user *)(unsigned long)card_res->fb_id_ptr; |
1116 | list_for_each_entry(fb, &file_priv->fbs, head) { | 1116 | list_for_each_entry(fb, &file_priv->fbs, filp_head) { |
1117 | if (put_user(fb->base.id, fb_id + copied)) { | 1117 | if (put_user(fb->base.id, fb_id + copied)) { |
1118 | ret = -EFAULT; | 1118 | ret = -EFAULT; |
1119 | goto out; | 1119 | goto out; |
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index 2c3fcbdfd8ff..5db96d45fc71 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c | |||
@@ -526,7 +526,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) | |||
526 | static resource_size_t drm_core_get_reg_ofs(struct drm_device *dev) | 526 | static resource_size_t drm_core_get_reg_ofs(struct drm_device *dev) |
527 | { | 527 | { |
528 | #ifdef __alpha__ | 528 | #ifdef __alpha__ |
529 | return dev->hose->dense_mem_base - dev->hose->mem_space->start; | 529 | return dev->hose->dense_mem_base; |
530 | #else | 530 | #else |
531 | return 0; | 531 | return 0; |
532 | #endif | 532 | #endif |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 12d32579b951..94c84d744100 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -465,8 +465,10 @@ i915_gem_shmem_pread_slow(struct drm_device *dev, | |||
465 | 465 | ||
466 | page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT, | 466 | page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT, |
467 | GFP_HIGHUSER | __GFP_RECLAIMABLE); | 467 | GFP_HIGHUSER | __GFP_RECLAIMABLE); |
468 | if (IS_ERR(page)) | 468 | if (IS_ERR(page)) { |
469 | return PTR_ERR(page); | 469 | ret = PTR_ERR(page); |
470 | goto out; | ||
471 | } | ||
470 | 472 | ||
471 | if (do_bit17_swizzling) { | 473 | if (do_bit17_swizzling) { |
472 | slow_shmem_bit17_copy(page, | 474 | slow_shmem_bit17_copy(page, |
diff --git a/drivers/gpu/drm/mga/mga_drv.h b/drivers/gpu/drm/mga/mga_drv.h index 1084fa4d261b..54558a01969a 100644 --- a/drivers/gpu/drm/mga/mga_drv.h +++ b/drivers/gpu/drm/mga/mga_drv.h | |||
@@ -195,29 +195,10 @@ extern long mga_compat_ioctl(struct file *filp, unsigned int cmd, | |||
195 | 195 | ||
196 | #define mga_flush_write_combine() DRM_WRITEMEMORYBARRIER() | 196 | #define mga_flush_write_combine() DRM_WRITEMEMORYBARRIER() |
197 | 197 | ||
198 | #if defined(__linux__) && defined(__alpha__) | ||
199 | #define MGA_BASE(reg) ((unsigned long)(dev_priv->mmio->handle)) | ||
200 | #define MGA_ADDR(reg) (MGA_BASE(reg) + reg) | ||
201 | |||
202 | #define MGA_DEREF(reg) (*(volatile u32 *)MGA_ADDR(reg)) | ||
203 | #define MGA_DEREF8(reg) (*(volatile u8 *)MGA_ADDR(reg)) | ||
204 | |||
205 | #define MGA_READ(reg) (_MGA_READ((u32 *)MGA_ADDR(reg))) | ||
206 | #define MGA_READ8(reg) (_MGA_READ((u8 *)MGA_ADDR(reg))) | ||
207 | #define MGA_WRITE(reg, val) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF(reg) = val; } while (0) | ||
208 | #define MGA_WRITE8(reg, val) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF8(reg) = val; } while (0) | ||
209 | |||
210 | static inline u32 _MGA_READ(u32 *addr) | ||
211 | { | ||
212 | DRM_MEMORYBARRIER(); | ||
213 | return *(volatile u32 *)addr; | ||
214 | } | ||
215 | #else | ||
216 | #define MGA_READ8(reg) DRM_READ8(dev_priv->mmio, (reg)) | 198 | #define MGA_READ8(reg) DRM_READ8(dev_priv->mmio, (reg)) |
217 | #define MGA_READ(reg) DRM_READ32(dev_priv->mmio, (reg)) | 199 | #define MGA_READ(reg) DRM_READ32(dev_priv->mmio, (reg)) |
218 | #define MGA_WRITE8(reg, val) DRM_WRITE8(dev_priv->mmio, (reg), (val)) | 200 | #define MGA_WRITE8(reg, val) DRM_WRITE8(dev_priv->mmio, (reg), (val)) |
219 | #define MGA_WRITE(reg, val) DRM_WRITE32(dev_priv->mmio, (reg), (val)) | 201 | #define MGA_WRITE(reg, val) DRM_WRITE32(dev_priv->mmio, (reg), (val)) |
220 | #endif | ||
221 | 202 | ||
222 | #define DWGREG0 0x1c00 | 203 | #define DWGREG0 0x1c00 |
223 | #define DWGREG0_END 0x1dff | 204 | #define DWGREG0_END 0x1dff |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 98ea597bc76d..86157b172c88 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -2944,7 +2944,7 @@ restart_ih: | |||
2944 | radeon_fence_process(rdev); | 2944 | radeon_fence_process(rdev); |
2945 | break; | 2945 | break; |
2946 | case 233: /* GUI IDLE */ | 2946 | case 233: /* GUI IDLE */ |
2947 | DRM_DEBUG("IH: CP EOP\n"); | 2947 | DRM_DEBUG("IH: GUI idle\n"); |
2948 | rdev->pm.gui_idle = true; | 2948 | rdev->pm.gui_idle = true; |
2949 | wake_up(&rdev->irq.idle_queue); | 2949 | wake_up(&rdev->irq.idle_queue); |
2950 | break; | 2950 | break; |
diff --git a/drivers/gpu/drm/radeon/r100_track.h b/drivers/gpu/drm/radeon/r100_track.h index 2fef9de7f363..686f9dc5d4bd 100644 --- a/drivers/gpu/drm/radeon/r100_track.h +++ b/drivers/gpu/drm/radeon/r100_track.h | |||
@@ -63,7 +63,7 @@ struct r100_cs_track { | |||
63 | unsigned num_arrays; | 63 | unsigned num_arrays; |
64 | unsigned max_indx; | 64 | unsigned max_indx; |
65 | unsigned color_channel_mask; | 65 | unsigned color_channel_mask; |
66 | struct r100_cs_track_array arrays[11]; | 66 | struct r100_cs_track_array arrays[16]; |
67 | struct r100_cs_track_cb cb[R300_MAX_CB]; | 67 | struct r100_cs_track_cb cb[R300_MAX_CB]; |
68 | struct r100_cs_track_cb zb; | 68 | struct r100_cs_track_cb zb; |
69 | struct r100_cs_track_cb aa; | 69 | struct r100_cs_track_cb aa; |
@@ -146,6 +146,12 @@ static inline int r100_packet3_load_vbpntr(struct radeon_cs_parser *p, | |||
146 | ib = p->ib->ptr; | 146 | ib = p->ib->ptr; |
147 | track = (struct r100_cs_track *)p->track; | 147 | track = (struct r100_cs_track *)p->track; |
148 | c = radeon_get_ib_value(p, idx++) & 0x1F; | 148 | c = radeon_get_ib_value(p, idx++) & 0x1F; |
149 | if (c > 16) { | ||
150 | DRM_ERROR("Only 16 vertex buffers are allowed %d\n", | ||
151 | pkt->opcode); | ||
152 | r100_cs_dump_packet(p, pkt); | ||
153 | return -EINVAL; | ||
154 | } | ||
149 | track->num_arrays = c; | 155 | track->num_arrays = c; |
150 | for (i = 0; i < (c - 1); i+=2, idx+=3) { | 156 | for (i = 0; i < (c - 1); i+=2, idx+=3) { |
151 | r = r100_cs_packet_next_reloc(p, &reloc); | 157 | r = r100_cs_packet_next_reloc(p, &reloc); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index d74d4d71437f..7dd45ca64e29 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -3444,7 +3444,7 @@ restart_ih: | |||
3444 | radeon_fence_process(rdev); | 3444 | radeon_fence_process(rdev); |
3445 | break; | 3445 | break; |
3446 | case 233: /* GUI IDLE */ | 3446 | case 233: /* GUI IDLE */ |
3447 | DRM_DEBUG("IH: CP EOP\n"); | 3447 | DRM_DEBUG("IH: GUI idle\n"); |
3448 | rdev->pm.gui_idle = true; | 3448 | rdev->pm.gui_idle = true; |
3449 | wake_up(&rdev->irq.idle_queue); | 3449 | wake_up(&rdev->irq.idle_queue); |
3450 | break; | 3450 | break; |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index ba643b576054..27f45579e64b 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -165,6 +165,7 @@ struct radeon_clock { | |||
165 | uint32_t default_sclk; | 165 | uint32_t default_sclk; |
166 | uint32_t default_dispclk; | 166 | uint32_t default_dispclk; |
167 | uint32_t dp_extclk; | 167 | uint32_t dp_extclk; |
168 | uint32_t max_pixel_clock; | ||
168 | }; | 169 | }; |
169 | 170 | ||
170 | /* | 171 | /* |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 90dfb2b8cf03..fa62a503ae70 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -1246,6 +1246,10 @@ bool radeon_atom_get_clock_info(struct drm_device *dev) | |||
1246 | } | 1246 | } |
1247 | *dcpll = *p1pll; | 1247 | *dcpll = *p1pll; |
1248 | 1248 | ||
1249 | rdev->clock.max_pixel_clock = le16_to_cpu(firmware_info->info.usMaxPixelClock); | ||
1250 | if (rdev->clock.max_pixel_clock == 0) | ||
1251 | rdev->clock.max_pixel_clock = 40000; | ||
1252 | |||
1249 | return true; | 1253 | return true; |
1250 | } | 1254 | } |
1251 | 1255 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_clocks.c b/drivers/gpu/drm/radeon/radeon_clocks.c index 5249af8931e6..2d48e7a1474b 100644 --- a/drivers/gpu/drm/radeon/radeon_clocks.c +++ b/drivers/gpu/drm/radeon/radeon_clocks.c | |||
@@ -117,7 +117,7 @@ static bool __devinit radeon_read_clocks_OF(struct drm_device *dev) | |||
117 | p1pll->reference_div = RREG32_PLL(RADEON_PPLL_REF_DIV) & 0x3ff; | 117 | p1pll->reference_div = RREG32_PLL(RADEON_PPLL_REF_DIV) & 0x3ff; |
118 | if (p1pll->reference_div < 2) | 118 | if (p1pll->reference_div < 2) |
119 | p1pll->reference_div = 12; | 119 | p1pll->reference_div = 12; |
120 | p2pll->reference_div = p1pll->reference_div; | 120 | p2pll->reference_div = p1pll->reference_div; |
121 | 121 | ||
122 | /* These aren't in the device-tree */ | 122 | /* These aren't in the device-tree */ |
123 | if (rdev->family >= CHIP_R420) { | 123 | if (rdev->family >= CHIP_R420) { |
@@ -139,6 +139,8 @@ static bool __devinit radeon_read_clocks_OF(struct drm_device *dev) | |||
139 | p2pll->pll_out_min = 12500; | 139 | p2pll->pll_out_min = 12500; |
140 | p2pll->pll_out_max = 35000; | 140 | p2pll->pll_out_max = 35000; |
141 | } | 141 | } |
142 | /* not sure what the max should be in all cases */ | ||
143 | rdev->clock.max_pixel_clock = 35000; | ||
142 | 144 | ||
143 | spll->reference_freq = mpll->reference_freq = p1pll->reference_freq; | 145 | spll->reference_freq = mpll->reference_freq = p1pll->reference_freq; |
144 | spll->reference_div = mpll->reference_div = | 146 | spll->reference_div = mpll->reference_div = |
@@ -151,7 +153,7 @@ static bool __devinit radeon_read_clocks_OF(struct drm_device *dev) | |||
151 | else | 153 | else |
152 | rdev->clock.default_sclk = | 154 | rdev->clock.default_sclk = |
153 | radeon_legacy_get_engine_clock(rdev); | 155 | radeon_legacy_get_engine_clock(rdev); |
154 | 156 | ||
155 | val = of_get_property(dp, "ATY,MCLK", NULL); | 157 | val = of_get_property(dp, "ATY,MCLK", NULL); |
156 | if (val && *val) | 158 | if (val && *val) |
157 | rdev->clock.default_mclk = (*val) / 10; | 159 | rdev->clock.default_mclk = (*val) / 10; |
@@ -160,7 +162,7 @@ static bool __devinit radeon_read_clocks_OF(struct drm_device *dev) | |||
160 | radeon_legacy_get_memory_clock(rdev); | 162 | radeon_legacy_get_memory_clock(rdev); |
161 | 163 | ||
162 | DRM_INFO("Using device-tree clock info\n"); | 164 | DRM_INFO("Using device-tree clock info\n"); |
163 | 165 | ||
164 | return true; | 166 | return true; |
165 | } | 167 | } |
166 | #else | 168 | #else |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 5b991f7c6e2a..797c8bcbb6a4 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -866,6 +866,11 @@ bool radeon_combios_get_clock_info(struct drm_device *dev) | |||
866 | rdev->clock.default_sclk = sclk; | 866 | rdev->clock.default_sclk = sclk; |
867 | rdev->clock.default_mclk = mclk; | 867 | rdev->clock.default_mclk = mclk; |
868 | 868 | ||
869 | if (RBIOS32(pll_info + 0x16)) | ||
870 | rdev->clock.max_pixel_clock = RBIOS32(pll_info + 0x16); | ||
871 | else | ||
872 | rdev->clock.max_pixel_clock = 35000; /* might need something asic specific */ | ||
873 | |||
869 | return true; | 874 | return true; |
870 | } | 875 | } |
871 | return false; | 876 | return false; |
@@ -1548,9 +1553,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1548 | (rdev->pdev->subsystem_device == 0x4a48)) { | 1553 | (rdev->pdev->subsystem_device == 0x4a48)) { |
1549 | /* Mac X800 */ | 1554 | /* Mac X800 */ |
1550 | rdev->mode_info.connector_table = CT_MAC_X800; | 1555 | rdev->mode_info.connector_table = CT_MAC_X800; |
1551 | } else if ((rdev->pdev->device == 0x4150) && | 1556 | } else if (of_machine_is_compatible("PowerMac7,2") || |
1552 | (rdev->pdev->subsystem_vendor == 0x1002) && | 1557 | of_machine_is_compatible("PowerMac7,3")) { |
1553 | (rdev->pdev->subsystem_device == 0x4150)) { | ||
1554 | /* Mac G5 9600 */ | 1558 | /* Mac G5 9600 */ |
1555 | rdev->mode_info.connector_table = CT_MAC_G5_9600; | 1559 | rdev->mode_info.connector_table = CT_MAC_G5_9600; |
1556 | } else | 1560 | } else |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index ee1dccb3fec9..9c2929c7e79f 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -626,8 +626,14 @@ static int radeon_vga_get_modes(struct drm_connector *connector) | |||
626 | static int radeon_vga_mode_valid(struct drm_connector *connector, | 626 | static int radeon_vga_mode_valid(struct drm_connector *connector, |
627 | struct drm_display_mode *mode) | 627 | struct drm_display_mode *mode) |
628 | { | 628 | { |
629 | struct drm_device *dev = connector->dev; | ||
630 | struct radeon_device *rdev = dev->dev_private; | ||
631 | |||
629 | /* XXX check mode bandwidth */ | 632 | /* XXX check mode bandwidth */ |
630 | /* XXX verify against max DAC output frequency */ | 633 | |
634 | if ((mode->clock / 10) > rdev->clock.max_pixel_clock) | ||
635 | return MODE_CLOCK_HIGH; | ||
636 | |||
631 | return MODE_OK; | 637 | return MODE_OK; |
632 | } | 638 | } |
633 | 639 | ||
@@ -1015,6 +1021,11 @@ static int radeon_dvi_mode_valid(struct drm_connector *connector, | |||
1015 | } else | 1021 | } else |
1016 | return MODE_CLOCK_HIGH; | 1022 | return MODE_CLOCK_HIGH; |
1017 | } | 1023 | } |
1024 | |||
1025 | /* check against the max pixel clock */ | ||
1026 | if ((mode->clock / 10) > rdev->clock.max_pixel_clock) | ||
1027 | return MODE_CLOCK_HIGH; | ||
1028 | |||
1018 | return MODE_OK; | 1029 | return MODE_OK; |
1019 | } | 1030 | } |
1020 | 1031 | ||
diff --git a/drivers/gpu/drm/savage/savage_bci.c b/drivers/gpu/drm/savage/savage_bci.c index bf5f83ea14fe..cb1ee4e0050a 100644 --- a/drivers/gpu/drm/savage/savage_bci.c +++ b/drivers/gpu/drm/savage/savage_bci.c | |||
@@ -647,9 +647,6 @@ int savage_driver_firstopen(struct drm_device *dev) | |||
647 | ret = drm_addmap(dev, aperture_base, SAVAGE_APERTURE_SIZE, | 647 | ret = drm_addmap(dev, aperture_base, SAVAGE_APERTURE_SIZE, |
648 | _DRM_FRAME_BUFFER, _DRM_WRITE_COMBINING, | 648 | _DRM_FRAME_BUFFER, _DRM_WRITE_COMBINING, |
649 | &dev_priv->aperture); | 649 | &dev_priv->aperture); |
650 | if (ret) | ||
651 | return ret; | ||
652 | |||
653 | return ret; | 650 | return ret; |
654 | } | 651 | } |
655 | 652 | ||
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 23f0d5e99f35..713d43b4e563 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -1,3 +1,10 @@ | |||
1 | config LEDS_GPIO_REGISTER | ||
2 | bool | ||
3 | help | ||
4 | This option provides the function gpio_led_register_device. | ||
5 | As this function is used by arch code it must not be compiled as a | ||
6 | module. | ||
7 | |||
1 | menuconfig NEW_LEDS | 8 | menuconfig NEW_LEDS |
2 | bool "LED Support" | 9 | bool "LED Support" |
3 | help | 10 | help |
@@ -7,22 +14,14 @@ menuconfig NEW_LEDS | |||
7 | This is not related to standard keyboard LEDs which are controlled | 14 | This is not related to standard keyboard LEDs which are controlled |
8 | via the input system. | 15 | via the input system. |
9 | 16 | ||
17 | if NEW_LEDS | ||
18 | |||
10 | config LEDS_CLASS | 19 | config LEDS_CLASS |
11 | bool "LED Class Support" | 20 | bool "LED Class Support" |
12 | depends on NEW_LEDS | ||
13 | help | 21 | help |
14 | This option enables the led sysfs class in /sys/class/leds. You'll | 22 | This option enables the led sysfs class in /sys/class/leds. You'll |
15 | need this to do anything useful with LEDs. If unsure, say N. | 23 | need this to do anything useful with LEDs. If unsure, say N. |
16 | 24 | ||
17 | config LEDS_GPIO_REGISTER | ||
18 | bool | ||
19 | help | ||
20 | This option provides the function gpio_led_register_device. | ||
21 | As this function is used by arch code it must not be compiled as a | ||
22 | module. | ||
23 | |||
24 | if NEW_LEDS | ||
25 | |||
26 | comment "LED drivers" | 25 | comment "LED drivers" |
27 | 26 | ||
28 | config LEDS_88PM860X | 27 | config LEDS_88PM860X |
@@ -391,6 +390,7 @@ config LEDS_NETXBIG | |||
391 | 390 | ||
392 | config LEDS_ASIC3 | 391 | config LEDS_ASIC3 |
393 | bool "LED support for the HTC ASIC3" | 392 | bool "LED support for the HTC ASIC3" |
393 | depends on LEDS_CLASS | ||
394 | depends on MFD_ASIC3 | 394 | depends on MFD_ASIC3 |
395 | default y | 395 | default y |
396 | help | 396 | help |
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 70bd738b8b99..574b09afedd3 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -534,6 +534,82 @@ void bitmap_print_sb(struct bitmap *bitmap) | |||
534 | kunmap_atomic(sb, KM_USER0); | 534 | kunmap_atomic(sb, KM_USER0); |
535 | } | 535 | } |
536 | 536 | ||
537 | /* | ||
538 | * bitmap_new_disk_sb | ||
539 | * @bitmap | ||
540 | * | ||
541 | * This function is somewhat the reverse of bitmap_read_sb. bitmap_read_sb | ||
542 | * reads and verifies the on-disk bitmap superblock and populates bitmap_info. | ||
543 | * This function verifies 'bitmap_info' and populates the on-disk bitmap | ||
544 | * structure, which is to be written to disk. | ||
545 | * | ||
546 | * Returns: 0 on success, -Exxx on error | ||
547 | */ | ||
548 | static int bitmap_new_disk_sb(struct bitmap *bitmap) | ||
549 | { | ||
550 | bitmap_super_t *sb; | ||
551 | unsigned long chunksize, daemon_sleep, write_behind; | ||
552 | int err = -EINVAL; | ||
553 | |||
554 | bitmap->sb_page = alloc_page(GFP_KERNEL); | ||
555 | if (IS_ERR(bitmap->sb_page)) { | ||
556 | err = PTR_ERR(bitmap->sb_page); | ||
557 | bitmap->sb_page = NULL; | ||
558 | return err; | ||
559 | } | ||
560 | bitmap->sb_page->index = 0; | ||
561 | |||
562 | sb = kmap_atomic(bitmap->sb_page, KM_USER0); | ||
563 | |||
564 | sb->magic = cpu_to_le32(BITMAP_MAGIC); | ||
565 | sb->version = cpu_to_le32(BITMAP_MAJOR_HI); | ||
566 | |||
567 | chunksize = bitmap->mddev->bitmap_info.chunksize; | ||
568 | BUG_ON(!chunksize); | ||
569 | if (!is_power_of_2(chunksize)) { | ||
570 | kunmap_atomic(sb, KM_USER0); | ||
571 | printk(KERN_ERR "bitmap chunksize not a power of 2\n"); | ||
572 | return -EINVAL; | ||
573 | } | ||
574 | sb->chunksize = cpu_to_le32(chunksize); | ||
575 | |||
576 | daemon_sleep = bitmap->mddev->bitmap_info.daemon_sleep; | ||
577 | if (!daemon_sleep || | ||
578 | (daemon_sleep < 1) || (daemon_sleep > MAX_SCHEDULE_TIMEOUT)) { | ||
579 | printk(KERN_INFO "Choosing daemon_sleep default (5 sec)\n"); | ||
580 | daemon_sleep = 5 * HZ; | ||
581 | } | ||
582 | sb->daemon_sleep = cpu_to_le32(daemon_sleep); | ||
583 | bitmap->mddev->bitmap_info.daemon_sleep = daemon_sleep; | ||
584 | |||
585 | /* | ||
586 | * FIXME: write_behind for RAID1. If not specified, what | ||
587 | * is a good choice? We choose COUNTER_MAX / 2 arbitrarily. | ||
588 | */ | ||
589 | write_behind = bitmap->mddev->bitmap_info.max_write_behind; | ||
590 | if (write_behind > COUNTER_MAX) | ||
591 | write_behind = COUNTER_MAX / 2; | ||
592 | sb->write_behind = cpu_to_le32(write_behind); | ||
593 | bitmap->mddev->bitmap_info.max_write_behind = write_behind; | ||
594 | |||
595 | /* keep the array size field of the bitmap superblock up to date */ | ||
596 | sb->sync_size = cpu_to_le64(bitmap->mddev->resync_max_sectors); | ||
597 | |||
598 | memcpy(sb->uuid, bitmap->mddev->uuid, 16); | ||
599 | |||
600 | bitmap->flags |= BITMAP_STALE; | ||
601 | sb->state |= cpu_to_le32(BITMAP_STALE); | ||
602 | bitmap->events_cleared = bitmap->mddev->events; | ||
603 | sb->events_cleared = cpu_to_le64(bitmap->mddev->events); | ||
604 | |||
605 | bitmap->flags |= BITMAP_HOSTENDIAN; | ||
606 | sb->version = cpu_to_le32(BITMAP_MAJOR_HOSTENDIAN); | ||
607 | |||
608 | kunmap_atomic(sb, KM_USER0); | ||
609 | |||
610 | return 0; | ||
611 | } | ||
612 | |||
537 | /* read the superblock from the bitmap file and initialize some bitmap fields */ | 613 | /* read the superblock from the bitmap file and initialize some bitmap fields */ |
538 | static int bitmap_read_sb(struct bitmap *bitmap) | 614 | static int bitmap_read_sb(struct bitmap *bitmap) |
539 | { | 615 | { |
@@ -575,7 +651,7 @@ static int bitmap_read_sb(struct bitmap *bitmap) | |||
575 | reason = "unrecognized superblock version"; | 651 | reason = "unrecognized superblock version"; |
576 | else if (chunksize < 512) | 652 | else if (chunksize < 512) |
577 | reason = "bitmap chunksize too small"; | 653 | reason = "bitmap chunksize too small"; |
578 | else if ((1 << ffz(~chunksize)) != chunksize) | 654 | else if (!is_power_of_2(chunksize)) |
579 | reason = "bitmap chunksize not a power of 2"; | 655 | reason = "bitmap chunksize not a power of 2"; |
580 | else if (daemon_sleep < 1 || daemon_sleep > MAX_SCHEDULE_TIMEOUT) | 656 | else if (daemon_sleep < 1 || daemon_sleep > MAX_SCHEDULE_TIMEOUT) |
581 | reason = "daemon sleep period out of range"; | 657 | reason = "daemon sleep period out of range"; |
@@ -1076,8 +1152,8 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start) | |||
1076 | } | 1152 | } |
1077 | 1153 | ||
1078 | printk(KERN_INFO "%s: bitmap initialized from disk: " | 1154 | printk(KERN_INFO "%s: bitmap initialized from disk: " |
1079 | "read %lu/%lu pages, set %lu bits\n", | 1155 | "read %lu/%lu pages, set %lu of %lu bits\n", |
1080 | bmname(bitmap), bitmap->file_pages, num_pages, bit_cnt); | 1156 | bmname(bitmap), bitmap->file_pages, num_pages, bit_cnt, chunks); |
1081 | 1157 | ||
1082 | return 0; | 1158 | return 0; |
1083 | 1159 | ||
@@ -1332,7 +1408,7 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect | |||
1332 | return 0; | 1408 | return 0; |
1333 | } | 1409 | } |
1334 | 1410 | ||
1335 | if (unlikely((*bmc & COUNTER_MAX) == COUNTER_MAX)) { | 1411 | if (unlikely(COUNTER(*bmc) == COUNTER_MAX)) { |
1336 | DEFINE_WAIT(__wait); | 1412 | DEFINE_WAIT(__wait); |
1337 | /* note that it is safe to do the prepare_to_wait | 1413 | /* note that it is safe to do the prepare_to_wait |
1338 | * after the test as long as we do it before dropping | 1414 | * after the test as long as we do it before dropping |
@@ -1404,10 +1480,10 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto | |||
1404 | sysfs_notify_dirent_safe(bitmap->sysfs_can_clear); | 1480 | sysfs_notify_dirent_safe(bitmap->sysfs_can_clear); |
1405 | } | 1481 | } |
1406 | 1482 | ||
1407 | if (!success && ! (*bmc & NEEDED_MASK)) | 1483 | if (!success && !NEEDED(*bmc)) |
1408 | *bmc |= NEEDED_MASK; | 1484 | *bmc |= NEEDED_MASK; |
1409 | 1485 | ||
1410 | if ((*bmc & COUNTER_MAX) == COUNTER_MAX) | 1486 | if (COUNTER(*bmc) == COUNTER_MAX) |
1411 | wake_up(&bitmap->overflow_wait); | 1487 | wake_up(&bitmap->overflow_wait); |
1412 | 1488 | ||
1413 | (*bmc)--; | 1489 | (*bmc)--; |
@@ -1728,9 +1804,16 @@ int bitmap_create(mddev_t *mddev) | |||
1728 | vfs_fsync(file, 1); | 1804 | vfs_fsync(file, 1); |
1729 | } | 1805 | } |
1730 | /* read superblock from bitmap file (this sets mddev->bitmap_info.chunksize) */ | 1806 | /* read superblock from bitmap file (this sets mddev->bitmap_info.chunksize) */ |
1731 | if (!mddev->bitmap_info.external) | 1807 | if (!mddev->bitmap_info.external) { |
1732 | err = bitmap_read_sb(bitmap); | 1808 | /* |
1733 | else { | 1809 | * If 'MD_ARRAY_FIRST_USE' is set, then device-mapper is |
1810 | * instructing us to create a new on-disk bitmap instance. | ||
1811 | */ | ||
1812 | if (test_and_clear_bit(MD_ARRAY_FIRST_USE, &mddev->flags)) | ||
1813 | err = bitmap_new_disk_sb(bitmap); | ||
1814 | else | ||
1815 | err = bitmap_read_sb(bitmap); | ||
1816 | } else { | ||
1734 | err = 0; | 1817 | err = 0; |
1735 | if (mddev->bitmap_info.chunksize == 0 || | 1818 | if (mddev->bitmap_info.chunksize == 0 || |
1736 | mddev->bitmap_info.daemon_sleep == 0) | 1819 | mddev->bitmap_info.daemon_sleep == 0) |
@@ -1754,9 +1837,6 @@ int bitmap_create(mddev_t *mddev) | |||
1754 | bitmap->chunks = chunks; | 1837 | bitmap->chunks = chunks; |
1755 | bitmap->pages = pages; | 1838 | bitmap->pages = pages; |
1756 | bitmap->missing_pages = pages; | 1839 | bitmap->missing_pages = pages; |
1757 | bitmap->counter_bits = COUNTER_BITS; | ||
1758 | |||
1759 | bitmap->syncchunk = ~0UL; | ||
1760 | 1840 | ||
1761 | #ifdef INJECT_FATAL_FAULT_1 | 1841 | #ifdef INJECT_FATAL_FAULT_1 |
1762 | bitmap->bp = NULL; | 1842 | bitmap->bp = NULL; |
diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h index d0aeaf46d932..b2a127e891ac 100644 --- a/drivers/md/bitmap.h +++ b/drivers/md/bitmap.h | |||
@@ -85,7 +85,6 @@ | |||
85 | typedef __u16 bitmap_counter_t; | 85 | typedef __u16 bitmap_counter_t; |
86 | #define COUNTER_BITS 16 | 86 | #define COUNTER_BITS 16 |
87 | #define COUNTER_BIT_SHIFT 4 | 87 | #define COUNTER_BIT_SHIFT 4 |
88 | #define COUNTER_BYTE_RATIO (COUNTER_BITS / 8) | ||
89 | #define COUNTER_BYTE_SHIFT (COUNTER_BIT_SHIFT - 3) | 88 | #define COUNTER_BYTE_SHIFT (COUNTER_BIT_SHIFT - 3) |
90 | 89 | ||
91 | #define NEEDED_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 1))) | 90 | #define NEEDED_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 1))) |
@@ -196,19 +195,10 @@ struct bitmap { | |||
196 | 195 | ||
197 | mddev_t *mddev; /* the md device that the bitmap is for */ | 196 | mddev_t *mddev; /* the md device that the bitmap is for */ |
198 | 197 | ||
199 | int counter_bits; /* how many bits per block counter */ | ||
200 | |||
201 | /* bitmap chunksize -- how much data does each bit represent? */ | 198 | /* bitmap chunksize -- how much data does each bit represent? */ |
202 | unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */ | 199 | unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */ |
203 | unsigned long chunks; /* total number of data chunks for the array */ | 200 | unsigned long chunks; /* total number of data chunks for the array */ |
204 | 201 | ||
205 | /* We hold a count on the chunk currently being synced, and drop | ||
206 | * it when the last block is started. If the resync is aborted | ||
207 | * midway, we need to be able to drop that count, so we remember | ||
208 | * the counted chunk.. | ||
209 | */ | ||
210 | unsigned long syncchunk; | ||
211 | |||
212 | __u64 events_cleared; | 202 | __u64 events_cleared; |
213 | int need_sync; | 203 | int need_sync; |
214 | 204 | ||
diff --git a/drivers/md/md.c b/drivers/md/md.c index aa640a85bb21..4332fc2f25d4 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -351,6 +351,9 @@ void mddev_resume(mddev_t *mddev) | |||
351 | mddev->suspended = 0; | 351 | mddev->suspended = 0; |
352 | wake_up(&mddev->sb_wait); | 352 | wake_up(&mddev->sb_wait); |
353 | mddev->pers->quiesce(mddev, 0); | 353 | mddev->pers->quiesce(mddev, 0); |
354 | |||
355 | md_wakeup_thread(mddev->thread); | ||
356 | md_wakeup_thread(mddev->sync_thread); /* possibly kick off a reshape */ | ||
354 | } | 357 | } |
355 | EXPORT_SYMBOL_GPL(mddev_resume); | 358 | EXPORT_SYMBOL_GPL(mddev_resume); |
356 | 359 | ||
@@ -1750,6 +1753,18 @@ static struct super_type super_types[] = { | |||
1750 | }, | 1753 | }, |
1751 | }; | 1754 | }; |
1752 | 1755 | ||
1756 | static void sync_super(mddev_t *mddev, mdk_rdev_t *rdev) | ||
1757 | { | ||
1758 | if (mddev->sync_super) { | ||
1759 | mddev->sync_super(mddev, rdev); | ||
1760 | return; | ||
1761 | } | ||
1762 | |||
1763 | BUG_ON(mddev->major_version >= ARRAY_SIZE(super_types)); | ||
1764 | |||
1765 | super_types[mddev->major_version].sync_super(mddev, rdev); | ||
1766 | } | ||
1767 | |||
1753 | static int match_mddev_units(mddev_t *mddev1, mddev_t *mddev2) | 1768 | static int match_mddev_units(mddev_t *mddev1, mddev_t *mddev2) |
1754 | { | 1769 | { |
1755 | mdk_rdev_t *rdev, *rdev2; | 1770 | mdk_rdev_t *rdev, *rdev2; |
@@ -1781,8 +1796,8 @@ int md_integrity_register(mddev_t *mddev) | |||
1781 | 1796 | ||
1782 | if (list_empty(&mddev->disks)) | 1797 | if (list_empty(&mddev->disks)) |
1783 | return 0; /* nothing to do */ | 1798 | return 0; /* nothing to do */ |
1784 | if (blk_get_integrity(mddev->gendisk)) | 1799 | if (!mddev->gendisk || blk_get_integrity(mddev->gendisk)) |
1785 | return 0; /* already registered */ | 1800 | return 0; /* shouldn't register, or already is */ |
1786 | list_for_each_entry(rdev, &mddev->disks, same_set) { | 1801 | list_for_each_entry(rdev, &mddev->disks, same_set) { |
1787 | /* skip spares and non-functional disks */ | 1802 | /* skip spares and non-functional disks */ |
1788 | if (test_bit(Faulty, &rdev->flags)) | 1803 | if (test_bit(Faulty, &rdev->flags)) |
@@ -2168,8 +2183,7 @@ static void sync_sbs(mddev_t * mddev, int nospares) | |||
2168 | /* Don't update this superblock */ | 2183 | /* Don't update this superblock */ |
2169 | rdev->sb_loaded = 2; | 2184 | rdev->sb_loaded = 2; |
2170 | } else { | 2185 | } else { |
2171 | super_types[mddev->major_version]. | 2186 | sync_super(mddev, rdev); |
2172 | sync_super(mddev, rdev); | ||
2173 | rdev->sb_loaded = 1; | 2187 | rdev->sb_loaded = 1; |
2174 | } | 2188 | } |
2175 | } | 2189 | } |
@@ -2462,7 +2476,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
2462 | if (rdev->raid_disk == -1) | 2476 | if (rdev->raid_disk == -1) |
2463 | return -EEXIST; | 2477 | return -EEXIST; |
2464 | /* personality does all needed checks */ | 2478 | /* personality does all needed checks */ |
2465 | if (rdev->mddev->pers->hot_add_disk == NULL) | 2479 | if (rdev->mddev->pers->hot_remove_disk == NULL) |
2466 | return -EINVAL; | 2480 | return -EINVAL; |
2467 | err = rdev->mddev->pers-> | 2481 | err = rdev->mddev->pers-> |
2468 | hot_remove_disk(rdev->mddev, rdev->raid_disk); | 2482 | hot_remove_disk(rdev->mddev, rdev->raid_disk); |
@@ -4619,9 +4633,6 @@ int md_run(mddev_t *mddev) | |||
4619 | if (mddev->flags) | 4633 | if (mddev->flags) |
4620 | md_update_sb(mddev, 0); | 4634 | md_update_sb(mddev, 0); |
4621 | 4635 | ||
4622 | md_wakeup_thread(mddev->thread); | ||
4623 | md_wakeup_thread(mddev->sync_thread); /* possibly kick off a reshape */ | ||
4624 | |||
4625 | md_new_event(mddev); | 4636 | md_new_event(mddev); |
4626 | sysfs_notify_dirent_safe(mddev->sysfs_state); | 4637 | sysfs_notify_dirent_safe(mddev->sysfs_state); |
4627 | sysfs_notify_dirent_safe(mddev->sysfs_action); | 4638 | sysfs_notify_dirent_safe(mddev->sysfs_action); |
@@ -4642,6 +4653,10 @@ static int do_md_run(mddev_t *mddev) | |||
4642 | bitmap_destroy(mddev); | 4653 | bitmap_destroy(mddev); |
4643 | goto out; | 4654 | goto out; |
4644 | } | 4655 | } |
4656 | |||
4657 | md_wakeup_thread(mddev->thread); | ||
4658 | md_wakeup_thread(mddev->sync_thread); /* possibly kick off a reshape */ | ||
4659 | |||
4645 | set_capacity(mddev->gendisk, mddev->array_sectors); | 4660 | set_capacity(mddev->gendisk, mddev->array_sectors); |
4646 | revalidate_disk(mddev->gendisk); | 4661 | revalidate_disk(mddev->gendisk); |
4647 | mddev->changed = 1; | 4662 | mddev->changed = 1; |
@@ -5259,6 +5274,8 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | |||
5259 | if (mddev->degraded) | 5274 | if (mddev->degraded) |
5260 | set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); | 5275 | set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); |
5261 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 5276 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
5277 | if (!err) | ||
5278 | md_new_event(mddev); | ||
5262 | md_wakeup_thread(mddev->thread); | 5279 | md_wakeup_thread(mddev->thread); |
5263 | return err; | 5280 | return err; |
5264 | } | 5281 | } |
@@ -6866,8 +6883,8 @@ void md_do_sync(mddev_t *mddev) | |||
6866 | * Tune reconstruction: | 6883 | * Tune reconstruction: |
6867 | */ | 6884 | */ |
6868 | window = 32*(PAGE_SIZE/512); | 6885 | window = 32*(PAGE_SIZE/512); |
6869 | printk(KERN_INFO "md: using %dk window, over a total of %llu blocks.\n", | 6886 | printk(KERN_INFO "md: using %dk window, over a total of %lluk.\n", |
6870 | window/2,(unsigned long long) max_sectors/2); | 6887 | window/2, (unsigned long long)max_sectors/2); |
6871 | 6888 | ||
6872 | atomic_set(&mddev->recovery_active, 0); | 6889 | atomic_set(&mddev->recovery_active, 0); |
6873 | last_check = 0; | 6890 | last_check = 0; |
@@ -7045,7 +7062,6 @@ void md_do_sync(mddev_t *mddev) | |||
7045 | } | 7062 | } |
7046 | EXPORT_SYMBOL_GPL(md_do_sync); | 7063 | EXPORT_SYMBOL_GPL(md_do_sync); |
7047 | 7064 | ||
7048 | |||
7049 | static int remove_and_add_spares(mddev_t *mddev) | 7065 | static int remove_and_add_spares(mddev_t *mddev) |
7050 | { | 7066 | { |
7051 | mdk_rdev_t *rdev; | 7067 | mdk_rdev_t *rdev; |
@@ -7157,6 +7173,9 @@ static void reap_sync_thread(mddev_t *mddev) | |||
7157 | */ | 7173 | */ |
7158 | void md_check_recovery(mddev_t *mddev) | 7174 | void md_check_recovery(mddev_t *mddev) |
7159 | { | 7175 | { |
7176 | if (mddev->suspended) | ||
7177 | return; | ||
7178 | |||
7160 | if (mddev->bitmap) | 7179 | if (mddev->bitmap) |
7161 | bitmap_daemon_work(mddev); | 7180 | bitmap_daemon_work(mddev); |
7162 | 7181 | ||
diff --git a/drivers/md/md.h b/drivers/md/md.h index 0b1fd3f1d85b..1c26c7a08ae6 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -124,6 +124,7 @@ struct mddev_s | |||
124 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ | 124 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ |
125 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ | 125 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ |
126 | #define MD_CHANGE_PENDING 2 /* switch from 'clean' to 'active' in progress */ | 126 | #define MD_CHANGE_PENDING 2 /* switch from 'clean' to 'active' in progress */ |
127 | #define MD_ARRAY_FIRST_USE 3 /* First use of array, needs initialization */ | ||
127 | 128 | ||
128 | int suspended; | 129 | int suspended; |
129 | atomic_t active_io; | 130 | atomic_t active_io; |
@@ -330,6 +331,7 @@ struct mddev_s | |||
330 | atomic_t flush_pending; | 331 | atomic_t flush_pending; |
331 | struct work_struct flush_work; | 332 | struct work_struct flush_work; |
332 | struct work_struct event_work; /* used by dm to report failure event */ | 333 | struct work_struct event_work; /* used by dm to report failure event */ |
334 | void (*sync_super)(mddev_t *mddev, mdk_rdev_t *rdev); | ||
333 | }; | 335 | }; |
334 | 336 | ||
335 | 337 | ||
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 5d096096f958..f7431b6d8447 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -497,21 +497,19 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio) | |||
497 | return best_disk; | 497 | return best_disk; |
498 | } | 498 | } |
499 | 499 | ||
500 | static int raid1_congested(void *data, int bits) | 500 | int md_raid1_congested(mddev_t *mddev, int bits) |
501 | { | 501 | { |
502 | mddev_t *mddev = data; | ||
503 | conf_t *conf = mddev->private; | 502 | conf_t *conf = mddev->private; |
504 | int i, ret = 0; | 503 | int i, ret = 0; |
505 | 504 | ||
506 | if (mddev_congested(mddev, bits)) | ||
507 | return 1; | ||
508 | |||
509 | rcu_read_lock(); | 505 | rcu_read_lock(); |
510 | for (i = 0; i < mddev->raid_disks; i++) { | 506 | for (i = 0; i < mddev->raid_disks; i++) { |
511 | mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); | 507 | mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); |
512 | if (rdev && !test_bit(Faulty, &rdev->flags)) { | 508 | if (rdev && !test_bit(Faulty, &rdev->flags)) { |
513 | struct request_queue *q = bdev_get_queue(rdev->bdev); | 509 | struct request_queue *q = bdev_get_queue(rdev->bdev); |
514 | 510 | ||
511 | BUG_ON(!q); | ||
512 | |||
515 | /* Note the '|| 1' - when read_balance prefers | 513 | /* Note the '|| 1' - when read_balance prefers |
516 | * non-congested targets, it can be removed | 514 | * non-congested targets, it can be removed |
517 | */ | 515 | */ |
@@ -524,7 +522,15 @@ static int raid1_congested(void *data, int bits) | |||
524 | rcu_read_unlock(); | 522 | rcu_read_unlock(); |
525 | return ret; | 523 | return ret; |
526 | } | 524 | } |
525 | EXPORT_SYMBOL_GPL(md_raid1_congested); | ||
527 | 526 | ||
527 | static int raid1_congested(void *data, int bits) | ||
528 | { | ||
529 | mddev_t *mddev = data; | ||
530 | |||
531 | return mddev_congested(mddev, bits) || | ||
532 | md_raid1_congested(mddev, bits); | ||
533 | } | ||
528 | 534 | ||
529 | static void flush_pending_writes(conf_t *conf) | 535 | static void flush_pending_writes(conf_t *conf) |
530 | { | 536 | { |
@@ -1972,6 +1978,8 @@ static int run(mddev_t *mddev) | |||
1972 | return PTR_ERR(conf); | 1978 | return PTR_ERR(conf); |
1973 | 1979 | ||
1974 | list_for_each_entry(rdev, &mddev->disks, same_set) { | 1980 | list_for_each_entry(rdev, &mddev->disks, same_set) { |
1981 | if (!mddev->gendisk) | ||
1982 | continue; | ||
1975 | disk_stack_limits(mddev->gendisk, rdev->bdev, | 1983 | disk_stack_limits(mddev->gendisk, rdev->bdev, |
1976 | rdev->data_offset << 9); | 1984 | rdev->data_offset << 9); |
1977 | /* as we don't honour merge_bvec_fn, we must never risk | 1985 | /* as we don't honour merge_bvec_fn, we must never risk |
@@ -2013,8 +2021,10 @@ static int run(mddev_t *mddev) | |||
2013 | 2021 | ||
2014 | md_set_array_sectors(mddev, raid1_size(mddev, 0, 0)); | 2022 | md_set_array_sectors(mddev, raid1_size(mddev, 0, 0)); |
2015 | 2023 | ||
2016 | mddev->queue->backing_dev_info.congested_fn = raid1_congested; | 2024 | if (mddev->queue) { |
2017 | mddev->queue->backing_dev_info.congested_data = mddev; | 2025 | mddev->queue->backing_dev_info.congested_fn = raid1_congested; |
2026 | mddev->queue->backing_dev_info.congested_data = mddev; | ||
2027 | } | ||
2018 | return md_integrity_register(mddev); | 2028 | return md_integrity_register(mddev); |
2019 | } | 2029 | } |
2020 | 2030 | ||
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h index 5fc4ca1af863..e743a64fac4f 100644 --- a/drivers/md/raid1.h +++ b/drivers/md/raid1.h | |||
@@ -126,4 +126,6 @@ struct r1bio_s { | |||
126 | */ | 126 | */ |
127 | #define R1BIO_Returned 6 | 127 | #define R1BIO_Returned 6 |
128 | 128 | ||
129 | extern int md_raid1_congested(mddev_t *mddev, int bits); | ||
130 | |||
129 | #endif | 131 | #endif |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 346e69bfdab3..b72edf35ec54 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -129,7 +129,7 @@ static inline int raid5_dec_bi_hw_segments(struct bio *bio) | |||
129 | 129 | ||
130 | static inline void raid5_set_bi_hw_segments(struct bio *bio, unsigned int cnt) | 130 | static inline void raid5_set_bi_hw_segments(struct bio *bio, unsigned int cnt) |
131 | { | 131 | { |
132 | bio->bi_phys_segments = raid5_bi_phys_segments(bio) || (cnt << 16); | 132 | bio->bi_phys_segments = raid5_bi_phys_segments(bio) | (cnt << 16); |
133 | } | 133 | } |
134 | 134 | ||
135 | /* Find first data disk in a raid6 stripe */ | 135 | /* Find first data disk in a raid6 stripe */ |
@@ -514,7 +514,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) | |||
514 | bi = &sh->dev[i].req; | 514 | bi = &sh->dev[i].req; |
515 | 515 | ||
516 | bi->bi_rw = rw; | 516 | bi->bi_rw = rw; |
517 | if (rw == WRITE) | 517 | if (rw & WRITE) |
518 | bi->bi_end_io = raid5_end_write_request; | 518 | bi->bi_end_io = raid5_end_write_request; |
519 | else | 519 | else |
520 | bi->bi_end_io = raid5_end_read_request; | 520 | bi->bi_end_io = raid5_end_read_request; |
@@ -548,13 +548,13 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) | |||
548 | bi->bi_io_vec[0].bv_offset = 0; | 548 | bi->bi_io_vec[0].bv_offset = 0; |
549 | bi->bi_size = STRIPE_SIZE; | 549 | bi->bi_size = STRIPE_SIZE; |
550 | bi->bi_next = NULL; | 550 | bi->bi_next = NULL; |
551 | if (rw == WRITE && | 551 | if ((rw & WRITE) && |
552 | test_bit(R5_ReWrite, &sh->dev[i].flags)) | 552 | test_bit(R5_ReWrite, &sh->dev[i].flags)) |
553 | atomic_add(STRIPE_SECTORS, | 553 | atomic_add(STRIPE_SECTORS, |
554 | &rdev->corrected_errors); | 554 | &rdev->corrected_errors); |
555 | generic_make_request(bi); | 555 | generic_make_request(bi); |
556 | } else { | 556 | } else { |
557 | if (rw == WRITE) | 557 | if (rw & WRITE) |
558 | set_bit(STRIPE_DEGRADED, &sh->state); | 558 | set_bit(STRIPE_DEGRADED, &sh->state); |
559 | pr_debug("skip op %ld on disc %d for sector %llu\n", | 559 | pr_debug("skip op %ld on disc %d for sector %llu\n", |
560 | bi->bi_rw, i, (unsigned long long)sh->sector); | 560 | bi->bi_rw, i, (unsigned long long)sh->sector); |
@@ -585,7 +585,7 @@ async_copy_data(int frombio, struct bio *bio, struct page *page, | |||
585 | init_async_submit(&submit, flags, tx, NULL, NULL, NULL); | 585 | init_async_submit(&submit, flags, tx, NULL, NULL, NULL); |
586 | 586 | ||
587 | bio_for_each_segment(bvl, bio, i) { | 587 | bio_for_each_segment(bvl, bio, i) { |
588 | int len = bio_iovec_idx(bio, i)->bv_len; | 588 | int len = bvl->bv_len; |
589 | int clen; | 589 | int clen; |
590 | int b_offset = 0; | 590 | int b_offset = 0; |
591 | 591 | ||
@@ -601,8 +601,8 @@ async_copy_data(int frombio, struct bio *bio, struct page *page, | |||
601 | clen = len; | 601 | clen = len; |
602 | 602 | ||
603 | if (clen > 0) { | 603 | if (clen > 0) { |
604 | b_offset += bio_iovec_idx(bio, i)->bv_offset; | 604 | b_offset += bvl->bv_offset; |
605 | bio_page = bio_iovec_idx(bio, i)->bv_page; | 605 | bio_page = bvl->bv_page; |
606 | if (frombio) | 606 | if (frombio) |
607 | tx = async_memcpy(page, bio_page, page_offset, | 607 | tx = async_memcpy(page, bio_page, page_offset, |
608 | b_offset, clen, &submit); | 608 | b_offset, clen, &submit); |
@@ -4858,7 +4858,7 @@ static raid5_conf_t *setup_conf(mddev_t *mddev) | |||
4858 | printk(KERN_INFO "md/raid:%s: device %s operational as raid" | 4858 | printk(KERN_INFO "md/raid:%s: device %s operational as raid" |
4859 | " disk %d\n", | 4859 | " disk %d\n", |
4860 | mdname(mddev), bdevname(rdev->bdev, b), raid_disk); | 4860 | mdname(mddev), bdevname(rdev->bdev, b), raid_disk); |
4861 | } else | 4861 | } else if (rdev->saved_raid_disk != raid_disk) |
4862 | /* Cannot rely on bitmap to complete recovery */ | 4862 | /* Cannot rely on bitmap to complete recovery */ |
4863 | conf->fullsync = 1; | 4863 | conf->fullsync = 1; |
4864 | } | 4864 | } |
diff --git a/drivers/misc/apds990x.c b/drivers/misc/apds990x.c index 200311fea369..e2a52e5cf449 100644 --- a/drivers/misc/apds990x.c +++ b/drivers/misc/apds990x.c | |||
@@ -609,6 +609,7 @@ static int apds990x_detect(struct apds990x_chip *chip) | |||
609 | return ret; | 609 | return ret; |
610 | } | 610 | } |
611 | 611 | ||
612 | #if defined(CONFIG_PM) || defined(CONFIG_PM_RUNTIME) | ||
612 | static int apds990x_chip_on(struct apds990x_chip *chip) | 613 | static int apds990x_chip_on(struct apds990x_chip *chip) |
613 | { | 614 | { |
614 | int err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), | 615 | int err = regulator_bulk_enable(ARRAY_SIZE(chip->regs), |
@@ -624,6 +625,7 @@ static int apds990x_chip_on(struct apds990x_chip *chip) | |||
624 | apds990x_mode_on(chip); | 625 | apds990x_mode_on(chip); |
625 | return 0; | 626 | return 0; |
626 | } | 627 | } |
628 | #endif | ||
627 | 629 | ||
628 | static int apds990x_chip_off(struct apds990x_chip *chip) | 630 | static int apds990x_chip_off(struct apds990x_chip *chip) |
629 | { | 631 | { |
diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c index e01e08c8c88b..bc685bfc4c33 100644 --- a/drivers/misc/cs5535-mfgpt.c +++ b/drivers/misc/cs5535-mfgpt.c | |||
@@ -174,7 +174,7 @@ struct cs5535_mfgpt_timer *cs5535_mfgpt_alloc_timer(int timer_nr, int domain) | |||
174 | timer_nr = t < max ? (int) t : -1; | 174 | timer_nr = t < max ? (int) t : -1; |
175 | } else { | 175 | } else { |
176 | /* check if the requested timer's available */ | 176 | /* check if the requested timer's available */ |
177 | if (test_bit(timer_nr, mfgpt->avail)) | 177 | if (!test_bit(timer_nr, mfgpt->avail)) |
178 | timer_nr = -1; | 178 | timer_nr = -1; |
179 | } | 179 | } |
180 | 180 | ||
diff --git a/drivers/misc/spear13xx_pcie_gadget.c b/drivers/misc/spear13xx_pcie_gadget.c index 7aded90f9daa..cfbddbef11de 100644 --- a/drivers/misc/spear13xx_pcie_gadget.c +++ b/drivers/misc/spear13xx_pcie_gadget.c | |||
@@ -845,7 +845,7 @@ err_iounmap: | |||
845 | err_iounmap_app: | 845 | err_iounmap_app: |
846 | iounmap(config->va_app_base); | 846 | iounmap(config->va_app_base); |
847 | err_kzalloc: | 847 | err_kzalloc: |
848 | kfree(config); | 848 | kfree(target); |
849 | err_rel_res: | 849 | err_rel_res: |
850 | release_mem_region(res1->start, resource_size(res1)); | 850 | release_mem_region(res1->start, resource_size(res1)); |
851 | err_rel_res0: | 851 | err_rel_res0: |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 5da5bea0f9f0..7721de942c69 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -1144,9 +1144,17 @@ static int __devinit mmci_probe(struct amba_device *dev, | |||
1144 | else if (ret != -ENOSYS) | 1144 | else if (ret != -ENOSYS) |
1145 | goto err_gpio_cd; | 1145 | goto err_gpio_cd; |
1146 | 1146 | ||
1147 | /* | ||
1148 | * A gpio pin that will detect cards when inserted and removed | ||
1149 | * will most likely want to trigger on the edges if it is | ||
1150 | * 0 when ejected and 1 when inserted (or mutatis mutandis | ||
1151 | * for the inverted case) so we request triggers on both | ||
1152 | * edges. | ||
1153 | */ | ||
1147 | ret = request_any_context_irq(gpio_to_irq(plat->gpio_cd), | 1154 | ret = request_any_context_irq(gpio_to_irq(plat->gpio_cd), |
1148 | mmci_cd_irq, 0, | 1155 | mmci_cd_irq, |
1149 | DRIVER_NAME " (cd)", host); | 1156 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
1157 | DRIVER_NAME " (cd)", host); | ||
1150 | if (ret >= 0) | 1158 | if (ret >= 0) |
1151 | host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd); | 1159 | host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd); |
1152 | } | 1160 | } |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 56098b3e17c0..5f10c23dff94 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -3271,11 +3271,11 @@ void __init pci_register_set_vga_state(arch_set_vga_state_t func) | |||
3271 | } | 3271 | } |
3272 | 3272 | ||
3273 | static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode, | 3273 | static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode, |
3274 | unsigned int command_bits, bool change_bridge) | 3274 | unsigned int command_bits, u32 flags) |
3275 | { | 3275 | { |
3276 | if (arch_set_vga_state) | 3276 | if (arch_set_vga_state) |
3277 | return arch_set_vga_state(dev, decode, command_bits, | 3277 | return arch_set_vga_state(dev, decode, command_bits, |
3278 | change_bridge); | 3278 | flags); |
3279 | return 0; | 3279 | return 0; |
3280 | } | 3280 | } |
3281 | 3281 | ||
diff --git a/drivers/staging/iio/accel/adis16201.h b/drivers/staging/iio/accel/adis16201.h index 0b9b85424dfa..4cc1a5bfab40 100644 --- a/drivers/staging/iio/accel/adis16201.h +++ b/drivers/staging/iio/accel/adis16201.h | |||
@@ -81,7 +81,6 @@ struct adis16201_state { | |||
81 | 81 | ||
82 | int adis16201_set_irq(struct iio_dev *indio_dev, bool enable); | 82 | int adis16201_set_irq(struct iio_dev *indio_dev, bool enable); |
83 | 83 | ||
84 | #ifdef CONFIG_IIO_RING_BUFFER | ||
85 | enum adis16201_scan { | 84 | enum adis16201_scan { |
86 | ADIS16201_SCAN_SUPPLY, | 85 | ADIS16201_SCAN_SUPPLY, |
87 | ADIS16201_SCAN_ACC_X, | 86 | ADIS16201_SCAN_ACC_X, |
@@ -92,6 +91,7 @@ enum adis16201_scan { | |||
92 | ADIS16201_SCAN_INCLI_Y, | 91 | ADIS16201_SCAN_INCLI_Y, |
93 | }; | 92 | }; |
94 | 93 | ||
94 | #ifdef CONFIG_IIO_RING_BUFFER | ||
95 | void adis16201_remove_trigger(struct iio_dev *indio_dev); | 95 | void adis16201_remove_trigger(struct iio_dev *indio_dev); |
96 | int adis16201_probe_trigger(struct iio_dev *indio_dev); | 96 | int adis16201_probe_trigger(struct iio_dev *indio_dev); |
97 | 97 | ||
diff --git a/drivers/staging/iio/accel/adis16203.h b/drivers/staging/iio/accel/adis16203.h index 8bb8ce50c248..175e21bb9b40 100644 --- a/drivers/staging/iio/accel/adis16203.h +++ b/drivers/staging/iio/accel/adis16203.h | |||
@@ -76,7 +76,6 @@ struct adis16203_state { | |||
76 | 76 | ||
77 | int adis16203_set_irq(struct iio_dev *indio_dev, bool enable); | 77 | int adis16203_set_irq(struct iio_dev *indio_dev, bool enable); |
78 | 78 | ||
79 | #ifdef CONFIG_IIO_RING_BUFFER | ||
80 | enum adis16203_scan { | 79 | enum adis16203_scan { |
81 | ADIS16203_SCAN_SUPPLY, | 80 | ADIS16203_SCAN_SUPPLY, |
82 | ADIS16203_SCAN_AUX_ADC, | 81 | ADIS16203_SCAN_AUX_ADC, |
@@ -85,6 +84,7 @@ enum adis16203_scan { | |||
85 | ADIS16203_SCAN_INCLI_Y, | 84 | ADIS16203_SCAN_INCLI_Y, |
86 | }; | 85 | }; |
87 | 86 | ||
87 | #ifdef CONFIG_IIO_RING_BUFFER | ||
88 | void adis16203_remove_trigger(struct iio_dev *indio_dev); | 88 | void adis16203_remove_trigger(struct iio_dev *indio_dev); |
89 | int adis16203_probe_trigger(struct iio_dev *indio_dev); | 89 | int adis16203_probe_trigger(struct iio_dev *indio_dev); |
90 | 90 | ||
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index f2cb7503fcb2..465210930890 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c | |||
@@ -1397,6 +1397,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, | |||
1397 | int fifosize, base_baud; | 1397 | int fifosize, base_baud; |
1398 | int port_type; | 1398 | int port_type; |
1399 | struct pch_uart_driver_data *board; | 1399 | struct pch_uart_driver_data *board; |
1400 | const char *board_name; | ||
1400 | 1401 | ||
1401 | board = &drv_dat[id->driver_data]; | 1402 | board = &drv_dat[id->driver_data]; |
1402 | port_type = board->port_type; | 1403 | port_type = board->port_type; |
@@ -1412,7 +1413,8 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, | |||
1412 | base_baud = 1843200; /* 1.8432MHz */ | 1413 | base_baud = 1843200; /* 1.8432MHz */ |
1413 | 1414 | ||
1414 | /* quirk for CM-iTC board */ | 1415 | /* quirk for CM-iTC board */ |
1415 | if (strstr(dmi_get_system_info(DMI_BOARD_NAME), "CM-iTC")) | 1416 | board_name = dmi_get_system_info(DMI_BOARD_NAME); |
1417 | if (board_name && strstr(board_name, "CM-iTC")) | ||
1416 | base_baud = 192000000; /* 192.0MHz */ | 1418 | base_baud = 192000000; /* 192.0MHz */ |
1417 | 1419 | ||
1418 | switch (port_type) { | 1420 | switch (port_type) { |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index ebb893c49e90..d7aaec5667bf 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -248,10 +248,6 @@ static int atyfb_sync(struct fb_info *info); | |||
248 | 248 | ||
249 | static int aty_init(struct fb_info *info); | 249 | static int aty_init(struct fb_info *info); |
250 | 250 | ||
251 | #ifdef CONFIG_ATARI | ||
252 | static int store_video_par(char *videopar, unsigned char m64_num); | ||
253 | #endif | ||
254 | |||
255 | static void aty_get_crtc(const struct atyfb_par *par, struct crtc *crtc); | 251 | static void aty_get_crtc(const struct atyfb_par *par, struct crtc *crtc); |
256 | 252 | ||
257 | static void aty_set_crtc(const struct atyfb_par *par, const struct crtc *crtc); | 253 | static void aty_set_crtc(const struct atyfb_par *par, const struct crtc *crtc); |
@@ -2268,11 +2264,13 @@ error: | |||
2268 | return; | 2264 | return; |
2269 | } | 2265 | } |
2270 | 2266 | ||
2267 | #ifdef CONFIG_PCI | ||
2271 | static void aty_bl_exit(struct backlight_device *bd) | 2268 | static void aty_bl_exit(struct backlight_device *bd) |
2272 | { | 2269 | { |
2273 | backlight_device_unregister(bd); | 2270 | backlight_device_unregister(bd); |
2274 | printk("aty: Backlight unloaded\n"); | 2271 | printk("aty: Backlight unloaded\n"); |
2275 | } | 2272 | } |
2273 | #endif /* CONFIG_PCI */ | ||
2276 | 2274 | ||
2277 | #endif /* CONFIG_FB_ATY_BACKLIGHT */ | 2275 | #endif /* CONFIG_FB_ATY_BACKLIGHT */ |
2278 | 2276 | ||
@@ -2789,7 +2787,7 @@ aty_init_exit: | |||
2789 | return ret; | 2787 | return ret; |
2790 | } | 2788 | } |
2791 | 2789 | ||
2792 | #ifdef CONFIG_ATARI | 2790 | #if defined(CONFIG_ATARI) && !defined(MODULE) |
2793 | static int __devinit store_video_par(char *video_str, unsigned char m64_num) | 2791 | static int __devinit store_video_par(char *video_str, unsigned char m64_num) |
2794 | { | 2792 | { |
2795 | char *p; | 2793 | char *p; |
@@ -2818,7 +2816,7 @@ static int __devinit store_video_par(char *video_str, unsigned char m64_num) | |||
2818 | phys_vmembase[m64_num] = 0; | 2816 | phys_vmembase[m64_num] = 0; |
2819 | return -1; | 2817 | return -1; |
2820 | } | 2818 | } |
2821 | #endif /* CONFIG_ATARI */ | 2819 | #endif /* CONFIG_ATARI && !MODULE */ |
2822 | 2820 | ||
2823 | /* | 2821 | /* |
2824 | * Blank the display. | 2822 | * Blank the display. |
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 0c9373bedd1f..2d93c8d61ad5 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig | |||
@@ -302,6 +302,18 @@ config BACKLIGHT_ADP8860 | |||
302 | To compile this driver as a module, choose M here: the module will | 302 | To compile this driver as a module, choose M here: the module will |
303 | be called adp8860_bl. | 303 | be called adp8860_bl. |
304 | 304 | ||
305 | config BACKLIGHT_ADP8870 | ||
306 | tristate "Backlight Driver for ADP8870 using WLED" | ||
307 | depends on BACKLIGHT_CLASS_DEVICE && I2C | ||
308 | select NEW_LEDS | ||
309 | select LEDS_CLASS | ||
310 | help | ||
311 | If you have a LCD backlight connected to the ADP8870, | ||
312 | say Y here to enable this driver. | ||
313 | |||
314 | To compile this driver as a module, choose M here: the module will | ||
315 | be called adp8870_bl. | ||
316 | |||
305 | config BACKLIGHT_88PM860X | 317 | config BACKLIGHT_88PM860X |
306 | tristate "Backlight Driver for 88PM8606 using WLED" | 318 | tristate "Backlight Driver for 88PM8606 using WLED" |
307 | depends on MFD_88PM860X | 319 | depends on MFD_88PM860X |
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index b9ca8490df87..ee72adb8786e 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile | |||
@@ -34,6 +34,7 @@ obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o | |||
34 | obj-$(CONFIG_BACKLIGHT_ADX) += adx_bl.o | 34 | obj-$(CONFIG_BACKLIGHT_ADX) += adx_bl.o |
35 | obj-$(CONFIG_BACKLIGHT_ADP5520) += adp5520_bl.o | 35 | obj-$(CONFIG_BACKLIGHT_ADP5520) += adp5520_bl.o |
36 | obj-$(CONFIG_BACKLIGHT_ADP8860) += adp8860_bl.o | 36 | obj-$(CONFIG_BACKLIGHT_ADP8860) += adp8860_bl.o |
37 | obj-$(CONFIG_BACKLIGHT_ADP8870) += adp8870_bl.o | ||
37 | obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o | 38 | obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o |
38 | obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o | 39 | obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o |
39 | 40 | ||
diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c new file mode 100644 index 000000000000..05a8832bb3eb --- /dev/null +++ b/drivers/video/backlight/adp8870_bl.c | |||
@@ -0,0 +1,1012 @@ | |||
1 | /* | ||
2 | * Backlight driver for Analog Devices ADP8870 Backlight Devices | ||
3 | * | ||
4 | * Copyright 2009-2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/version.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/errno.h> | ||
13 | #include <linux/pm.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/i2c.h> | ||
16 | #include <linux/fb.h> | ||
17 | #include <linux/backlight.h> | ||
18 | #include <linux/leds.h> | ||
19 | #include <linux/workqueue.h> | ||
20 | #include <linux/slab.h> | ||
21 | |||
22 | #include <linux/i2c/adp8870.h> | ||
23 | #define ADP8870_EXT_FEATURES | ||
24 | #define ADP8870_USE_LEDS | ||
25 | |||
26 | |||
27 | #define ADP8870_MFDVID 0x00 /* Manufacturer and device ID */ | ||
28 | #define ADP8870_MDCR 0x01 /* Device mode and status */ | ||
29 | #define ADP8870_INT_STAT 0x02 /* Interrupts status */ | ||
30 | #define ADP8870_INT_EN 0x03 /* Interrupts enable */ | ||
31 | #define ADP8870_CFGR 0x04 /* Configuration register */ | ||
32 | #define ADP8870_BLSEL 0x05 /* Sink enable backlight or independent */ | ||
33 | #define ADP8870_PWMLED 0x06 /* PWM Enable Selection Register */ | ||
34 | #define ADP8870_BLOFF 0x07 /* Backlight off timeout */ | ||
35 | #define ADP8870_BLDIM 0x08 /* Backlight dim timeout */ | ||
36 | #define ADP8870_BLFR 0x09 /* Backlight fade in and out rates */ | ||
37 | #define ADP8870_BLMX1 0x0A /* Backlight (Brightness Level 1-daylight) maximum current */ | ||
38 | #define ADP8870_BLDM1 0x0B /* Backlight (Brightness Level 1-daylight) dim current */ | ||
39 | #define ADP8870_BLMX2 0x0C /* Backlight (Brightness Level 2-bright) maximum current */ | ||
40 | #define ADP8870_BLDM2 0x0D /* Backlight (Brightness Level 2-bright) dim current */ | ||
41 | #define ADP8870_BLMX3 0x0E /* Backlight (Brightness Level 3-office) maximum current */ | ||
42 | #define ADP8870_BLDM3 0x0F /* Backlight (Brightness Level 3-office) dim current */ | ||
43 | #define ADP8870_BLMX4 0x10 /* Backlight (Brightness Level 4-indoor) maximum current */ | ||
44 | #define ADP8870_BLDM4 0x11 /* Backlight (Brightness Level 4-indoor) dim current */ | ||
45 | #define ADP8870_BLMX5 0x12 /* Backlight (Brightness Level 5-dark) maximum current */ | ||
46 | #define ADP8870_BLDM5 0x13 /* Backlight (Brightness Level 5-dark) dim current */ | ||
47 | #define ADP8870_ISCLAW 0x1A /* Independent sink current fade law register */ | ||
48 | #define ADP8870_ISCC 0x1B /* Independent sink current control register */ | ||
49 | #define ADP8870_ISCT1 0x1C /* Independent Sink Current Timer Register LED[7:5] */ | ||
50 | #define ADP8870_ISCT2 0x1D /* Independent Sink Current Timer Register LED[4:1] */ | ||
51 | #define ADP8870_ISCF 0x1E /* Independent sink current fade register */ | ||
52 | #define ADP8870_ISC1 0x1F /* Independent Sink Current LED1 */ | ||
53 | #define ADP8870_ISC2 0x20 /* Independent Sink Current LED2 */ | ||
54 | #define ADP8870_ISC3 0x21 /* Independent Sink Current LED3 */ | ||
55 | #define ADP8870_ISC4 0x22 /* Independent Sink Current LED4 */ | ||
56 | #define ADP8870_ISC5 0x23 /* Independent Sink Current LED5 */ | ||
57 | #define ADP8870_ISC6 0x24 /* Independent Sink Current LED6 */ | ||
58 | #define ADP8870_ISC7 0x25 /* Independent Sink Current LED7 (Brightness Level 1-daylight) */ | ||
59 | #define ADP8870_ISC7_L2 0x26 /* Independent Sink Current LED7 (Brightness Level 2-bright) */ | ||
60 | #define ADP8870_ISC7_L3 0x27 /* Independent Sink Current LED7 (Brightness Level 3-office) */ | ||
61 | #define ADP8870_ISC7_L4 0x28 /* Independent Sink Current LED7 (Brightness Level 4-indoor) */ | ||
62 | #define ADP8870_ISC7_L5 0x29 /* Independent Sink Current LED7 (Brightness Level 5-dark) */ | ||
63 | #define ADP8870_CMP_CTL 0x2D /* ALS Comparator Control Register */ | ||
64 | #define ADP8870_ALS1_EN 0x2E /* Main ALS comparator level enable */ | ||
65 | #define ADP8870_ALS2_EN 0x2F /* Second ALS comparator level enable */ | ||
66 | #define ADP8870_ALS1_STAT 0x30 /* Main ALS Comparator Status Register */ | ||
67 | #define ADP8870_ALS2_STAT 0x31 /* Second ALS Comparator Status Register */ | ||
68 | #define ADP8870_L2TRP 0x32 /* L2 comparator reference */ | ||
69 | #define ADP8870_L2HYS 0x33 /* L2 hysteresis */ | ||
70 | #define ADP8870_L3TRP 0x34 /* L3 comparator reference */ | ||
71 | #define ADP8870_L3HYS 0x35 /* L3 hysteresis */ | ||
72 | #define ADP8870_L4TRP 0x36 /* L4 comparator reference */ | ||
73 | #define ADP8870_L4HYS 0x37 /* L4 hysteresis */ | ||
74 | #define ADP8870_L5TRP 0x38 /* L5 comparator reference */ | ||
75 | #define ADP8870_L5HYS 0x39 /* L5 hysteresis */ | ||
76 | #define ADP8870_PH1LEVL 0x40 /* First phototransistor ambient light level-low byte register */ | ||
77 | #define ADP8870_PH1LEVH 0x41 /* First phototransistor ambient light level-high byte register */ | ||
78 | #define ADP8870_PH2LEVL 0x42 /* Second phototransistor ambient light level-low byte register */ | ||
79 | #define ADP8870_PH2LEVH 0x43 /* Second phototransistor ambient light level-high byte register */ | ||
80 | |||
81 | #define ADP8870_MANUFID 0x3 /* Analog Devices AD8870 Manufacturer and device ID */ | ||
82 | #define ADP8870_DEVID(x) ((x) & 0xF) | ||
83 | #define ADP8870_MANID(x) ((x) >> 4) | ||
84 | |||
85 | /* MDCR Device mode and status */ | ||
86 | #define D7ALSEN (1 << 7) | ||
87 | #define INT_CFG (1 << 6) | ||
88 | #define NSTBY (1 << 5) | ||
89 | #define DIM_EN (1 << 4) | ||
90 | #define GDWN_DIS (1 << 3) | ||
91 | #define SIS_EN (1 << 2) | ||
92 | #define CMP_AUTOEN (1 << 1) | ||
93 | #define BLEN (1 << 0) | ||
94 | |||
95 | /* ADP8870_ALS1_EN Main ALS comparator level enable */ | ||
96 | #define L5_EN (1 << 3) | ||
97 | #define L4_EN (1 << 2) | ||
98 | #define L3_EN (1 << 1) | ||
99 | #define L2_EN (1 << 0) | ||
100 | |||
101 | #define CFGR_BLV_SHIFT 3 | ||
102 | #define CFGR_BLV_MASK 0x7 | ||
103 | #define ADP8870_FLAG_LED_MASK 0xFF | ||
104 | |||
105 | #define FADE_VAL(in, out) ((0xF & (in)) | ((0xF & (out)) << 4)) | ||
106 | #define BL_CFGR_VAL(law, blv) ((((blv) & CFGR_BLV_MASK) << CFGR_BLV_SHIFT) | ((0x3 & (law)) << 1)) | ||
107 | #define ALS_CMPR_CFG_VAL(filt) ((0x7 & (filt)) << 1) | ||
108 | |||
109 | struct adp8870_bl { | ||
110 | struct i2c_client *client; | ||
111 | struct backlight_device *bl; | ||
112 | struct adp8870_led *led; | ||
113 | struct adp8870_backlight_platform_data *pdata; | ||
114 | struct mutex lock; | ||
115 | unsigned long cached_daylight_max; | ||
116 | int id; | ||
117 | int revid; | ||
118 | int current_brightness; | ||
119 | }; | ||
120 | |||
121 | struct adp8870_led { | ||
122 | struct led_classdev cdev; | ||
123 | struct work_struct work; | ||
124 | struct i2c_client *client; | ||
125 | enum led_brightness new_brightness; | ||
126 | int id; | ||
127 | int flags; | ||
128 | }; | ||
129 | |||
130 | static int adp8870_read(struct i2c_client *client, int reg, uint8_t *val) | ||
131 | { | ||
132 | int ret; | ||
133 | |||
134 | ret = i2c_smbus_read_byte_data(client, reg); | ||
135 | if (ret < 0) { | ||
136 | dev_err(&client->dev, "failed reading at 0x%02x\n", reg); | ||
137 | return ret; | ||
138 | } | ||
139 | |||
140 | *val = ret; | ||
141 | return 0; | ||
142 | } | ||
143 | |||
144 | |||
145 | static int adp8870_write(struct i2c_client *client, u8 reg, u8 val) | ||
146 | { | ||
147 | int ret = i2c_smbus_write_byte_data(client, reg, val); | ||
148 | if (ret) | ||
149 | dev_err(&client->dev, "failed to write\n"); | ||
150 | |||
151 | return ret; | ||
152 | } | ||
153 | |||
154 | static int adp8870_set_bits(struct i2c_client *client, int reg, uint8_t bit_mask) | ||
155 | { | ||
156 | struct adp8870_bl *data = i2c_get_clientdata(client); | ||
157 | uint8_t reg_val; | ||
158 | int ret; | ||
159 | |||
160 | mutex_lock(&data->lock); | ||
161 | |||
162 | ret = adp8870_read(client, reg, ®_val); | ||
163 | |||
164 | if (!ret && ((reg_val & bit_mask) == 0)) { | ||
165 | reg_val |= bit_mask; | ||
166 | ret = adp8870_write(client, reg, reg_val); | ||
167 | } | ||
168 | |||
169 | mutex_unlock(&data->lock); | ||
170 | return ret; | ||
171 | } | ||
172 | |||
173 | static int adp8870_clr_bits(struct i2c_client *client, int reg, uint8_t bit_mask) | ||
174 | { | ||
175 | struct adp8870_bl *data = i2c_get_clientdata(client); | ||
176 | uint8_t reg_val; | ||
177 | int ret; | ||
178 | |||
179 | mutex_lock(&data->lock); | ||
180 | |||
181 | ret = adp8870_read(client, reg, ®_val); | ||
182 | |||
183 | if (!ret && (reg_val & bit_mask)) { | ||
184 | reg_val &= ~bit_mask; | ||
185 | ret = adp8870_write(client, reg, reg_val); | ||
186 | } | ||
187 | |||
188 | mutex_unlock(&data->lock); | ||
189 | return ret; | ||
190 | } | ||
191 | |||
192 | /* | ||
193 | * Independent sink / LED | ||
194 | */ | ||
195 | #if defined(ADP8870_USE_LEDS) | ||
196 | static void adp8870_led_work(struct work_struct *work) | ||
197 | { | ||
198 | struct adp8870_led *led = container_of(work, struct adp8870_led, work); | ||
199 | adp8870_write(led->client, ADP8870_ISC1 + led->id - 1, | ||
200 | led->new_brightness >> 1); | ||
201 | } | ||
202 | |||
203 | static void adp8870_led_set(struct led_classdev *led_cdev, | ||
204 | enum led_brightness value) | ||
205 | { | ||
206 | struct adp8870_led *led; | ||
207 | |||
208 | led = container_of(led_cdev, struct adp8870_led, cdev); | ||
209 | led->new_brightness = value; | ||
210 | /* | ||
211 | * Use workqueue for IO since I2C operations can sleep. | ||
212 | */ | ||
213 | schedule_work(&led->work); | ||
214 | } | ||
215 | |||
216 | static int adp8870_led_setup(struct adp8870_led *led) | ||
217 | { | ||
218 | struct i2c_client *client = led->client; | ||
219 | int ret = 0; | ||
220 | |||
221 | ret = adp8870_write(client, ADP8870_ISC1 + led->id - 1, 0); | ||
222 | if (ret) | ||
223 | return ret; | ||
224 | |||
225 | ret = adp8870_set_bits(client, ADP8870_ISCC, 1 << (led->id - 1)); | ||
226 | if (ret) | ||
227 | return ret; | ||
228 | |||
229 | if (led->id > 4) | ||
230 | ret = adp8870_set_bits(client, ADP8870_ISCT1, | ||
231 | (led->flags & 0x3) << ((led->id - 5) * 2)); | ||
232 | else | ||
233 | ret = adp8870_set_bits(client, ADP8870_ISCT2, | ||
234 | (led->flags & 0x3) << ((led->id - 1) * 2)); | ||
235 | |||
236 | return ret; | ||
237 | } | ||
238 | |||
239 | static int __devinit adp8870_led_probe(struct i2c_client *client) | ||
240 | { | ||
241 | struct adp8870_backlight_platform_data *pdata = | ||
242 | client->dev.platform_data; | ||
243 | struct adp8870_bl *data = i2c_get_clientdata(client); | ||
244 | struct adp8870_led *led, *led_dat; | ||
245 | struct led_info *cur_led; | ||
246 | int ret, i; | ||
247 | |||
248 | |||
249 | led = kcalloc(pdata->num_leds, sizeof(*led), GFP_KERNEL); | ||
250 | if (led == NULL) { | ||
251 | dev_err(&client->dev, "failed to alloc memory\n"); | ||
252 | return -ENOMEM; | ||
253 | } | ||
254 | |||
255 | ret = adp8870_write(client, ADP8870_ISCLAW, pdata->led_fade_law); | ||
256 | if (ret) | ||
257 | goto err_free; | ||
258 | |||
259 | ret = adp8870_write(client, ADP8870_ISCT1, | ||
260 | (pdata->led_on_time & 0x3) << 6); | ||
261 | if (ret) | ||
262 | goto err_free; | ||
263 | |||
264 | ret = adp8870_write(client, ADP8870_ISCF, | ||
265 | FADE_VAL(pdata->led_fade_in, pdata->led_fade_out)); | ||
266 | if (ret) | ||
267 | goto err_free; | ||
268 | |||
269 | for (i = 0; i < pdata->num_leds; ++i) { | ||
270 | cur_led = &pdata->leds[i]; | ||
271 | led_dat = &led[i]; | ||
272 | |||
273 | led_dat->id = cur_led->flags & ADP8870_FLAG_LED_MASK; | ||
274 | |||
275 | if (led_dat->id > 7 || led_dat->id < 1) { | ||
276 | dev_err(&client->dev, "Invalid LED ID %d\n", | ||
277 | led_dat->id); | ||
278 | goto err; | ||
279 | } | ||
280 | |||
281 | if (pdata->bl_led_assign & (1 << (led_dat->id - 1))) { | ||
282 | dev_err(&client->dev, "LED %d used by Backlight\n", | ||
283 | led_dat->id); | ||
284 | goto err; | ||
285 | } | ||
286 | |||
287 | led_dat->cdev.name = cur_led->name; | ||
288 | led_dat->cdev.default_trigger = cur_led->default_trigger; | ||
289 | led_dat->cdev.brightness_set = adp8870_led_set; | ||
290 | led_dat->cdev.brightness = LED_OFF; | ||
291 | led_dat->flags = cur_led->flags >> FLAG_OFFT_SHIFT; | ||
292 | led_dat->client = client; | ||
293 | led_dat->new_brightness = LED_OFF; | ||
294 | INIT_WORK(&led_dat->work, adp8870_led_work); | ||
295 | |||
296 | ret = led_classdev_register(&client->dev, &led_dat->cdev); | ||
297 | if (ret) { | ||
298 | dev_err(&client->dev, "failed to register LED %d\n", | ||
299 | led_dat->id); | ||
300 | goto err; | ||
301 | } | ||
302 | |||
303 | ret = adp8870_led_setup(led_dat); | ||
304 | if (ret) { | ||
305 | dev_err(&client->dev, "failed to write\n"); | ||
306 | i++; | ||
307 | goto err; | ||
308 | } | ||
309 | } | ||
310 | |||
311 | data->led = led; | ||
312 | |||
313 | return 0; | ||
314 | |||
315 | err: | ||
316 | for (i = i - 1; i >= 0; --i) { | ||
317 | led_classdev_unregister(&led[i].cdev); | ||
318 | cancel_work_sync(&led[i].work); | ||
319 | } | ||
320 | |||
321 | err_free: | ||
322 | kfree(led); | ||
323 | |||
324 | return ret; | ||
325 | } | ||
326 | |||
327 | static int __devexit adp8870_led_remove(struct i2c_client *client) | ||
328 | { | ||
329 | struct adp8870_backlight_platform_data *pdata = | ||
330 | client->dev.platform_data; | ||
331 | struct adp8870_bl *data = i2c_get_clientdata(client); | ||
332 | int i; | ||
333 | |||
334 | for (i = 0; i < pdata->num_leds; i++) { | ||
335 | led_classdev_unregister(&data->led[i].cdev); | ||
336 | cancel_work_sync(&data->led[i].work); | ||
337 | } | ||
338 | |||
339 | kfree(data->led); | ||
340 | return 0; | ||
341 | } | ||
342 | #else | ||
343 | static int __devinit adp8870_led_probe(struct i2c_client *client) | ||
344 | { | ||
345 | return 0; | ||
346 | } | ||
347 | |||
348 | static int __devexit adp8870_led_remove(struct i2c_client *client) | ||
349 | { | ||
350 | return 0; | ||
351 | } | ||
352 | #endif | ||
353 | |||
354 | static int adp8870_bl_set(struct backlight_device *bl, int brightness) | ||
355 | { | ||
356 | struct adp8870_bl *data = bl_get_data(bl); | ||
357 | struct i2c_client *client = data->client; | ||
358 | int ret = 0; | ||
359 | |||
360 | if (data->pdata->en_ambl_sens) { | ||
361 | if ((brightness > 0) && (brightness < ADP8870_MAX_BRIGHTNESS)) { | ||
362 | /* Disable Ambient Light auto adjust */ | ||
363 | ret = adp8870_clr_bits(client, ADP8870_MDCR, | ||
364 | CMP_AUTOEN); | ||
365 | if (ret) | ||
366 | return ret; | ||
367 | ret = adp8870_write(client, ADP8870_BLMX1, brightness); | ||
368 | if (ret) | ||
369 | return ret; | ||
370 | } else { | ||
371 | /* | ||
372 | * MAX_BRIGHTNESS -> Enable Ambient Light auto adjust | ||
373 | * restore daylight l1 sysfs brightness | ||
374 | */ | ||
375 | ret = adp8870_write(client, ADP8870_BLMX1, | ||
376 | data->cached_daylight_max); | ||
377 | if (ret) | ||
378 | return ret; | ||
379 | |||
380 | ret = adp8870_set_bits(client, ADP8870_MDCR, | ||
381 | CMP_AUTOEN); | ||
382 | if (ret) | ||
383 | return ret; | ||
384 | } | ||
385 | } else { | ||
386 | ret = adp8870_write(client, ADP8870_BLMX1, brightness); | ||
387 | if (ret) | ||
388 | return ret; | ||
389 | } | ||
390 | |||
391 | if (data->current_brightness && brightness == 0) | ||
392 | ret = adp8870_set_bits(client, | ||
393 | ADP8870_MDCR, DIM_EN); | ||
394 | else if (data->current_brightness == 0 && brightness) | ||
395 | ret = adp8870_clr_bits(client, | ||
396 | ADP8870_MDCR, DIM_EN); | ||
397 | |||
398 | if (!ret) | ||
399 | data->current_brightness = brightness; | ||
400 | |||
401 | return ret; | ||
402 | } | ||
403 | |||
404 | static int adp8870_bl_update_status(struct backlight_device *bl) | ||
405 | { | ||
406 | int brightness = bl->props.brightness; | ||
407 | if (bl->props.power != FB_BLANK_UNBLANK) | ||
408 | brightness = 0; | ||
409 | |||
410 | if (bl->props.fb_blank != FB_BLANK_UNBLANK) | ||
411 | brightness = 0; | ||
412 | |||
413 | return adp8870_bl_set(bl, brightness); | ||
414 | } | ||
415 | |||
416 | static int adp8870_bl_get_brightness(struct backlight_device *bl) | ||
417 | { | ||
418 | struct adp8870_bl *data = bl_get_data(bl); | ||
419 | |||
420 | return data->current_brightness; | ||
421 | } | ||
422 | |||
423 | static const struct backlight_ops adp8870_bl_ops = { | ||
424 | .update_status = adp8870_bl_update_status, | ||
425 | .get_brightness = adp8870_bl_get_brightness, | ||
426 | }; | ||
427 | |||
428 | static int adp8870_bl_setup(struct backlight_device *bl) | ||
429 | { | ||
430 | struct adp8870_bl *data = bl_get_data(bl); | ||
431 | struct i2c_client *client = data->client; | ||
432 | struct adp8870_backlight_platform_data *pdata = data->pdata; | ||
433 | int ret = 0; | ||
434 | |||
435 | ret = adp8870_write(client, ADP8870_BLSEL, ~pdata->bl_led_assign); | ||
436 | if (ret) | ||
437 | return ret; | ||
438 | |||
439 | ret = adp8870_write(client, ADP8870_PWMLED, pdata->pwm_assign); | ||
440 | if (ret) | ||
441 | return ret; | ||
442 | |||
443 | ret = adp8870_write(client, ADP8870_BLMX1, pdata->l1_daylight_max); | ||
444 | if (ret) | ||
445 | return ret; | ||
446 | |||
447 | ret = adp8870_write(client, ADP8870_BLDM1, pdata->l1_daylight_dim); | ||
448 | if (ret) | ||
449 | return ret; | ||
450 | |||
451 | if (pdata->en_ambl_sens) { | ||
452 | data->cached_daylight_max = pdata->l1_daylight_max; | ||
453 | ret = adp8870_write(client, ADP8870_BLMX2, | ||
454 | pdata->l2_bright_max); | ||
455 | if (ret) | ||
456 | return ret; | ||
457 | ret = adp8870_write(client, ADP8870_BLDM2, | ||
458 | pdata->l2_bright_dim); | ||
459 | if (ret) | ||
460 | return ret; | ||
461 | |||
462 | ret = adp8870_write(client, ADP8870_BLMX3, | ||
463 | pdata->l3_office_max); | ||
464 | if (ret) | ||
465 | return ret; | ||
466 | ret = adp8870_write(client, ADP8870_BLDM3, | ||
467 | pdata->l3_office_dim); | ||
468 | if (ret) | ||
469 | return ret; | ||
470 | |||
471 | ret = adp8870_write(client, ADP8870_BLMX4, | ||
472 | pdata->l4_indoor_max); | ||
473 | if (ret) | ||
474 | return ret; | ||
475 | |||
476 | ret = adp8870_write(client, ADP8870_BLDM4, | ||
477 | pdata->l4_indor_dim); | ||
478 | if (ret) | ||
479 | return ret; | ||
480 | |||
481 | ret = adp8870_write(client, ADP8870_BLMX5, | ||
482 | pdata->l5_dark_max); | ||
483 | if (ret) | ||
484 | return ret; | ||
485 | |||
486 | ret = adp8870_write(client, ADP8870_BLDM5, | ||
487 | pdata->l5_dark_dim); | ||
488 | if (ret) | ||
489 | return ret; | ||
490 | |||
491 | ret = adp8870_write(client, ADP8870_L2TRP, pdata->l2_trip); | ||
492 | if (ret) | ||
493 | return ret; | ||
494 | |||
495 | ret = adp8870_write(client, ADP8870_L2HYS, pdata->l2_hyst); | ||
496 | if (ret) | ||
497 | return ret; | ||
498 | |||
499 | ret = adp8870_write(client, ADP8870_L3TRP, pdata->l3_trip); | ||
500 | if (ret) | ||
501 | return ret; | ||
502 | |||
503 | ret = adp8870_write(client, ADP8870_L3HYS, pdata->l3_hyst); | ||
504 | if (ret) | ||
505 | return ret; | ||
506 | |||
507 | ret = adp8870_write(client, ADP8870_L4TRP, pdata->l4_trip); | ||
508 | if (ret) | ||
509 | return ret; | ||
510 | |||
511 | ret = adp8870_write(client, ADP8870_L4HYS, pdata->l4_hyst); | ||
512 | if (ret) | ||
513 | return ret; | ||
514 | |||
515 | ret = adp8870_write(client, ADP8870_L5TRP, pdata->l5_trip); | ||
516 | if (ret) | ||
517 | return ret; | ||
518 | |||
519 | ret = adp8870_write(client, ADP8870_L5HYS, pdata->l5_hyst); | ||
520 | if (ret) | ||
521 | return ret; | ||
522 | |||
523 | ret = adp8870_write(client, ADP8870_ALS1_EN, L5_EN | L4_EN | | ||
524 | L3_EN | L2_EN); | ||
525 | if (ret) | ||
526 | return ret; | ||
527 | |||
528 | ret = adp8870_write(client, ADP8870_CMP_CTL, | ||
529 | ALS_CMPR_CFG_VAL(pdata->abml_filt)); | ||
530 | if (ret) | ||
531 | return ret; | ||
532 | } | ||
533 | |||
534 | ret = adp8870_write(client, ADP8870_CFGR, | ||
535 | BL_CFGR_VAL(pdata->bl_fade_law, 0)); | ||
536 | if (ret) | ||
537 | return ret; | ||
538 | |||
539 | ret = adp8870_write(client, ADP8870_BLFR, FADE_VAL(pdata->bl_fade_in, | ||
540 | pdata->bl_fade_out)); | ||
541 | if (ret) | ||
542 | return ret; | ||
543 | /* | ||
544 | * ADP8870 Rev0 requires GDWN_DIS bit set | ||
545 | */ | ||
546 | |||
547 | ret = adp8870_set_bits(client, ADP8870_MDCR, BLEN | DIM_EN | NSTBY | | ||
548 | (data->revid == 0 ? GDWN_DIS : 0)); | ||
549 | |||
550 | return ret; | ||
551 | } | ||
552 | |||
553 | static ssize_t adp8870_show(struct device *dev, char *buf, int reg) | ||
554 | { | ||
555 | struct adp8870_bl *data = dev_get_drvdata(dev); | ||
556 | int error; | ||
557 | uint8_t reg_val; | ||
558 | |||
559 | mutex_lock(&data->lock); | ||
560 | error = adp8870_read(data->client, reg, ®_val); | ||
561 | mutex_unlock(&data->lock); | ||
562 | |||
563 | if (error < 0) | ||
564 | return error; | ||
565 | |||
566 | return sprintf(buf, "%u\n", reg_val); | ||
567 | } | ||
568 | |||
569 | static ssize_t adp8870_store(struct device *dev, const char *buf, | ||
570 | size_t count, int reg) | ||
571 | { | ||
572 | struct adp8870_bl *data = dev_get_drvdata(dev); | ||
573 | unsigned long val; | ||
574 | int ret; | ||
575 | |||
576 | ret = strict_strtoul(buf, 10, &val); | ||
577 | if (ret) | ||
578 | return ret; | ||
579 | |||
580 | mutex_lock(&data->lock); | ||
581 | adp8870_write(data->client, reg, val); | ||
582 | mutex_unlock(&data->lock); | ||
583 | |||
584 | return count; | ||
585 | } | ||
586 | |||
587 | static ssize_t adp8870_bl_l5_dark_max_show(struct device *dev, | ||
588 | struct device_attribute *attr, char *buf) | ||
589 | { | ||
590 | return adp8870_show(dev, buf, ADP8870_BLMX5); | ||
591 | } | ||
592 | |||
593 | static ssize_t adp8870_bl_l5_dark_max_store(struct device *dev, | ||
594 | struct device_attribute *attr, const char *buf, size_t count) | ||
595 | { | ||
596 | return adp8870_store(dev, buf, count, ADP8870_BLMX5); | ||
597 | } | ||
598 | static DEVICE_ATTR(l5_dark_max, 0664, adp8870_bl_l5_dark_max_show, | ||
599 | adp8870_bl_l5_dark_max_store); | ||
600 | |||
601 | |||
602 | static ssize_t adp8870_bl_l4_indoor_max_show(struct device *dev, | ||
603 | struct device_attribute *attr, char *buf) | ||
604 | { | ||
605 | return adp8870_show(dev, buf, ADP8870_BLMX4); | ||
606 | } | ||
607 | |||
608 | static ssize_t adp8870_bl_l4_indoor_max_store(struct device *dev, | ||
609 | struct device_attribute *attr, const char *buf, size_t count) | ||
610 | { | ||
611 | return adp8870_store(dev, buf, count, ADP8870_BLMX4); | ||
612 | } | ||
613 | static DEVICE_ATTR(l4_indoor_max, 0664, adp8870_bl_l4_indoor_max_show, | ||
614 | adp8870_bl_l4_indoor_max_store); | ||
615 | |||
616 | |||
617 | static ssize_t adp8870_bl_l3_office_max_show(struct device *dev, | ||
618 | struct device_attribute *attr, char *buf) | ||
619 | { | ||
620 | return adp8870_show(dev, buf, ADP8870_BLMX3); | ||
621 | } | ||
622 | |||
623 | static ssize_t adp8870_bl_l3_office_max_store(struct device *dev, | ||
624 | struct device_attribute *attr, const char *buf, size_t count) | ||
625 | { | ||
626 | return adp8870_store(dev, buf, count, ADP8870_BLMX3); | ||
627 | } | ||
628 | |||
629 | static DEVICE_ATTR(l3_office_max, 0664, adp8870_bl_l3_office_max_show, | ||
630 | adp8870_bl_l3_office_max_store); | ||
631 | |||
632 | static ssize_t adp8870_bl_l2_bright_max_show(struct device *dev, | ||
633 | struct device_attribute *attr, char *buf) | ||
634 | { | ||
635 | return adp8870_show(dev, buf, ADP8870_BLMX2); | ||
636 | } | ||
637 | |||
638 | static ssize_t adp8870_bl_l2_bright_max_store(struct device *dev, | ||
639 | struct device_attribute *attr, const char *buf, size_t count) | ||
640 | { | ||
641 | return adp8870_store(dev, buf, count, ADP8870_BLMX2); | ||
642 | } | ||
643 | static DEVICE_ATTR(l2_bright_max, 0664, adp8870_bl_l2_bright_max_show, | ||
644 | adp8870_bl_l2_bright_max_store); | ||
645 | |||
646 | static ssize_t adp8870_bl_l1_daylight_max_show(struct device *dev, | ||
647 | struct device_attribute *attr, char *buf) | ||
648 | { | ||
649 | return adp8870_show(dev, buf, ADP8870_BLMX1); | ||
650 | } | ||
651 | |||
652 | static ssize_t adp8870_bl_l1_daylight_max_store(struct device *dev, | ||
653 | struct device_attribute *attr, const char *buf, size_t count) | ||
654 | { | ||
655 | struct adp8870_bl *data = dev_get_drvdata(dev); | ||
656 | int ret = strict_strtoul(buf, 10, &data->cached_daylight_max); | ||
657 | if (ret) | ||
658 | return ret; | ||
659 | |||
660 | return adp8870_store(dev, buf, count, ADP8870_BLMX1); | ||
661 | } | ||
662 | static DEVICE_ATTR(l1_daylight_max, 0664, adp8870_bl_l1_daylight_max_show, | ||
663 | adp8870_bl_l1_daylight_max_store); | ||
664 | |||
665 | static ssize_t adp8870_bl_l5_dark_dim_show(struct device *dev, | ||
666 | struct device_attribute *attr, char *buf) | ||
667 | { | ||
668 | return adp8870_show(dev, buf, ADP8870_BLDM5); | ||
669 | } | ||
670 | |||
671 | static ssize_t adp8870_bl_l5_dark_dim_store(struct device *dev, | ||
672 | struct device_attribute *attr, | ||
673 | const char *buf, size_t count) | ||
674 | { | ||
675 | return adp8870_store(dev, buf, count, ADP8870_BLDM5); | ||
676 | } | ||
677 | static DEVICE_ATTR(l5_dark_dim, 0664, adp8870_bl_l5_dark_dim_show, | ||
678 | adp8870_bl_l5_dark_dim_store); | ||
679 | |||
680 | static ssize_t adp8870_bl_l4_indoor_dim_show(struct device *dev, | ||
681 | struct device_attribute *attr, char *buf) | ||
682 | { | ||
683 | return adp8870_show(dev, buf, ADP8870_BLDM4); | ||
684 | } | ||
685 | |||
686 | static ssize_t adp8870_bl_l4_indoor_dim_store(struct device *dev, | ||
687 | struct device_attribute *attr, | ||
688 | const char *buf, size_t count) | ||
689 | { | ||
690 | return adp8870_store(dev, buf, count, ADP8870_BLDM4); | ||
691 | } | ||
692 | static DEVICE_ATTR(l4_indoor_dim, 0664, adp8870_bl_l4_indoor_dim_show, | ||
693 | adp8870_bl_l4_indoor_dim_store); | ||
694 | |||
695 | |||
696 | static ssize_t adp8870_bl_l3_office_dim_show(struct device *dev, | ||
697 | struct device_attribute *attr, char *buf) | ||
698 | { | ||
699 | return adp8870_show(dev, buf, ADP8870_BLDM3); | ||
700 | } | ||
701 | |||
702 | static ssize_t adp8870_bl_l3_office_dim_store(struct device *dev, | ||
703 | struct device_attribute *attr, | ||
704 | const char *buf, size_t count) | ||
705 | { | ||
706 | return adp8870_store(dev, buf, count, ADP8870_BLDM3); | ||
707 | } | ||
708 | static DEVICE_ATTR(l3_office_dim, 0664, adp8870_bl_l3_office_dim_show, | ||
709 | adp8870_bl_l3_office_dim_store); | ||
710 | |||
711 | static ssize_t adp8870_bl_l2_bright_dim_show(struct device *dev, | ||
712 | struct device_attribute *attr, char *buf) | ||
713 | { | ||
714 | return adp8870_show(dev, buf, ADP8870_BLDM2); | ||
715 | } | ||
716 | |||
717 | static ssize_t adp8870_bl_l2_bright_dim_store(struct device *dev, | ||
718 | struct device_attribute *attr, | ||
719 | const char *buf, size_t count) | ||
720 | { | ||
721 | return adp8870_store(dev, buf, count, ADP8870_BLDM2); | ||
722 | } | ||
723 | static DEVICE_ATTR(l2_bright_dim, 0664, adp8870_bl_l2_bright_dim_show, | ||
724 | adp8870_bl_l2_bright_dim_store); | ||
725 | |||
726 | static ssize_t adp8870_bl_l1_daylight_dim_show(struct device *dev, | ||
727 | struct device_attribute *attr, char *buf) | ||
728 | { | ||
729 | return adp8870_show(dev, buf, ADP8870_BLDM1); | ||
730 | } | ||
731 | |||
732 | static ssize_t adp8870_bl_l1_daylight_dim_store(struct device *dev, | ||
733 | struct device_attribute *attr, | ||
734 | const char *buf, size_t count) | ||
735 | { | ||
736 | return adp8870_store(dev, buf, count, ADP8870_BLDM1); | ||
737 | } | ||
738 | static DEVICE_ATTR(l1_daylight_dim, 0664, adp8870_bl_l1_daylight_dim_show, | ||
739 | adp8870_bl_l1_daylight_dim_store); | ||
740 | |||
741 | #ifdef ADP8870_EXT_FEATURES | ||
742 | static ssize_t adp8870_bl_ambient_light_level_show(struct device *dev, | ||
743 | struct device_attribute *attr, char *buf) | ||
744 | { | ||
745 | struct adp8870_bl *data = dev_get_drvdata(dev); | ||
746 | int error; | ||
747 | uint8_t reg_val; | ||
748 | uint16_t ret_val; | ||
749 | |||
750 | mutex_lock(&data->lock); | ||
751 | error = adp8870_read(data->client, ADP8870_PH1LEVL, ®_val); | ||
752 | if (error < 0) { | ||
753 | mutex_unlock(&data->lock); | ||
754 | return error; | ||
755 | } | ||
756 | ret_val = reg_val; | ||
757 | error = adp8870_read(data->client, ADP8870_PH1LEVH, ®_val); | ||
758 | mutex_unlock(&data->lock); | ||
759 | |||
760 | if (error < 0) | ||
761 | return error; | ||
762 | |||
763 | /* Return 13-bit conversion value for the first light sensor */ | ||
764 | ret_val += (reg_val & 0x1F) << 8; | ||
765 | |||
766 | return sprintf(buf, "%u\n", ret_val); | ||
767 | } | ||
768 | static DEVICE_ATTR(ambient_light_level, 0444, | ||
769 | adp8870_bl_ambient_light_level_show, NULL); | ||
770 | |||
771 | static ssize_t adp8870_bl_ambient_light_zone_show(struct device *dev, | ||
772 | struct device_attribute *attr, char *buf) | ||
773 | { | ||
774 | struct adp8870_bl *data = dev_get_drvdata(dev); | ||
775 | int error; | ||
776 | uint8_t reg_val; | ||
777 | |||
778 | mutex_lock(&data->lock); | ||
779 | error = adp8870_read(data->client, ADP8870_CFGR, ®_val); | ||
780 | mutex_unlock(&data->lock); | ||
781 | |||
782 | if (error < 0) | ||
783 | return error; | ||
784 | |||
785 | return sprintf(buf, "%u\n", | ||
786 | ((reg_val >> CFGR_BLV_SHIFT) & CFGR_BLV_MASK) + 1); | ||
787 | } | ||
788 | |||
789 | static ssize_t adp8870_bl_ambient_light_zone_store(struct device *dev, | ||
790 | struct device_attribute *attr, | ||
791 | const char *buf, size_t count) | ||
792 | { | ||
793 | struct adp8870_bl *data = dev_get_drvdata(dev); | ||
794 | unsigned long val; | ||
795 | uint8_t reg_val; | ||
796 | int ret; | ||
797 | |||
798 | ret = strict_strtoul(buf, 10, &val); | ||
799 | if (ret) | ||
800 | return ret; | ||
801 | |||
802 | if (val == 0) { | ||
803 | /* Enable automatic ambient light sensing */ | ||
804 | adp8870_set_bits(data->client, ADP8870_MDCR, CMP_AUTOEN); | ||
805 | } else if ((val > 0) && (val < 6)) { | ||
806 | /* Disable automatic ambient light sensing */ | ||
807 | adp8870_clr_bits(data->client, ADP8870_MDCR, CMP_AUTOEN); | ||
808 | |||
809 | /* Set user supplied ambient light zone */ | ||
810 | mutex_lock(&data->lock); | ||
811 | adp8870_read(data->client, ADP8870_CFGR, ®_val); | ||
812 | reg_val &= ~(CFGR_BLV_MASK << CFGR_BLV_SHIFT); | ||
813 | reg_val |= (val - 1) << CFGR_BLV_SHIFT; | ||
814 | adp8870_write(data->client, ADP8870_CFGR, reg_val); | ||
815 | mutex_unlock(&data->lock); | ||
816 | } | ||
817 | |||
818 | return count; | ||
819 | } | ||
820 | static DEVICE_ATTR(ambient_light_zone, 0664, | ||
821 | adp8870_bl_ambient_light_zone_show, | ||
822 | adp8870_bl_ambient_light_zone_store); | ||
823 | #endif | ||
824 | |||
825 | static struct attribute *adp8870_bl_attributes[] = { | ||
826 | &dev_attr_l5_dark_max.attr, | ||
827 | &dev_attr_l5_dark_dim.attr, | ||
828 | &dev_attr_l4_indoor_max.attr, | ||
829 | &dev_attr_l4_indoor_dim.attr, | ||
830 | &dev_attr_l3_office_max.attr, | ||
831 | &dev_attr_l3_office_dim.attr, | ||
832 | &dev_attr_l2_bright_max.attr, | ||
833 | &dev_attr_l2_bright_dim.attr, | ||
834 | &dev_attr_l1_daylight_max.attr, | ||
835 | &dev_attr_l1_daylight_dim.attr, | ||
836 | #ifdef ADP8870_EXT_FEATURES | ||
837 | &dev_attr_ambient_light_level.attr, | ||
838 | &dev_attr_ambient_light_zone.attr, | ||
839 | #endif | ||
840 | NULL | ||
841 | }; | ||
842 | |||
843 | static const struct attribute_group adp8870_bl_attr_group = { | ||
844 | .attrs = adp8870_bl_attributes, | ||
845 | }; | ||
846 | |||
847 | static int __devinit adp8870_probe(struct i2c_client *client, | ||
848 | const struct i2c_device_id *id) | ||
849 | { | ||
850 | struct backlight_properties props; | ||
851 | struct backlight_device *bl; | ||
852 | struct adp8870_bl *data; | ||
853 | struct adp8870_backlight_platform_data *pdata = | ||
854 | client->dev.platform_data; | ||
855 | uint8_t reg_val; | ||
856 | int ret; | ||
857 | |||
858 | if (!i2c_check_functionality(client->adapter, | ||
859 | I2C_FUNC_SMBUS_BYTE_DATA)) { | ||
860 | dev_err(&client->dev, "SMBUS Byte Data not Supported\n"); | ||
861 | return -EIO; | ||
862 | } | ||
863 | |||
864 | if (!pdata) { | ||
865 | dev_err(&client->dev, "no platform data?\n"); | ||
866 | return -EINVAL; | ||
867 | } | ||
868 | |||
869 | ret = adp8870_read(client, ADP8870_MFDVID, ®_val); | ||
870 | if (ret < 0) | ||
871 | return -EIO; | ||
872 | |||
873 | if (ADP8870_MANID(reg_val) != ADP8870_MANUFID) { | ||
874 | dev_err(&client->dev, "failed to probe\n"); | ||
875 | return -ENODEV; | ||
876 | } | ||
877 | |||
878 | data = kzalloc(sizeof(*data), GFP_KERNEL); | ||
879 | if (data == NULL) | ||
880 | return -ENOMEM; | ||
881 | |||
882 | data->revid = ADP8870_DEVID(reg_val); | ||
883 | data->client = client; | ||
884 | data->pdata = pdata; | ||
885 | data->id = id->driver_data; | ||
886 | data->current_brightness = 0; | ||
887 | i2c_set_clientdata(client, data); | ||
888 | |||
889 | mutex_init(&data->lock); | ||
890 | |||
891 | memset(&props, 0, sizeof(props)); | ||
892 | props.type = BACKLIGHT_RAW; | ||
893 | props.max_brightness = props.brightness = ADP8870_MAX_BRIGHTNESS; | ||
894 | bl = backlight_device_register(dev_driver_string(&client->dev), | ||
895 | &client->dev, data, &adp8870_bl_ops, &props); | ||
896 | if (IS_ERR(bl)) { | ||
897 | dev_err(&client->dev, "failed to register backlight\n"); | ||
898 | ret = PTR_ERR(bl); | ||
899 | goto out2; | ||
900 | } | ||
901 | |||
902 | data->bl = bl; | ||
903 | |||
904 | if (pdata->en_ambl_sens) | ||
905 | ret = sysfs_create_group(&bl->dev.kobj, | ||
906 | &adp8870_bl_attr_group); | ||
907 | |||
908 | if (ret) { | ||
909 | dev_err(&client->dev, "failed to register sysfs\n"); | ||
910 | goto out1; | ||
911 | } | ||
912 | |||
913 | ret = adp8870_bl_setup(bl); | ||
914 | if (ret) { | ||
915 | ret = -EIO; | ||
916 | goto out; | ||
917 | } | ||
918 | |||
919 | backlight_update_status(bl); | ||
920 | |||
921 | dev_info(&client->dev, "Rev.%d Backlight\n", data->revid); | ||
922 | |||
923 | if (pdata->num_leds) | ||
924 | adp8870_led_probe(client); | ||
925 | |||
926 | return 0; | ||
927 | |||
928 | out: | ||
929 | if (data->pdata->en_ambl_sens) | ||
930 | sysfs_remove_group(&data->bl->dev.kobj, | ||
931 | &adp8870_bl_attr_group); | ||
932 | out1: | ||
933 | backlight_device_unregister(bl); | ||
934 | out2: | ||
935 | i2c_set_clientdata(client, NULL); | ||
936 | kfree(data); | ||
937 | |||
938 | return ret; | ||
939 | } | ||
940 | |||
941 | static int __devexit adp8870_remove(struct i2c_client *client) | ||
942 | { | ||
943 | struct adp8870_bl *data = i2c_get_clientdata(client); | ||
944 | |||
945 | adp8870_clr_bits(client, ADP8870_MDCR, NSTBY); | ||
946 | |||
947 | if (data->led) | ||
948 | adp8870_led_remove(client); | ||
949 | |||
950 | if (data->pdata->en_ambl_sens) | ||
951 | sysfs_remove_group(&data->bl->dev.kobj, | ||
952 | &adp8870_bl_attr_group); | ||
953 | |||
954 | backlight_device_unregister(data->bl); | ||
955 | i2c_set_clientdata(client, NULL); | ||
956 | kfree(data); | ||
957 | |||
958 | return 0; | ||
959 | } | ||
960 | |||
961 | #ifdef CONFIG_PM | ||
962 | static int adp8870_i2c_suspend(struct i2c_client *client, pm_message_t message) | ||
963 | { | ||
964 | adp8870_clr_bits(client, ADP8870_MDCR, NSTBY); | ||
965 | |||
966 | return 0; | ||
967 | } | ||
968 | |||
969 | static int adp8870_i2c_resume(struct i2c_client *client) | ||
970 | { | ||
971 | adp8870_set_bits(client, ADP8870_MDCR, NSTBY); | ||
972 | |||
973 | return 0; | ||
974 | } | ||
975 | #else | ||
976 | #define adp8870_i2c_suspend NULL | ||
977 | #define adp8870_i2c_resume NULL | ||
978 | #endif | ||
979 | |||
980 | static const struct i2c_device_id adp8870_id[] = { | ||
981 | { "adp8870", 0 }, | ||
982 | { } | ||
983 | }; | ||
984 | MODULE_DEVICE_TABLE(i2c, adp8870_id); | ||
985 | |||
986 | static struct i2c_driver adp8870_driver = { | ||
987 | .driver = { | ||
988 | .name = KBUILD_MODNAME, | ||
989 | }, | ||
990 | .probe = adp8870_probe, | ||
991 | .remove = __devexit_p(adp8870_remove), | ||
992 | .suspend = adp8870_i2c_suspend, | ||
993 | .resume = adp8870_i2c_resume, | ||
994 | .id_table = adp8870_id, | ||
995 | }; | ||
996 | |||
997 | static int __init adp8870_init(void) | ||
998 | { | ||
999 | return i2c_add_driver(&adp8870_driver); | ||
1000 | } | ||
1001 | module_init(adp8870_init); | ||
1002 | |||
1003 | static void __exit adp8870_exit(void) | ||
1004 | { | ||
1005 | i2c_del_driver(&adp8870_driver); | ||
1006 | } | ||
1007 | module_exit(adp8870_exit); | ||
1008 | |||
1009 | MODULE_LICENSE("GPL v2"); | ||
1010 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | ||
1011 | MODULE_DESCRIPTION("ADP8870 Backlight driver"); | ||
1012 | MODULE_ALIAS("platform:adp8870-backlight"); | ||
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c index 69c49dfce9cf..784139aed079 100644 --- a/drivers/video/efifb.c +++ b/drivers/video/efifb.c | |||
@@ -541,7 +541,7 @@ static int __init efifb_init(void) | |||
541 | */ | 541 | */ |
542 | ret = platform_driver_probe(&efifb_driver, efifb_probe); | 542 | ret = platform_driver_probe(&efifb_driver, efifb_probe); |
543 | if (ret) { | 543 | if (ret) { |
544 | platform_device_unregister(&efifb_driver); | 544 | platform_device_unregister(&efifb_device); |
545 | return ret; | 545 | return ret; |
546 | } | 546 | } |
547 | 547 | ||
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 0352afa49a39..4aecf213c9be 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c | |||
@@ -235,13 +235,12 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var, | |||
235 | struct fb_info *info) | 235 | struct fb_info *info) |
236 | { | 236 | { |
237 | struct s3c_fb_win *win = info->par; | 237 | struct s3c_fb_win *win = info->par; |
238 | struct s3c_fb_pd_win *windata = win->windata; | ||
239 | struct s3c_fb *sfb = win->parent; | 238 | struct s3c_fb *sfb = win->parent; |
240 | 239 | ||
241 | dev_dbg(sfb->dev, "checking parameters\n"); | 240 | dev_dbg(sfb->dev, "checking parameters\n"); |
242 | 241 | ||
243 | var->xres_virtual = max((unsigned int)windata->virtual_x, var->xres); | 242 | var->xres_virtual = max(var->xres_virtual, var->xres); |
244 | var->yres_virtual = max((unsigned int)windata->virtual_y, var->yres); | 243 | var->yres_virtual = max(var->yres_virtual, var->yres); |
245 | 244 | ||
246 | if (!s3c_fb_validate_win_bpp(win, var->bits_per_pixel)) { | 245 | if (!s3c_fb_validate_win_bpp(win, var->bits_per_pixel)) { |
247 | dev_dbg(sfb->dev, "win %d: unsupported bpp %d\n", | 246 | dev_dbg(sfb->dev, "win %d: unsupported bpp %d\n", |
@@ -558,6 +557,13 @@ static int s3c_fb_set_par(struct fb_info *info) | |||
558 | vidosd_set_alpha(win, alpha); | 557 | vidosd_set_alpha(win, alpha); |
559 | vidosd_set_size(win, data); | 558 | vidosd_set_size(win, data); |
560 | 559 | ||
560 | /* Enable DMA channel for this window */ | ||
561 | if (sfb->variant.has_shadowcon) { | ||
562 | data = readl(sfb->regs + SHADOWCON); | ||
563 | data |= SHADOWCON_CHx_ENABLE(win_no); | ||
564 | writel(data, sfb->regs + SHADOWCON); | ||
565 | } | ||
566 | |||
561 | data = WINCONx_ENWIN; | 567 | data = WINCONx_ENWIN; |
562 | 568 | ||
563 | /* note, since we have to round up the bits-per-pixel, we end up | 569 | /* note, since we have to round up the bits-per-pixel, we end up |
@@ -637,13 +643,6 @@ static int s3c_fb_set_par(struct fb_info *info) | |||
637 | writel(data, regs + sfb->variant.wincon + (win_no * 4)); | 643 | writel(data, regs + sfb->variant.wincon + (win_no * 4)); |
638 | writel(0x0, regs + sfb->variant.winmap + (win_no * 4)); | 644 | writel(0x0, regs + sfb->variant.winmap + (win_no * 4)); |
639 | 645 | ||
640 | /* Enable DMA channel for this window */ | ||
641 | if (sfb->variant.has_shadowcon) { | ||
642 | data = readl(sfb->regs + SHADOWCON); | ||
643 | data |= SHADOWCON_CHx_ENABLE(win_no); | ||
644 | writel(data, sfb->regs + SHADOWCON); | ||
645 | } | ||
646 | |||
647 | shadow_protect_win(win, 0); | 646 | shadow_protect_win(win, 0); |
648 | 647 | ||
649 | return 0; | 648 | return 0; |
@@ -1487,11 +1486,10 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev) | |||
1487 | 1486 | ||
1488 | release_mem_region(sfb->regs_res->start, resource_size(sfb->regs_res)); | 1487 | release_mem_region(sfb->regs_res->start, resource_size(sfb->regs_res)); |
1489 | 1488 | ||
1490 | kfree(sfb); | ||
1491 | |||
1492 | pm_runtime_put_sync(sfb->dev); | 1489 | pm_runtime_put_sync(sfb->dev); |
1493 | pm_runtime_disable(sfb->dev); | 1490 | pm_runtime_disable(sfb->dev); |
1494 | 1491 | ||
1492 | kfree(sfb); | ||
1495 | return 0; | 1493 | return 0; |
1496 | } | 1494 | } |
1497 | 1495 | ||
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 6ae40b630dc9..7d54e2c612f7 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c | |||
@@ -1127,23 +1127,16 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
1127 | struct fb_info *info = hdmi->info; | 1127 | struct fb_info *info = hdmi->info; |
1128 | unsigned long parent_rate = 0, hdmi_rate; | 1128 | unsigned long parent_rate = 0, hdmi_rate; |
1129 | 1129 | ||
1130 | /* A device has been plugged in */ | ||
1131 | pm_runtime_get_sync(hdmi->dev); | ||
1132 | |||
1133 | ret = sh_hdmi_read_edid(hdmi, &hdmi_rate, &parent_rate); | 1130 | ret = sh_hdmi_read_edid(hdmi, &hdmi_rate, &parent_rate); |
1134 | if (ret < 0) { | 1131 | if (ret < 0) |
1135 | pm_runtime_put(hdmi->dev); | ||
1136 | goto out; | 1132 | goto out; |
1137 | } | ||
1138 | 1133 | ||
1139 | hdmi->hp_state = HDMI_HOTPLUG_EDID_DONE; | 1134 | hdmi->hp_state = HDMI_HOTPLUG_EDID_DONE; |
1140 | 1135 | ||
1141 | /* Reconfigure the clock */ | 1136 | /* Reconfigure the clock */ |
1142 | ret = sh_hdmi_clk_configure(hdmi, hdmi_rate, parent_rate); | 1137 | ret = sh_hdmi_clk_configure(hdmi, hdmi_rate, parent_rate); |
1143 | if (ret < 0) { | 1138 | if (ret < 0) |
1144 | pm_runtime_put(hdmi->dev); | ||
1145 | goto out; | 1139 | goto out; |
1146 | } | ||
1147 | 1140 | ||
1148 | msleep(10); | 1141 | msleep(10); |
1149 | sh_hdmi_configure(hdmi); | 1142 | sh_hdmi_configure(hdmi); |
@@ -1191,7 +1184,6 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
1191 | fb_set_suspend(hdmi->info, 1); | 1184 | fb_set_suspend(hdmi->info, 1); |
1192 | 1185 | ||
1193 | console_unlock(); | 1186 | console_unlock(); |
1194 | pm_runtime_put(hdmi->dev); | ||
1195 | } | 1187 | } |
1196 | 1188 | ||
1197 | out: | 1189 | out: |
@@ -1312,7 +1304,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) | |||
1312 | INIT_DELAYED_WORK(&hdmi->edid_work, sh_hdmi_edid_work_fn); | 1304 | INIT_DELAYED_WORK(&hdmi->edid_work, sh_hdmi_edid_work_fn); |
1313 | 1305 | ||
1314 | pm_runtime_enable(&pdev->dev); | 1306 | pm_runtime_enable(&pdev->dev); |
1315 | pm_runtime_resume(&pdev->dev); | 1307 | pm_runtime_get_sync(&pdev->dev); |
1316 | 1308 | ||
1317 | /* Product and revision IDs are 0 in sh-mobile version */ | 1309 | /* Product and revision IDs are 0 in sh-mobile version */ |
1318 | dev_info(&pdev->dev, "Detected HDMI controller 0x%x:0x%x\n", | 1310 | dev_info(&pdev->dev, "Detected HDMI controller 0x%x:0x%x\n", |
@@ -1340,7 +1332,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) | |||
1340 | ecodec: | 1332 | ecodec: |
1341 | free_irq(irq, hdmi); | 1333 | free_irq(irq, hdmi); |
1342 | ereqirq: | 1334 | ereqirq: |
1343 | pm_runtime_suspend(&pdev->dev); | 1335 | pm_runtime_put(&pdev->dev); |
1344 | pm_runtime_disable(&pdev->dev); | 1336 | pm_runtime_disable(&pdev->dev); |
1345 | iounmap(hdmi->base); | 1337 | iounmap(hdmi->base); |
1346 | emap: | 1338 | emap: |
@@ -1377,7 +1369,7 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) | |||
1377 | free_irq(irq, hdmi); | 1369 | free_irq(irq, hdmi); |
1378 | /* Wait for already scheduled work */ | 1370 | /* Wait for already scheduled work */ |
1379 | cancel_delayed_work_sync(&hdmi->edid_work); | 1371 | cancel_delayed_work_sync(&hdmi->edid_work); |
1380 | pm_runtime_suspend(&pdev->dev); | 1372 | pm_runtime_put(&pdev->dev); |
1381 | pm_runtime_disable(&pdev->dev); | 1373 | pm_runtime_disable(&pdev->dev); |
1382 | clk_disable(hdmi->hdmi_clk); | 1374 | clk_disable(hdmi->hdmi_clk); |
1383 | clk_put(hdmi->hdmi_clk); | 1375 | clk_put(hdmi->hdmi_clk); |
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig index 00d615d7aa21..979d6eed9a0f 100644 --- a/drivers/w1/masters/Kconfig +++ b/drivers/w1/masters/Kconfig | |||
@@ -42,7 +42,7 @@ config W1_MASTER_MXC | |||
42 | 42 | ||
43 | config W1_MASTER_DS1WM | 43 | config W1_MASTER_DS1WM |
44 | tristate "Maxim DS1WM 1-wire busmaster" | 44 | tristate "Maxim DS1WM 1-wire busmaster" |
45 | depends on W1 | 45 | depends on W1 && GENERIC_HARDIRQS |
46 | help | 46 | help |
47 | Say Y here to enable the DS1WM 1-wire driver, such as that | 47 | Say Y here to enable the DS1WM 1-wire driver, such as that |
48 | in HP iPAQ devices like h5xxx, h2200, and ASIC3-based like | 48 | in HP iPAQ devices like h5xxx, h2200, and ASIC3-based like |
diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c index dd8584d35a14..545509c3313b 100644 --- a/fs/cifs/cache.c +++ b/fs/cifs/cache.c | |||
@@ -92,7 +92,7 @@ static uint16_t cifs_server_get_key(const void *cookie_netfs_data, | |||
92 | break; | 92 | break; |
93 | 93 | ||
94 | default: | 94 | default: |
95 | cERROR(1, "CIFS: Unknown network family '%d'", sa->sa_family); | 95 | cERROR(1, "Unknown network family '%d'", sa->sa_family); |
96 | key_len = 0; | 96 | key_len = 0; |
97 | break; | 97 | break; |
98 | } | 98 | } |
@@ -152,7 +152,7 @@ static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer, | |||
152 | 152 | ||
153 | sharename = extract_sharename(tcon->treeName); | 153 | sharename = extract_sharename(tcon->treeName); |
154 | if (IS_ERR(sharename)) { | 154 | if (IS_ERR(sharename)) { |
155 | cFYI(1, "CIFS: couldn't extract sharename\n"); | 155 | cFYI(1, "%s: couldn't extract sharename\n", __func__); |
156 | sharename = NULL; | 156 | sharename = NULL; |
157 | return 0; | 157 | return 0; |
158 | } | 158 | } |
@@ -302,7 +302,7 @@ static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data) | |||
302 | pagevec_init(&pvec, 0); | 302 | pagevec_init(&pvec, 0); |
303 | first = 0; | 303 | first = 0; |
304 | 304 | ||
305 | cFYI(1, "cifs inode 0x%p now uncached", cifsi); | 305 | cFYI(1, "%s: cifs inode 0x%p now uncached", __func__, cifsi); |
306 | 306 | ||
307 | for (;;) { | 307 | for (;;) { |
308 | nr_pages = pagevec_lookup(&pvec, | 308 | nr_pages = pagevec_lookup(&pvec, |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 989442dcfb45..e9def996e383 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -352,6 +352,37 @@ cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server) | |||
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
355 | static void | ||
356 | cifs_show_security(struct seq_file *s, struct TCP_Server_Info *server) | ||
357 | { | ||
358 | seq_printf(s, ",sec="); | ||
359 | |||
360 | switch (server->secType) { | ||
361 | case LANMAN: | ||
362 | seq_printf(s, "lanman"); | ||
363 | break; | ||
364 | case NTLMv2: | ||
365 | seq_printf(s, "ntlmv2"); | ||
366 | break; | ||
367 | case NTLM: | ||
368 | seq_printf(s, "ntlm"); | ||
369 | break; | ||
370 | case Kerberos: | ||
371 | seq_printf(s, "krb5"); | ||
372 | break; | ||
373 | case RawNTLMSSP: | ||
374 | seq_printf(s, "ntlmssp"); | ||
375 | break; | ||
376 | default: | ||
377 | /* shouldn't ever happen */ | ||
378 | seq_printf(s, "unknown"); | ||
379 | break; | ||
380 | } | ||
381 | |||
382 | if (server->sec_mode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) | ||
383 | seq_printf(s, "i"); | ||
384 | } | ||
385 | |||
355 | /* | 386 | /* |
356 | * cifs_show_options() is for displaying mount options in /proc/mounts. | 387 | * cifs_show_options() is for displaying mount options in /proc/mounts. |
357 | * Not all settable options are displayed but most of the important | 388 | * Not all settable options are displayed but most of the important |
@@ -365,6 +396,8 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) | |||
365 | struct sockaddr *srcaddr; | 396 | struct sockaddr *srcaddr; |
366 | srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr; | 397 | srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr; |
367 | 398 | ||
399 | cifs_show_security(s, tcon->ses->server); | ||
400 | |||
368 | seq_printf(s, ",unc=%s", tcon->treeName); | 401 | seq_printf(s, ",unc=%s", tcon->treeName); |
369 | 402 | ||
370 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) | 403 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 64313f778ebf..0900e1658c96 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -129,5 +129,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); | |||
129 | extern const struct export_operations cifs_export_ops; | 129 | extern const struct export_operations cifs_export_ops; |
130 | #endif /* CIFS_NFSD_EXPORT */ | 130 | #endif /* CIFS_NFSD_EXPORT */ |
131 | 131 | ||
132 | #define CIFS_VERSION "1.72" | 132 | #define CIFS_VERSION "1.73" |
133 | #endif /* _CIFSFS_H */ | 133 | #endif /* _CIFSFS_H */ |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index bb659eb73810..12cf72dd0c42 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -152,7 +152,7 @@ cifs_reconnect(struct TCP_Server_Info *server) | |||
152 | mid_entry->callback(mid_entry); | 152 | mid_entry->callback(mid_entry); |
153 | } | 153 | } |
154 | 154 | ||
155 | while (server->tcpStatus == CifsNeedReconnect) { | 155 | do { |
156 | try_to_freeze(); | 156 | try_to_freeze(); |
157 | 157 | ||
158 | /* we should try only the port we connected to before */ | 158 | /* we should try only the port we connected to before */ |
@@ -167,7 +167,7 @@ cifs_reconnect(struct TCP_Server_Info *server) | |||
167 | server->tcpStatus = CifsNeedNegotiate; | 167 | server->tcpStatus = CifsNeedNegotiate; |
168 | spin_unlock(&GlobalMid_Lock); | 168 | spin_unlock(&GlobalMid_Lock); |
169 | } | 169 | } |
170 | } | 170 | } while (server->tcpStatus == CifsNeedReconnect); |
171 | 171 | ||
172 | return rc; | 172 | return rc; |
173 | } | 173 | } |
@@ -2149,7 +2149,10 @@ cifs_put_tlink(struct tcon_link *tlink) | |||
2149 | } | 2149 | } |
2150 | 2150 | ||
2151 | static inline struct tcon_link * | 2151 | static inline struct tcon_link * |
2152 | cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb); | 2152 | cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb) |
2153 | { | ||
2154 | return cifs_sb->master_tlink; | ||
2155 | } | ||
2153 | 2156 | ||
2154 | static int | 2157 | static int |
2155 | compare_mount_options(struct super_block *sb, struct cifs_mnt_data *mnt_data) | 2158 | compare_mount_options(struct super_block *sb, struct cifs_mnt_data *mnt_data) |
@@ -3171,6 +3174,10 @@ out: | |||
3171 | return rc; | 3174 | return rc; |
3172 | } | 3175 | } |
3173 | 3176 | ||
3177 | /* | ||
3178 | * Issue a TREE_CONNECT request. Note that for IPC$ shares, that the tcon | ||
3179 | * pointer may be NULL. | ||
3180 | */ | ||
3174 | int | 3181 | int |
3175 | CIFSTCon(unsigned int xid, struct cifs_ses *ses, | 3182 | CIFSTCon(unsigned int xid, struct cifs_ses *ses, |
3176 | const char *tree, struct cifs_tcon *tcon, | 3183 | const char *tree, struct cifs_tcon *tcon, |
@@ -3205,7 +3212,7 @@ CIFSTCon(unsigned int xid, struct cifs_ses *ses, | |||
3205 | pSMB->AndXCommand = 0xFF; | 3212 | pSMB->AndXCommand = 0xFF; |
3206 | pSMB->Flags = cpu_to_le16(TCON_EXTENDED_SECINFO); | 3213 | pSMB->Flags = cpu_to_le16(TCON_EXTENDED_SECINFO); |
3207 | bcc_ptr = &pSMB->Password[0]; | 3214 | bcc_ptr = &pSMB->Password[0]; |
3208 | if ((ses->server->sec_mode) & SECMODE_USER) { | 3215 | if (!tcon || (ses->server->sec_mode & SECMODE_USER)) { |
3209 | pSMB->PasswordLength = cpu_to_le16(1); /* minimum */ | 3216 | pSMB->PasswordLength = cpu_to_le16(1); /* minimum */ |
3210 | *bcc_ptr = 0; /* password is null byte */ | 3217 | *bcc_ptr = 0; /* password is null byte */ |
3211 | bcc_ptr++; /* skip password */ | 3218 | bcc_ptr++; /* skip password */ |
@@ -3371,7 +3378,7 @@ int cifs_negotiate_protocol(unsigned int xid, struct cifs_ses *ses) | |||
3371 | } | 3378 | } |
3372 | if (rc == 0) { | 3379 | if (rc == 0) { |
3373 | spin_lock(&GlobalMid_Lock); | 3380 | spin_lock(&GlobalMid_Lock); |
3374 | if (server->tcpStatus != CifsExiting) | 3381 | if (server->tcpStatus == CifsNeedNegotiate) |
3375 | server->tcpStatus = CifsGood; | 3382 | server->tcpStatus = CifsGood; |
3376 | else | 3383 | else |
3377 | rc = -EHOSTDOWN; | 3384 | rc = -EHOSTDOWN; |
@@ -3484,12 +3491,6 @@ out: | |||
3484 | return tcon; | 3491 | return tcon; |
3485 | } | 3492 | } |
3486 | 3493 | ||
3487 | static inline struct tcon_link * | ||
3488 | cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb) | ||
3489 | { | ||
3490 | return cifs_sb->master_tlink; | ||
3491 | } | ||
3492 | |||
3493 | struct cifs_tcon * | 3494 | struct cifs_tcon * |
3494 | cifs_sb_master_tcon(struct cifs_sb_info *cifs_sb) | 3495 | cifs_sb_master_tcon(struct cifs_sb_info *cifs_sb) |
3495 | { | 3496 | { |
diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c index d368a47ba5eb..816696621ec9 100644 --- a/fs/cifs/fscache.c +++ b/fs/cifs/fscache.c | |||
@@ -28,14 +28,14 @@ void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) | |||
28 | server->fscache = | 28 | server->fscache = |
29 | fscache_acquire_cookie(cifs_fscache_netfs.primary_index, | 29 | fscache_acquire_cookie(cifs_fscache_netfs.primary_index, |
30 | &cifs_fscache_server_index_def, server); | 30 | &cifs_fscache_server_index_def, server); |
31 | cFYI(1, "CIFS: get client cookie (0x%p/0x%p)", server, | 31 | cFYI(1, "%s: (0x%p/0x%p)", __func__, server, |
32 | server->fscache); | 32 | server->fscache); |
33 | } | 33 | } |
34 | 34 | ||
35 | void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) | 35 | void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) |
36 | { | 36 | { |
37 | cFYI(1, "CIFS: release client cookie (0x%p/0x%p)", server, | 37 | cFYI(1, "%s: (0x%p/0x%p)", __func__, server, |
38 | server->fscache); | 38 | server->fscache); |
39 | fscache_relinquish_cookie(server->fscache, 0); | 39 | fscache_relinquish_cookie(server->fscache, 0); |
40 | server->fscache = NULL; | 40 | server->fscache = NULL; |
41 | } | 41 | } |
@@ -47,13 +47,13 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon) | |||
47 | tcon->fscache = | 47 | tcon->fscache = |
48 | fscache_acquire_cookie(server->fscache, | 48 | fscache_acquire_cookie(server->fscache, |
49 | &cifs_fscache_super_index_def, tcon); | 49 | &cifs_fscache_super_index_def, tcon); |
50 | cFYI(1, "CIFS: get superblock cookie (0x%p/0x%p)", | 50 | cFYI(1, "%s: (0x%p/0x%p)", __func__, server->fscache, |
51 | server->fscache, tcon->fscache); | 51 | tcon->fscache); |
52 | } | 52 | } |
53 | 53 | ||
54 | void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon) | 54 | void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon) |
55 | { | 55 | { |
56 | cFYI(1, "CIFS: releasing superblock cookie (0x%p)", tcon->fscache); | 56 | cFYI(1, "%s: (0x%p)", __func__, tcon->fscache); |
57 | fscache_relinquish_cookie(tcon->fscache, 0); | 57 | fscache_relinquish_cookie(tcon->fscache, 0); |
58 | tcon->fscache = NULL; | 58 | tcon->fscache = NULL; |
59 | } | 59 | } |
@@ -70,8 +70,8 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode) | |||
70 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) { | 70 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) { |
71 | cifsi->fscache = fscache_acquire_cookie(tcon->fscache, | 71 | cifsi->fscache = fscache_acquire_cookie(tcon->fscache, |
72 | &cifs_fscache_inode_object_def, cifsi); | 72 | &cifs_fscache_inode_object_def, cifsi); |
73 | cFYI(1, "CIFS: got FH cookie (0x%p/0x%p)", tcon->fscache, | 73 | cFYI(1, "%s: got FH cookie (0x%p/0x%p)", __func__, |
74 | cifsi->fscache); | 74 | tcon->fscache, cifsi->fscache); |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
@@ -80,8 +80,7 @@ void cifs_fscache_release_inode_cookie(struct inode *inode) | |||
80 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | 80 | struct cifsInodeInfo *cifsi = CIFS_I(inode); |
81 | 81 | ||
82 | if (cifsi->fscache) { | 82 | if (cifsi->fscache) { |
83 | cFYI(1, "CIFS releasing inode cookie (0x%p)", | 83 | cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); |
84 | cifsi->fscache); | ||
85 | fscache_relinquish_cookie(cifsi->fscache, 0); | 84 | fscache_relinquish_cookie(cifsi->fscache, 0); |
86 | cifsi->fscache = NULL; | 85 | cifsi->fscache = NULL; |
87 | } | 86 | } |
@@ -92,8 +91,7 @@ static void cifs_fscache_disable_inode_cookie(struct inode *inode) | |||
92 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | 91 | struct cifsInodeInfo *cifsi = CIFS_I(inode); |
93 | 92 | ||
94 | if (cifsi->fscache) { | 93 | if (cifsi->fscache) { |
95 | cFYI(1, "CIFS disabling inode cookie (0x%p)", | 94 | cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); |
96 | cifsi->fscache); | ||
97 | fscache_relinquish_cookie(cifsi->fscache, 1); | 95 | fscache_relinquish_cookie(cifsi->fscache, 1); |
98 | cifsi->fscache = NULL; | 96 | cifsi->fscache = NULL; |
99 | } | 97 | } |
@@ -121,8 +119,8 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode) | |||
121 | cifs_sb_master_tcon(cifs_sb)->fscache, | 119 | cifs_sb_master_tcon(cifs_sb)->fscache, |
122 | &cifs_fscache_inode_object_def, | 120 | &cifs_fscache_inode_object_def, |
123 | cifsi); | 121 | cifsi); |
124 | cFYI(1, "CIFS: new cookie 0x%p oldcookie 0x%p", | 122 | cFYI(1, "%s: new cookie 0x%p oldcookie 0x%p", |
125 | cifsi->fscache, old); | 123 | __func__, cifsi->fscache, old); |
126 | } | 124 | } |
127 | } | 125 | } |
128 | 126 | ||
@@ -132,8 +130,8 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) | |||
132 | struct inode *inode = page->mapping->host; | 130 | struct inode *inode = page->mapping->host; |
133 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | 131 | struct cifsInodeInfo *cifsi = CIFS_I(inode); |
134 | 132 | ||
135 | cFYI(1, "CIFS: fscache release page (0x%p/0x%p)", | 133 | cFYI(1, "%s: (0x%p/0x%p)", __func__, page, |
136 | page, cifsi->fscache); | 134 | cifsi->fscache); |
137 | if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) | 135 | if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) |
138 | return 0; | 136 | return 0; |
139 | } | 137 | } |
@@ -144,8 +142,7 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) | |||
144 | static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx, | 142 | static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx, |
145 | int error) | 143 | int error) |
146 | { | 144 | { |
147 | cFYI(1, "CFS: readpage_from_fscache_complete (0x%p/%d)", | 145 | cFYI(1, "%s: (0x%p/%d)", __func__, page, error); |
148 | page, error); | ||
149 | if (!error) | 146 | if (!error) |
150 | SetPageUptodate(page); | 147 | SetPageUptodate(page); |
151 | unlock_page(page); | 148 | unlock_page(page); |
@@ -158,7 +155,7 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page) | |||
158 | { | 155 | { |
159 | int ret; | 156 | int ret; |
160 | 157 | ||
161 | cFYI(1, "CIFS: readpage_from_fscache(fsc:%p, p:%p, i:0x%p", | 158 | cFYI(1, "%s: (fsc:%p, p:%p, i:0x%p", __func__, |
162 | CIFS_I(inode)->fscache, page, inode); | 159 | CIFS_I(inode)->fscache, page, inode); |
163 | ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page, | 160 | ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page, |
164 | cifs_readpage_from_fscache_complete, | 161 | cifs_readpage_from_fscache_complete, |
@@ -167,11 +164,11 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page) | |||
167 | switch (ret) { | 164 | switch (ret) { |
168 | 165 | ||
169 | case 0: /* page found in fscache, read submitted */ | 166 | case 0: /* page found in fscache, read submitted */ |
170 | cFYI(1, "CIFS: readpage_from_fscache: submitted"); | 167 | cFYI(1, "%s: submitted", __func__); |
171 | return ret; | 168 | return ret; |
172 | case -ENOBUFS: /* page won't be cached */ | 169 | case -ENOBUFS: /* page won't be cached */ |
173 | case -ENODATA: /* page not in cache */ | 170 | case -ENODATA: /* page not in cache */ |
174 | cFYI(1, "CIFS: readpage_from_fscache %d", ret); | 171 | cFYI(1, "%s: %d", __func__, ret); |
175 | return 1; | 172 | return 1; |
176 | 173 | ||
177 | default: | 174 | default: |
@@ -190,7 +187,7 @@ int __cifs_readpages_from_fscache(struct inode *inode, | |||
190 | { | 187 | { |
191 | int ret; | 188 | int ret; |
192 | 189 | ||
193 | cFYI(1, "CIFS: __cifs_readpages_from_fscache (0x%p/%u/0x%p)", | 190 | cFYI(1, "%s: (0x%p/%u/0x%p)", __func__, |
194 | CIFS_I(inode)->fscache, *nr_pages, inode); | 191 | CIFS_I(inode)->fscache, *nr_pages, inode); |
195 | ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping, | 192 | ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping, |
196 | pages, nr_pages, | 193 | pages, nr_pages, |
@@ -199,12 +196,12 @@ int __cifs_readpages_from_fscache(struct inode *inode, | |||
199 | mapping_gfp_mask(mapping)); | 196 | mapping_gfp_mask(mapping)); |
200 | switch (ret) { | 197 | switch (ret) { |
201 | case 0: /* read submitted to the cache for all pages */ | 198 | case 0: /* read submitted to the cache for all pages */ |
202 | cFYI(1, "CIFS: readpages_from_fscache: submitted"); | 199 | cFYI(1, "%s: submitted", __func__); |
203 | return ret; | 200 | return ret; |
204 | 201 | ||
205 | case -ENOBUFS: /* some pages are not cached and can't be */ | 202 | case -ENOBUFS: /* some pages are not cached and can't be */ |
206 | case -ENODATA: /* some pages are not cached */ | 203 | case -ENODATA: /* some pages are not cached */ |
207 | cFYI(1, "CIFS: readpages_from_fscache: no page"); | 204 | cFYI(1, "%s: no page", __func__); |
208 | return 1; | 205 | return 1; |
209 | 206 | ||
210 | default: | 207 | default: |
@@ -218,7 +215,7 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page) | |||
218 | { | 215 | { |
219 | int ret; | 216 | int ret; |
220 | 217 | ||
221 | cFYI(1, "CIFS: readpage_to_fscache(fsc: %p, p: %p, i: %p", | 218 | cFYI(1, "%s: (fsc: %p, p: %p, i: %p)", __func__, |
222 | CIFS_I(inode)->fscache, page, inode); | 219 | CIFS_I(inode)->fscache, page, inode); |
223 | ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL); | 220 | ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL); |
224 | if (ret != 0) | 221 | if (ret != 0) |
@@ -230,7 +227,7 @@ void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) | |||
230 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | 227 | struct cifsInodeInfo *cifsi = CIFS_I(inode); |
231 | struct fscache_cookie *cookie = cifsi->fscache; | 228 | struct fscache_cookie *cookie = cifsi->fscache; |
232 | 229 | ||
233 | cFYI(1, "CIFS: fscache invalidatepage (0x%p/0x%p)", page, cookie); | 230 | cFYI(1, "%s: (0x%p/0x%p)", __func__, page, cookie); |
234 | fscache_wait_on_page_write(cookie, page); | 231 | fscache_wait_on_page_write(cookie, page); |
235 | fscache_uncache_page(cookie, page); | 232 | fscache_uncache_page(cookie, page); |
236 | } | 233 | } |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index e9b8e5926bef..76bff2bff15e 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -88,7 +88,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, | |||
88 | pmd_t pmd = *pmdp; | 88 | pmd_t pmd = *pmdp; |
89 | pmd_clear(mm, address, pmdp); | 89 | pmd_clear(mm, address, pmdp); |
90 | return pmd; | 90 | return pmd; |
91 | }) | 91 | } |
92 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 92 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
93 | #endif | 93 | #endif |
94 | 94 | ||
diff --git a/include/linux/i2c/adp8870.h b/include/linux/i2c/adp8870.h new file mode 100644 index 000000000000..624dceccbd5b --- /dev/null +++ b/include/linux/i2c/adp8870.h | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * Definitions and platform data for Analog Devices | ||
3 | * Backlight drivers ADP8870 | ||
4 | * | ||
5 | * Copyright 2009-2010 Analog Devices Inc. | ||
6 | * | ||
7 | * Licensed under the GPL-2 or later. | ||
8 | */ | ||
9 | |||
10 | #ifndef __LINUX_I2C_ADP8870_H | ||
11 | #define __LINUX_I2C_ADP8870_H | ||
12 | |||
13 | #define ID_ADP8870 8870 | ||
14 | |||
15 | #define ADP8870_MAX_BRIGHTNESS 0x7F | ||
16 | #define FLAG_OFFT_SHIFT 8 | ||
17 | |||
18 | /* | ||
19 | * LEDs subdevice platform data | ||
20 | */ | ||
21 | |||
22 | #define ADP8870_LED_DIS_BLINK (0 << FLAG_OFFT_SHIFT) | ||
23 | #define ADP8870_LED_OFFT_600ms (1 << FLAG_OFFT_SHIFT) | ||
24 | #define ADP8870_LED_OFFT_1200ms (2 << FLAG_OFFT_SHIFT) | ||
25 | #define ADP8870_LED_OFFT_1800ms (3 << FLAG_OFFT_SHIFT) | ||
26 | |||
27 | #define ADP8870_LED_ONT_200ms 0 | ||
28 | #define ADP8870_LED_ONT_600ms 1 | ||
29 | #define ADP8870_LED_ONT_800ms 2 | ||
30 | #define ADP8870_LED_ONT_1200ms 3 | ||
31 | |||
32 | #define ADP8870_LED_D7 (7) | ||
33 | #define ADP8870_LED_D6 (6) | ||
34 | #define ADP8870_LED_D5 (5) | ||
35 | #define ADP8870_LED_D4 (4) | ||
36 | #define ADP8870_LED_D3 (3) | ||
37 | #define ADP8870_LED_D2 (2) | ||
38 | #define ADP8870_LED_D1 (1) | ||
39 | |||
40 | /* | ||
41 | * Backlight subdevice platform data | ||
42 | */ | ||
43 | |||
44 | #define ADP8870_BL_D7 (1 << 6) | ||
45 | #define ADP8870_BL_D6 (1 << 5) | ||
46 | #define ADP8870_BL_D5 (1 << 4) | ||
47 | #define ADP8870_BL_D4 (1 << 3) | ||
48 | #define ADP8870_BL_D3 (1 << 2) | ||
49 | #define ADP8870_BL_D2 (1 << 1) | ||
50 | #define ADP8870_BL_D1 (1 << 0) | ||
51 | |||
52 | #define ADP8870_FADE_T_DIS 0 /* Fade Timer Disabled */ | ||
53 | #define ADP8870_FADE_T_300ms 1 /* 0.3 Sec */ | ||
54 | #define ADP8870_FADE_T_600ms 2 | ||
55 | #define ADP8870_FADE_T_900ms 3 | ||
56 | #define ADP8870_FADE_T_1200ms 4 | ||
57 | #define ADP8870_FADE_T_1500ms 5 | ||
58 | #define ADP8870_FADE_T_1800ms 6 | ||
59 | #define ADP8870_FADE_T_2100ms 7 | ||
60 | #define ADP8870_FADE_T_2400ms 8 | ||
61 | #define ADP8870_FADE_T_2700ms 9 | ||
62 | #define ADP8870_FADE_T_3000ms 10 | ||
63 | #define ADP8870_FADE_T_3500ms 11 | ||
64 | #define ADP8870_FADE_T_4000ms 12 | ||
65 | #define ADP8870_FADE_T_4500ms 13 | ||
66 | #define ADP8870_FADE_T_5000ms 14 | ||
67 | #define ADP8870_FADE_T_5500ms 15 /* 5.5 Sec */ | ||
68 | |||
69 | #define ADP8870_FADE_LAW_LINEAR 0 | ||
70 | #define ADP8870_FADE_LAW_SQUARE 1 | ||
71 | #define ADP8870_FADE_LAW_CUBIC1 2 | ||
72 | #define ADP8870_FADE_LAW_CUBIC2 3 | ||
73 | |||
74 | #define ADP8870_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */ | ||
75 | #define ADP8870_BL_AMBL_FILT_160ms 1 | ||
76 | #define ADP8870_BL_AMBL_FILT_320ms 2 | ||
77 | #define ADP8870_BL_AMBL_FILT_640ms 3 | ||
78 | #define ADP8870_BL_AMBL_FILT_1280ms 4 | ||
79 | #define ADP8870_BL_AMBL_FILT_2560ms 5 | ||
80 | #define ADP8870_BL_AMBL_FILT_5120ms 6 | ||
81 | #define ADP8870_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */ | ||
82 | |||
83 | /* | ||
84 | * Blacklight current 0..30mA | ||
85 | */ | ||
86 | #define ADP8870_BL_CUR_mA(I) ((I * 127) / 30) | ||
87 | |||
88 | /* | ||
89 | * L2 comparator current 0..1106uA | ||
90 | */ | ||
91 | #define ADP8870_L2_COMP_CURR_uA(I) ((I * 255) / 1106) | ||
92 | |||
93 | /* | ||
94 | * L3 comparator current 0..551uA | ||
95 | */ | ||
96 | #define ADP8870_L3_COMP_CURR_uA(I) ((I * 255) / 551) | ||
97 | |||
98 | /* | ||
99 | * L4 comparator current 0..275uA | ||
100 | */ | ||
101 | #define ADP8870_L4_COMP_CURR_uA(I) ((I * 255) / 275) | ||
102 | |||
103 | /* | ||
104 | * L5 comparator current 0..138uA | ||
105 | */ | ||
106 | #define ADP8870_L5_COMP_CURR_uA(I) ((I * 255) / 138) | ||
107 | |||
108 | struct adp8870_backlight_platform_data { | ||
109 | u8 bl_led_assign; /* 1 = Backlight 0 = Individual LED */ | ||
110 | u8 pwm_assign; /* 1 = Enables PWM mode */ | ||
111 | |||
112 | u8 bl_fade_in; /* Backlight Fade-In Timer */ | ||
113 | u8 bl_fade_out; /* Backlight Fade-Out Timer */ | ||
114 | u8 bl_fade_law; /* fade-on/fade-off transfer characteristic */ | ||
115 | |||
116 | u8 en_ambl_sens; /* 1 = enable ambient light sensor */ | ||
117 | u8 abml_filt; /* Light sensor filter time */ | ||
118 | |||
119 | u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
120 | u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
121 | u8 l2_bright_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
122 | u8 l2_bright_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
123 | u8 l3_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
124 | u8 l3_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
125 | u8 l4_indoor_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
126 | u8 l4_indor_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
127 | u8 l5_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
128 | u8 l5_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
129 | |||
130 | u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */ | ||
131 | u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */ | ||
132 | u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */ | ||
133 | u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */ | ||
134 | u8 l4_trip; /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */ | ||
135 | u8 l4_hyst; /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */ | ||
136 | u8 l5_trip; /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */ | ||
137 | u8 l5_hyst; /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */ | ||
138 | |||
139 | /** | ||
140 | * Independent Current Sinks / LEDS | ||
141 | * Sinks not assigned to the Backlight can be exposed to | ||
142 | * user space using the LEDS CLASS interface | ||
143 | */ | ||
144 | |||
145 | int num_leds; | ||
146 | struct led_info *leds; | ||
147 | u8 led_fade_in; /* LED Fade-In Timer */ | ||
148 | u8 led_fade_out; /* LED Fade-Out Timer */ | ||
149 | u8 led_fade_law; /* fade-on/fade-off transfer characteristic */ | ||
150 | u8 led_on_time; | ||
151 | }; | ||
152 | |||
153 | #endif /* __LINUX_I2C_ADP8870_H */ | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index fb0e7329fee1..953352a88336 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -671,8 +671,8 @@ struct sysinfo { | |||
671 | 671 | ||
672 | #ifdef __CHECKER__ | 672 | #ifdef __CHECKER__ |
673 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) | 673 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) |
674 | #define BUILD_BUG_ON_ZERO(e) | 674 | #define BUILD_BUG_ON_ZERO(e) (0) |
675 | #define BUILD_BUG_ON_NULL(e) | 675 | #define BUILD_BUG_ON_NULL(e) ((void*)0) |
676 | #define BUILD_BUG_ON(condition) | 676 | #define BUILD_BUG_ON(condition) |
677 | #else /* __CHECKER__ */ | 677 | #else /* __CHECKER__ */ |
678 | 678 | ||
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h index 2a0d7d651dc3..ee0c952188de 100644 --- a/include/linux/kmsg_dump.h +++ b/include/linux/kmsg_dump.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #ifndef _LINUX_KMSG_DUMP_H | 12 | #ifndef _LINUX_KMSG_DUMP_H |
13 | #define _LINUX_KMSG_DUMP_H | 13 | #define _LINUX_KMSG_DUMP_H |
14 | 14 | ||
15 | #include <linux/errno.h> | ||
15 | #include <linux/list.h> | 16 | #include <linux/list.h> |
16 | 17 | ||
17 | enum kmsg_dump_reason { | 18 | enum kmsg_dump_reason { |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 9724a38ee69d..50940da6adf3 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -84,6 +84,7 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | |||
84 | 84 | ||
85 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | 85 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
86 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 86 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
87 | extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm); | ||
87 | 88 | ||
88 | static inline | 89 | static inline |
89 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) | 90 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) |
@@ -246,6 +247,11 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page) | |||
246 | return NULL; | 247 | return NULL; |
247 | } | 248 | } |
248 | 249 | ||
250 | static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm) | ||
251 | { | ||
252 | return NULL; | ||
253 | } | ||
254 | |||
249 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | 255 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) |
250 | { | 256 | { |
251 | return 1; | 257 | return 1; |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 384eb5fe530b..e70564647039 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -358,6 +358,7 @@ struct backing_dev_info; | |||
358 | extern struct mm_struct *swap_token_mm; | 358 | extern struct mm_struct *swap_token_mm; |
359 | extern void grab_swap_token(struct mm_struct *); | 359 | extern void grab_swap_token(struct mm_struct *); |
360 | extern void __put_swap_token(struct mm_struct *); | 360 | extern void __put_swap_token(struct mm_struct *); |
361 | extern void disable_swap_token(struct mem_cgroup *memcg); | ||
361 | 362 | ||
362 | static inline int has_swap_token(struct mm_struct *mm) | 363 | static inline int has_swap_token(struct mm_struct *mm) |
363 | { | 364 | { |
@@ -370,11 +371,6 @@ static inline void put_swap_token(struct mm_struct *mm) | |||
370 | __put_swap_token(mm); | 371 | __put_swap_token(mm); |
371 | } | 372 | } |
372 | 373 | ||
373 | static inline void disable_swap_token(void) | ||
374 | { | ||
375 | put_swap_token(swap_token_mm); | ||
376 | } | ||
377 | |||
378 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 374 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
379 | extern void | 375 | extern void |
380 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); | 376 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); |
@@ -500,7 +496,7 @@ static inline int has_swap_token(struct mm_struct *mm) | |||
500 | return 0; | 496 | return 0; |
501 | } | 497 | } |
502 | 498 | ||
503 | static inline void disable_swap_token(void) | 499 | static inline void disable_swap_token(struct mem_cgroup *memcg) |
504 | { | 500 | { |
505 | } | 501 | } |
506 | 502 | ||
diff --git a/include/linux/topology.h b/include/linux/topology.h index b91a40e847d2..fc839bfa7935 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -60,7 +60,7 @@ int arch_update_cpu_topology(void); | |||
60 | * (in whatever arch specific measurement units returned by node_distance()) | 60 | * (in whatever arch specific measurement units returned by node_distance()) |
61 | * then switch on zone reclaim on boot. | 61 | * then switch on zone reclaim on boot. |
62 | */ | 62 | */ |
63 | #define RECLAIM_DISTANCE 20 | 63 | #define RECLAIM_DISTANCE 30 |
64 | #endif | 64 | #endif |
65 | #ifndef PENALTY_FOR_NODE_WITH_CPUS | 65 | #ifndef PENALTY_FOR_NODE_WITH_CPUS |
66 | #define PENALTY_FOR_NODE_WITH_CPUS (1) | 66 | #define PENALTY_FOR_NODE_WITH_CPUS (1) |
diff --git a/include/linux/uts.h b/include/linux/uts.h index 73eb1ed36ec4..6ddbd86377de 100644 --- a/include/linux/uts.h +++ b/include/linux/uts.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #endif | 9 | #endif |
10 | 10 | ||
11 | #ifndef UTS_NODENAME | 11 | #ifndef UTS_NODENAME |
12 | #define UTS_NODENAME "(none)" /* set by sethostname() */ | 12 | #define UTS_NODENAME CONFIG_DEFAULT_HOSTNAME /* set by sethostname() */ |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #ifndef UTS_DOMAINNAME | 15 | #ifndef UTS_DOMAINNAME |
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index ea422aaa23e1..b2c33bd955fa 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -6,6 +6,8 @@ | |||
6 | 6 | ||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | #include <linux/mm.h> | ||
10 | #include <linux/memcontrol.h> | ||
9 | #include "gfpflags.h" | 11 | #include "gfpflags.h" |
10 | 12 | ||
11 | #define RECLAIM_WB_ANON 0x0001u | 13 | #define RECLAIM_WB_ANON 0x0001u |
@@ -310,6 +312,87 @@ TRACE_EVENT(mm_vmscan_lru_shrink_inactive, | |||
310 | show_reclaim_flags(__entry->reclaim_flags)) | 312 | show_reclaim_flags(__entry->reclaim_flags)) |
311 | ); | 313 | ); |
312 | 314 | ||
315 | TRACE_EVENT(replace_swap_token, | ||
316 | TP_PROTO(struct mm_struct *old_mm, | ||
317 | struct mm_struct *new_mm), | ||
318 | |||
319 | TP_ARGS(old_mm, new_mm), | ||
320 | |||
321 | TP_STRUCT__entry( | ||
322 | __field(struct mm_struct*, old_mm) | ||
323 | __field(unsigned int, old_prio) | ||
324 | __field(struct mm_struct*, new_mm) | ||
325 | __field(unsigned int, new_prio) | ||
326 | ), | ||
327 | |||
328 | TP_fast_assign( | ||
329 | __entry->old_mm = old_mm; | ||
330 | __entry->old_prio = old_mm ? old_mm->token_priority : 0; | ||
331 | __entry->new_mm = new_mm; | ||
332 | __entry->new_prio = new_mm->token_priority; | ||
333 | ), | ||
334 | |||
335 | TP_printk("old_token_mm=%p old_prio=%u new_token_mm=%p new_prio=%u", | ||
336 | __entry->old_mm, __entry->old_prio, | ||
337 | __entry->new_mm, __entry->new_prio) | ||
338 | ); | ||
339 | |||
340 | DECLARE_EVENT_CLASS(put_swap_token_template, | ||
341 | TP_PROTO(struct mm_struct *swap_token_mm), | ||
342 | |||
343 | TP_ARGS(swap_token_mm), | ||
344 | |||
345 | TP_STRUCT__entry( | ||
346 | __field(struct mm_struct*, swap_token_mm) | ||
347 | ), | ||
348 | |||
349 | TP_fast_assign( | ||
350 | __entry->swap_token_mm = swap_token_mm; | ||
351 | ), | ||
352 | |||
353 | TP_printk("token_mm=%p", __entry->swap_token_mm) | ||
354 | ); | ||
355 | |||
356 | DEFINE_EVENT(put_swap_token_template, put_swap_token, | ||
357 | TP_PROTO(struct mm_struct *swap_token_mm), | ||
358 | TP_ARGS(swap_token_mm) | ||
359 | ); | ||
360 | |||
361 | DEFINE_EVENT_CONDITION(put_swap_token_template, disable_swap_token, | ||
362 | TP_PROTO(struct mm_struct *swap_token_mm), | ||
363 | TP_ARGS(swap_token_mm), | ||
364 | TP_CONDITION(swap_token_mm != NULL) | ||
365 | ); | ||
366 | |||
367 | TRACE_EVENT_CONDITION(update_swap_token_priority, | ||
368 | TP_PROTO(struct mm_struct *mm, | ||
369 | unsigned int old_prio, | ||
370 | struct mm_struct *swap_token_mm), | ||
371 | |||
372 | TP_ARGS(mm, old_prio, swap_token_mm), | ||
373 | |||
374 | TP_CONDITION(mm->token_priority != old_prio), | ||
375 | |||
376 | TP_STRUCT__entry( | ||
377 | __field(struct mm_struct*, mm) | ||
378 | __field(unsigned int, old_prio) | ||
379 | __field(unsigned int, new_prio) | ||
380 | __field(struct mm_struct*, swap_token_mm) | ||
381 | __field(unsigned int, swap_token_prio) | ||
382 | ), | ||
383 | |||
384 | TP_fast_assign( | ||
385 | __entry->mm = mm; | ||
386 | __entry->old_prio = old_prio; | ||
387 | __entry->new_prio = mm->token_priority; | ||
388 | __entry->swap_token_mm = swap_token_mm; | ||
389 | __entry->swap_token_prio = swap_token_mm ? swap_token_mm->token_priority : 0; | ||
390 | ), | ||
391 | |||
392 | TP_printk("mm=%p old_prio=%u new_prio=%u swap_token_mm=%p token_prio=%u", | ||
393 | __entry->mm, __entry->old_prio, __entry->new_prio, | ||
394 | __entry->swap_token_mm, __entry->swap_token_prio) | ||
395 | ); | ||
313 | 396 | ||
314 | #endif /* _TRACE_VMSCAN_H */ | 397 | #endif /* _TRACE_VMSCAN_H */ |
315 | 398 | ||
diff --git a/init/Kconfig b/init/Kconfig index ebafac4231ee..412c21b00d51 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -19,7 +19,6 @@ config DEFCONFIG_LIST | |||
19 | config CONSTRUCTORS | 19 | config CONSTRUCTORS |
20 | bool | 20 | bool |
21 | depends on !UML | 21 | depends on !UML |
22 | default y | ||
23 | 22 | ||
24 | config HAVE_IRQ_WORK | 23 | config HAVE_IRQ_WORK |
25 | bool | 24 | bool |
@@ -204,6 +203,15 @@ config KERNEL_LZO | |||
204 | 203 | ||
205 | endchoice | 204 | endchoice |
206 | 205 | ||
206 | config DEFAULT_HOSTNAME | ||
207 | string "Default hostname" | ||
208 | default "(none)" | ||
209 | help | ||
210 | This option determines the default system hostname before userspace | ||
211 | calls sethostname(2). The kernel traditionally uses "(none)" here, | ||
212 | but you may wish to use a different default here to make a minimal | ||
213 | system more usable with less configuration. | ||
214 | |||
207 | config SWAP | 215 | config SWAP |
208 | bool "Support for paging of anonymous memory (swap)" | 216 | bool "Support for paging of anonymous memory (swap)" |
209 | depends on MMU && BLOCK | 217 | depends on MMU && BLOCK |
diff --git a/init/calibrate.c b/init/calibrate.c index cfd7000c9d71..2568d22a304e 100644 --- a/init/calibrate.c +++ b/init/calibrate.c | |||
@@ -93,9 +93,6 @@ static unsigned long __cpuinit calibrate_delay_direct(void) | |||
93 | * If the upper limit and lower limit of the timer_rate is | 93 | * If the upper limit and lower limit of the timer_rate is |
94 | * >= 12.5% apart, redo calibration. | 94 | * >= 12.5% apart, redo calibration. |
95 | */ | 95 | */ |
96 | printk(KERN_DEBUG "calibrate_delay_direct() timer_rate_max=%lu " | ||
97 | "timer_rate_min=%lu pre_start=%lu pre_end=%lu\n", | ||
98 | timer_rate_max, timer_rate_min, pre_start, pre_end); | ||
99 | if (start >= post_end) | 96 | if (start >= post_end) |
100 | printk(KERN_NOTICE "calibrate_delay_direct() ignoring " | 97 | printk(KERN_NOTICE "calibrate_delay_direct() ignoring " |
101 | "timer_rate as we had a TSC wrap around" | 98 | "timer_rate as we had a TSC wrap around" |
diff --git a/kernel/exit.c b/kernel/exit.c index 20a406471525..f2b321bae440 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -561,29 +561,28 @@ void exit_files(struct task_struct *tsk) | |||
561 | 561 | ||
562 | #ifdef CONFIG_MM_OWNER | 562 | #ifdef CONFIG_MM_OWNER |
563 | /* | 563 | /* |
564 | * Task p is exiting and it owned mm, lets find a new owner for it | 564 | * A task is exiting. If it owned this mm, find a new owner for the mm. |
565 | */ | 565 | */ |
566 | static inline int | ||
567 | mm_need_new_owner(struct mm_struct *mm, struct task_struct *p) | ||
568 | { | ||
569 | /* | ||
570 | * If there are other users of the mm and the owner (us) is exiting | ||
571 | * we need to find a new owner to take on the responsibility. | ||
572 | */ | ||
573 | if (atomic_read(&mm->mm_users) <= 1) | ||
574 | return 0; | ||
575 | if (mm->owner != p) | ||
576 | return 0; | ||
577 | return 1; | ||
578 | } | ||
579 | |||
580 | void mm_update_next_owner(struct mm_struct *mm) | 566 | void mm_update_next_owner(struct mm_struct *mm) |
581 | { | 567 | { |
582 | struct task_struct *c, *g, *p = current; | 568 | struct task_struct *c, *g, *p = current; |
583 | 569 | ||
584 | retry: | 570 | retry: |
585 | if (!mm_need_new_owner(mm, p)) | 571 | /* |
572 | * If the exiting or execing task is not the owner, it's | ||
573 | * someone else's problem. | ||
574 | */ | ||
575 | if (mm->owner != p) | ||
586 | return; | 576 | return; |
577 | /* | ||
578 | * The current owner is exiting/execing and there are no other | ||
579 | * candidates. Do not leave the mm pointing to a possibly | ||
580 | * freed task structure. | ||
581 | */ | ||
582 | if (atomic_read(&mm->mm_users) <= 1) { | ||
583 | mm->owner = NULL; | ||
584 | return; | ||
585 | } | ||
587 | 586 | ||
588 | read_lock(&tasklist_lock); | 587 | read_lock(&tasklist_lock); |
589 | /* | 588 | /* |
diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig index b8cadf70b1fb..5bf924d80b5c 100644 --- a/kernel/gcov/Kconfig +++ b/kernel/gcov/Kconfig | |||
@@ -2,7 +2,8 @@ menu "GCOV-based kernel profiling" | |||
2 | 2 | ||
3 | config GCOV_KERNEL | 3 | config GCOV_KERNEL |
4 | bool "Enable gcov-based kernel profiling" | 4 | bool "Enable gcov-based kernel profiling" |
5 | depends on DEBUG_FS && CONSTRUCTORS | 5 | depends on DEBUG_FS |
6 | select CONSTRUCTORS | ||
6 | default n | 7 | default n |
7 | ---help--- | 8 | ---help--- |
8 | This option enables gcov-based code profiling (e.g. for code coverage | 9 | This option enables gcov-based code profiling (e.g. for code coverage |
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 88725c939e0b..10d018212bab 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -1096,7 +1096,7 @@ static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p, int flag | |||
1096 | * to move current somewhere else, making room for our non-migratable | 1096 | * to move current somewhere else, making room for our non-migratable |
1097 | * task. | 1097 | * task. |
1098 | */ | 1098 | */ |
1099 | if (p->prio == rq->curr->prio && !need_resched()) | 1099 | if (p->prio == rq->curr->prio && !test_tsk_need_resched(rq->curr)) |
1100 | check_preempt_equal_prio(rq, p); | 1100 | check_preempt_equal_prio(rq, p); |
1101 | #endif | 1101 | #endif |
1102 | } | 1102 | } |
@@ -1239,6 +1239,10 @@ static int find_lowest_rq(struct task_struct *task) | |||
1239 | int this_cpu = smp_processor_id(); | 1239 | int this_cpu = smp_processor_id(); |
1240 | int cpu = task_cpu(task); | 1240 | int cpu = task_cpu(task); |
1241 | 1241 | ||
1242 | /* Make sure the mask is initialized first */ | ||
1243 | if (unlikely(!lowest_mask)) | ||
1244 | return -1; | ||
1245 | |||
1242 | if (task->rt.nr_cpus_allowed == 1) | 1246 | if (task->rt.nr_cpus_allowed == 1) |
1243 | return -1; /* No other targets possible */ | 1247 | return -1; /* No other targets possible */ |
1244 | 1248 | ||
diff --git a/kernel/signal.c b/kernel/signal.c index 86c32b884f8e..ff7678603328 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -2365,7 +2365,7 @@ int sigprocmask(int how, sigset_t *set, sigset_t *oldset) | |||
2365 | /** | 2365 | /** |
2366 | * sys_rt_sigprocmask - change the list of currently blocked signals | 2366 | * sys_rt_sigprocmask - change the list of currently blocked signals |
2367 | * @how: whether to add, remove, or set signals | 2367 | * @how: whether to add, remove, or set signals |
2368 | * @set: stores pending signals | 2368 | * @nset: stores pending signals |
2369 | * @oset: previous value of signal mask if non-null | 2369 | * @oset: previous value of signal mask if non-null |
2370 | * @sigsetsize: size of sigset_t type | 2370 | * @sigsetsize: size of sigset_t type |
2371 | */ | 2371 | */ |
diff --git a/lib/bitmap.c b/lib/bitmap.c index 41baf02924e6..3f3b68199d74 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c | |||
@@ -572,7 +572,7 @@ EXPORT_SYMBOL(bitmap_scnlistprintf); | |||
572 | 572 | ||
573 | /** | 573 | /** |
574 | * __bitmap_parselist - convert list format ASCII string to bitmap | 574 | * __bitmap_parselist - convert list format ASCII string to bitmap |
575 | * @bp: read nul-terminated user string from this buffer | 575 | * @buf: read nul-terminated user string from this buffer |
576 | * @buflen: buffer size in bytes. If string is smaller than this | 576 | * @buflen: buffer size in bytes. If string is smaller than this |
577 | * then it must be terminated with a \0. | 577 | * then it must be terminated with a \0. |
578 | * @is_user: location of buffer, 0 indicates kernel space | 578 | * @is_user: location of buffer, 0 indicates kernel space |
diff --git a/mm/compaction.c b/mm/compaction.c index 021a2960ef9e..6cc604bd5649 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -144,9 +144,20 @@ static void isolate_freepages(struct zone *zone, | |||
144 | int nr_freepages = cc->nr_freepages; | 144 | int nr_freepages = cc->nr_freepages; |
145 | struct list_head *freelist = &cc->freepages; | 145 | struct list_head *freelist = &cc->freepages; |
146 | 146 | ||
147 | /* | ||
148 | * Initialise the free scanner. The starting point is where we last | ||
149 | * scanned from (or the end of the zone if starting). The low point | ||
150 | * is the end of the pageblock the migration scanner is using. | ||
151 | */ | ||
147 | pfn = cc->free_pfn; | 152 | pfn = cc->free_pfn; |
148 | low_pfn = cc->migrate_pfn + pageblock_nr_pages; | 153 | low_pfn = cc->migrate_pfn + pageblock_nr_pages; |
149 | high_pfn = low_pfn; | 154 | |
155 | /* | ||
156 | * Take care that if the migration scanner is at the end of the zone | ||
157 | * that the free scanner does not accidentally move to the next zone | ||
158 | * in the next isolation cycle. | ||
159 | */ | ||
160 | high_pfn = min(low_pfn, pfn); | ||
150 | 161 | ||
151 | /* | 162 | /* |
152 | * Isolate free pages until enough are available to migrate the | 163 | * Isolate free pages until enough are available to migrate the |
@@ -240,11 +251,18 @@ static bool too_many_isolated(struct zone *zone) | |||
240 | return isolated > (inactive + active) / 2; | 251 | return isolated > (inactive + active) / 2; |
241 | } | 252 | } |
242 | 253 | ||
254 | /* possible outcome of isolate_migratepages */ | ||
255 | typedef enum { | ||
256 | ISOLATE_ABORT, /* Abort compaction now */ | ||
257 | ISOLATE_NONE, /* No pages isolated, continue scanning */ | ||
258 | ISOLATE_SUCCESS, /* Pages isolated, migrate */ | ||
259 | } isolate_migrate_t; | ||
260 | |||
243 | /* | 261 | /* |
244 | * Isolate all pages that can be migrated from the block pointed to by | 262 | * Isolate all pages that can be migrated from the block pointed to by |
245 | * the migrate scanner within compact_control. | 263 | * the migrate scanner within compact_control. |
246 | */ | 264 | */ |
247 | static unsigned long isolate_migratepages(struct zone *zone, | 265 | static isolate_migrate_t isolate_migratepages(struct zone *zone, |
248 | struct compact_control *cc) | 266 | struct compact_control *cc) |
249 | { | 267 | { |
250 | unsigned long low_pfn, end_pfn; | 268 | unsigned long low_pfn, end_pfn; |
@@ -261,7 +279,7 @@ static unsigned long isolate_migratepages(struct zone *zone, | |||
261 | /* Do not cross the free scanner or scan within a memory hole */ | 279 | /* Do not cross the free scanner or scan within a memory hole */ |
262 | if (end_pfn > cc->free_pfn || !pfn_valid(low_pfn)) { | 280 | if (end_pfn > cc->free_pfn || !pfn_valid(low_pfn)) { |
263 | cc->migrate_pfn = end_pfn; | 281 | cc->migrate_pfn = end_pfn; |
264 | return 0; | 282 | return ISOLATE_NONE; |
265 | } | 283 | } |
266 | 284 | ||
267 | /* | 285 | /* |
@@ -270,10 +288,14 @@ static unsigned long isolate_migratepages(struct zone *zone, | |||
270 | * delay for some time until fewer pages are isolated | 288 | * delay for some time until fewer pages are isolated |
271 | */ | 289 | */ |
272 | while (unlikely(too_many_isolated(zone))) { | 290 | while (unlikely(too_many_isolated(zone))) { |
291 | /* async migration should just abort */ | ||
292 | if (!cc->sync) | ||
293 | return ISOLATE_ABORT; | ||
294 | |||
273 | congestion_wait(BLK_RW_ASYNC, HZ/10); | 295 | congestion_wait(BLK_RW_ASYNC, HZ/10); |
274 | 296 | ||
275 | if (fatal_signal_pending(current)) | 297 | if (fatal_signal_pending(current)) |
276 | return 0; | 298 | return ISOLATE_ABORT; |
277 | } | 299 | } |
278 | 300 | ||
279 | /* Time to isolate some pages for migration */ | 301 | /* Time to isolate some pages for migration */ |
@@ -358,7 +380,7 @@ static unsigned long isolate_migratepages(struct zone *zone, | |||
358 | 380 | ||
359 | trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated); | 381 | trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated); |
360 | 382 | ||
361 | return cc->nr_migratepages; | 383 | return ISOLATE_SUCCESS; |
362 | } | 384 | } |
363 | 385 | ||
364 | /* | 386 | /* |
@@ -420,13 +442,6 @@ static int compact_finished(struct zone *zone, | |||
420 | if (cc->free_pfn <= cc->migrate_pfn) | 442 | if (cc->free_pfn <= cc->migrate_pfn) |
421 | return COMPACT_COMPLETE; | 443 | return COMPACT_COMPLETE; |
422 | 444 | ||
423 | /* Compaction run is not finished if the watermark is not met */ | ||
424 | watermark = low_wmark_pages(zone); | ||
425 | watermark += (1 << cc->order); | ||
426 | |||
427 | if (!zone_watermark_ok(zone, cc->order, watermark, 0, 0)) | ||
428 | return COMPACT_CONTINUE; | ||
429 | |||
430 | /* | 445 | /* |
431 | * order == -1 is expected when compacting via | 446 | * order == -1 is expected when compacting via |
432 | * /proc/sys/vm/compact_memory | 447 | * /proc/sys/vm/compact_memory |
@@ -434,6 +449,13 @@ static int compact_finished(struct zone *zone, | |||
434 | if (cc->order == -1) | 449 | if (cc->order == -1) |
435 | return COMPACT_CONTINUE; | 450 | return COMPACT_CONTINUE; |
436 | 451 | ||
452 | /* Compaction run is not finished if the watermark is not met */ | ||
453 | watermark = low_wmark_pages(zone); | ||
454 | watermark += (1 << cc->order); | ||
455 | |||
456 | if (!zone_watermark_ok(zone, cc->order, watermark, 0, 0)) | ||
457 | return COMPACT_CONTINUE; | ||
458 | |||
437 | /* Direct compactor: Is a suitable page free? */ | 459 | /* Direct compactor: Is a suitable page free? */ |
438 | for (order = cc->order; order < MAX_ORDER; order++) { | 460 | for (order = cc->order; order < MAX_ORDER; order++) { |
439 | /* Job done if page is free of the right migratetype */ | 461 | /* Job done if page is free of the right migratetype */ |
@@ -461,6 +483,13 @@ unsigned long compaction_suitable(struct zone *zone, int order) | |||
461 | unsigned long watermark; | 483 | unsigned long watermark; |
462 | 484 | ||
463 | /* | 485 | /* |
486 | * order == -1 is expected when compacting via | ||
487 | * /proc/sys/vm/compact_memory | ||
488 | */ | ||
489 | if (order == -1) | ||
490 | return COMPACT_CONTINUE; | ||
491 | |||
492 | /* | ||
464 | * Watermarks for order-0 must be met for compaction. Note the 2UL. | 493 | * Watermarks for order-0 must be met for compaction. Note the 2UL. |
465 | * This is because during migration, copies of pages need to be | 494 | * This is because during migration, copies of pages need to be |
466 | * allocated and for a short time, the footprint is higher | 495 | * allocated and for a short time, the footprint is higher |
@@ -470,17 +499,11 @@ unsigned long compaction_suitable(struct zone *zone, int order) | |||
470 | return COMPACT_SKIPPED; | 499 | return COMPACT_SKIPPED; |
471 | 500 | ||
472 | /* | 501 | /* |
473 | * order == -1 is expected when compacting via | ||
474 | * /proc/sys/vm/compact_memory | ||
475 | */ | ||
476 | if (order == -1) | ||
477 | return COMPACT_CONTINUE; | ||
478 | |||
479 | /* | ||
480 | * fragmentation index determines if allocation failures are due to | 502 | * fragmentation index determines if allocation failures are due to |
481 | * low memory or external fragmentation | 503 | * low memory or external fragmentation |
482 | * | 504 | * |
483 | * index of -1 implies allocations might succeed dependingon watermarks | 505 | * index of -1000 implies allocations might succeed depending on |
506 | * watermarks | ||
484 | * index towards 0 implies failure is due to lack of memory | 507 | * index towards 0 implies failure is due to lack of memory |
485 | * index towards 1000 implies failure is due to fragmentation | 508 | * index towards 1000 implies failure is due to fragmentation |
486 | * | 509 | * |
@@ -490,7 +513,8 @@ unsigned long compaction_suitable(struct zone *zone, int order) | |||
490 | if (fragindex >= 0 && fragindex <= sysctl_extfrag_threshold) | 513 | if (fragindex >= 0 && fragindex <= sysctl_extfrag_threshold) |
491 | return COMPACT_SKIPPED; | 514 | return COMPACT_SKIPPED; |
492 | 515 | ||
493 | if (fragindex == -1 && zone_watermark_ok(zone, order, watermark, 0, 0)) | 516 | if (fragindex == -1000 && zone_watermark_ok(zone, order, watermark, |
517 | 0, 0)) | ||
494 | return COMPACT_PARTIAL; | 518 | return COMPACT_PARTIAL; |
495 | 519 | ||
496 | return COMPACT_CONTINUE; | 520 | return COMPACT_CONTINUE; |
@@ -522,8 +546,15 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) | |||
522 | unsigned long nr_migrate, nr_remaining; | 546 | unsigned long nr_migrate, nr_remaining; |
523 | int err; | 547 | int err; |
524 | 548 | ||
525 | if (!isolate_migratepages(zone, cc)) | 549 | switch (isolate_migratepages(zone, cc)) { |
550 | case ISOLATE_ABORT: | ||
551 | ret = COMPACT_PARTIAL; | ||
552 | goto out; | ||
553 | case ISOLATE_NONE: | ||
526 | continue; | 554 | continue; |
555 | case ISOLATE_SUCCESS: | ||
556 | ; | ||
557 | } | ||
527 | 558 | ||
528 | nr_migrate = cc->nr_migratepages; | 559 | nr_migrate = cc->nr_migratepages; |
529 | err = migrate_pages(&cc->migratepages, compaction_alloc, | 560 | err = migrate_pages(&cc->migratepages, compaction_alloc, |
@@ -547,6 +578,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) | |||
547 | 578 | ||
548 | } | 579 | } |
549 | 580 | ||
581 | out: | ||
550 | /* Release free pages and check accounting */ | 582 | /* Release free pages and check accounting */ |
551 | cc->nr_freepages -= release_freepages(&cc->freepages); | 583 | cc->nr_freepages -= release_freepages(&cc->freepages); |
552 | VM_BUG_ON(cc->nr_freepages != 0); | 584 | VM_BUG_ON(cc->nr_freepages != 0); |
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 615d9743a3cb..81532f297fd2 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -2234,11 +2234,8 @@ static void khugepaged_loop(void) | |||
2234 | while (likely(khugepaged_enabled())) { | 2234 | while (likely(khugepaged_enabled())) { |
2235 | #ifndef CONFIG_NUMA | 2235 | #ifndef CONFIG_NUMA |
2236 | hpage = khugepaged_alloc_hugepage(); | 2236 | hpage = khugepaged_alloc_hugepage(); |
2237 | if (unlikely(!hpage)) { | 2237 | if (unlikely(!hpage)) |
2238 | count_vm_event(THP_COLLAPSE_ALLOC_FAILED); | ||
2239 | break; | 2238 | break; |
2240 | } | ||
2241 | count_vm_event(THP_COLLAPSE_ALLOC); | ||
2242 | #else | 2239 | #else |
2243 | if (IS_ERR(hpage)) { | 2240 | if (IS_ERR(hpage)) { |
2244 | khugepaged_alloc_sleep(); | 2241 | khugepaged_alloc_sleep(); |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6402458fee38..bfcf153bc829 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -1111,6 +1111,14 @@ static void __init gather_bootmem_prealloc(void) | |||
1111 | WARN_ON(page_count(page) != 1); | 1111 | WARN_ON(page_count(page) != 1); |
1112 | prep_compound_huge_page(page, h->order); | 1112 | prep_compound_huge_page(page, h->order); |
1113 | prep_new_huge_page(h, page, page_to_nid(page)); | 1113 | prep_new_huge_page(h, page, page_to_nid(page)); |
1114 | /* | ||
1115 | * If we had gigantic hugepages allocated at boot time, we need | ||
1116 | * to restore the 'stolen' pages to totalram_pages in order to | ||
1117 | * fix confusing memory reports from free(1) and another | ||
1118 | * side-effects, like CommitLimit going negative. | ||
1119 | */ | ||
1120 | if (h->order > (MAX_ORDER - 1)) | ||
1121 | totalram_pages += 1 << h->order; | ||
1114 | } | 1122 | } |
1115 | } | 1123 | } |
1116 | 1124 | ||
@@ -1302,6 +1302,12 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page) | |||
1302 | slot = list_entry(slot->mm_list.next, struct mm_slot, mm_list); | 1302 | slot = list_entry(slot->mm_list.next, struct mm_slot, mm_list); |
1303 | ksm_scan.mm_slot = slot; | 1303 | ksm_scan.mm_slot = slot; |
1304 | spin_unlock(&ksm_mmlist_lock); | 1304 | spin_unlock(&ksm_mmlist_lock); |
1305 | /* | ||
1306 | * Although we tested list_empty() above, a racing __ksm_exit | ||
1307 | * of the last mm on the list may have removed it since then. | ||
1308 | */ | ||
1309 | if (slot == &ksm_mm_head) | ||
1310 | return NULL; | ||
1305 | next_mm: | 1311 | next_mm: |
1306 | ksm_scan.address = 0; | 1312 | ksm_scan.address = 0; |
1307 | ksm_scan.rmap_list = &slot->rmap_list; | 1313 | ksm_scan.rmap_list = &slot->rmap_list; |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index bd9052a5d3ad..cf7d027a8844 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -359,7 +359,7 @@ enum charge_type { | |||
359 | static void mem_cgroup_get(struct mem_cgroup *mem); | 359 | static void mem_cgroup_get(struct mem_cgroup *mem); |
360 | static void mem_cgroup_put(struct mem_cgroup *mem); | 360 | static void mem_cgroup_put(struct mem_cgroup *mem); |
361 | static struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *mem); | 361 | static struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *mem); |
362 | static void drain_all_stock_async(void); | 362 | static void drain_all_stock_async(struct mem_cgroup *mem); |
363 | 363 | ||
364 | static struct mem_cgroup_per_zone * | 364 | static struct mem_cgroup_per_zone * |
365 | mem_cgroup_zoneinfo(struct mem_cgroup *mem, int nid, int zid) | 365 | mem_cgroup_zoneinfo(struct mem_cgroup *mem, int nid, int zid) |
@@ -735,7 +735,7 @@ struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p) | |||
735 | struct mem_cgroup, css); | 735 | struct mem_cgroup, css); |
736 | } | 736 | } |
737 | 737 | ||
738 | static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm) | 738 | struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm) |
739 | { | 739 | { |
740 | struct mem_cgroup *mem = NULL; | 740 | struct mem_cgroup *mem = NULL; |
741 | 741 | ||
@@ -1663,15 +1663,21 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem, | |||
1663 | excess = res_counter_soft_limit_excess(&root_mem->res) >> PAGE_SHIFT; | 1663 | excess = res_counter_soft_limit_excess(&root_mem->res) >> PAGE_SHIFT; |
1664 | 1664 | ||
1665 | /* If memsw_is_minimum==1, swap-out is of-no-use. */ | 1665 | /* If memsw_is_minimum==1, swap-out is of-no-use. */ |
1666 | if (root_mem->memsw_is_minimum) | 1666 | if (!check_soft && root_mem->memsw_is_minimum) |
1667 | noswap = true; | 1667 | noswap = true; |
1668 | 1668 | ||
1669 | while (1) { | 1669 | while (1) { |
1670 | victim = mem_cgroup_select_victim(root_mem); | 1670 | victim = mem_cgroup_select_victim(root_mem); |
1671 | if (victim == root_mem) { | 1671 | if (victim == root_mem) { |
1672 | loop++; | 1672 | loop++; |
1673 | if (loop >= 1) | 1673 | /* |
1674 | drain_all_stock_async(); | 1674 | * We are not draining per cpu cached charges during |
1675 | * soft limit reclaim because global reclaim doesn't | ||
1676 | * care about charges. It tries to free some memory and | ||
1677 | * charges will not give any. | ||
1678 | */ | ||
1679 | if (!check_soft && loop >= 1) | ||
1680 | drain_all_stock_async(root_mem); | ||
1675 | if (loop >= 2) { | 1681 | if (loop >= 2) { |
1676 | /* | 1682 | /* |
1677 | * If we have not been able to reclaim | 1683 | * If we have not been able to reclaim |
@@ -1934,9 +1940,11 @@ struct memcg_stock_pcp { | |||
1934 | struct mem_cgroup *cached; /* this never be root cgroup */ | 1940 | struct mem_cgroup *cached; /* this never be root cgroup */ |
1935 | unsigned int nr_pages; | 1941 | unsigned int nr_pages; |
1936 | struct work_struct work; | 1942 | struct work_struct work; |
1943 | unsigned long flags; | ||
1944 | #define FLUSHING_CACHED_CHARGE (0) | ||
1937 | }; | 1945 | }; |
1938 | static DEFINE_PER_CPU(struct memcg_stock_pcp, memcg_stock); | 1946 | static DEFINE_PER_CPU(struct memcg_stock_pcp, memcg_stock); |
1939 | static atomic_t memcg_drain_count; | 1947 | static DEFINE_MUTEX(percpu_charge_mutex); |
1940 | 1948 | ||
1941 | /* | 1949 | /* |
1942 | * Try to consume stocked charge on this cpu. If success, one page is consumed | 1950 | * Try to consume stocked charge on this cpu. If success, one page is consumed |
@@ -1984,6 +1992,7 @@ static void drain_local_stock(struct work_struct *dummy) | |||
1984 | { | 1992 | { |
1985 | struct memcg_stock_pcp *stock = &__get_cpu_var(memcg_stock); | 1993 | struct memcg_stock_pcp *stock = &__get_cpu_var(memcg_stock); |
1986 | drain_stock(stock); | 1994 | drain_stock(stock); |
1995 | clear_bit(FLUSHING_CACHED_CHARGE, &stock->flags); | ||
1987 | } | 1996 | } |
1988 | 1997 | ||
1989 | /* | 1998 | /* |
@@ -2008,26 +2017,45 @@ static void refill_stock(struct mem_cgroup *mem, unsigned int nr_pages) | |||
2008 | * expects some charges will be back to res_counter later but cannot wait for | 2017 | * expects some charges will be back to res_counter later but cannot wait for |
2009 | * it. | 2018 | * it. |
2010 | */ | 2019 | */ |
2011 | static void drain_all_stock_async(void) | 2020 | static void drain_all_stock_async(struct mem_cgroup *root_mem) |
2012 | { | 2021 | { |
2013 | int cpu; | 2022 | int cpu, curcpu; |
2014 | /* This function is for scheduling "drain" in asynchronous way. | 2023 | /* |
2015 | * The result of "drain" is not directly handled by callers. Then, | 2024 | * If someone calls draining, avoid adding more kworker runs. |
2016 | * if someone is calling drain, we don't have to call drain more. | ||
2017 | * Anyway, WORK_STRUCT_PENDING check in queue_work_on() will catch if | ||
2018 | * there is a race. We just do loose check here. | ||
2019 | */ | 2025 | */ |
2020 | if (atomic_read(&memcg_drain_count)) | 2026 | if (!mutex_trylock(&percpu_charge_mutex)) |
2021 | return; | 2027 | return; |
2022 | /* Notify other cpus that system-wide "drain" is running */ | 2028 | /* Notify other cpus that system-wide "drain" is running */ |
2023 | atomic_inc(&memcg_drain_count); | ||
2024 | get_online_cpus(); | 2029 | get_online_cpus(); |
2030 | /* | ||
2031 | * Get a hint for avoiding draining charges on the current cpu, | ||
2032 | * which must be exhausted by our charging. It is not required that | ||
2033 | * this be a precise check, so we use raw_smp_processor_id() instead of | ||
2034 | * getcpu()/putcpu(). | ||
2035 | */ | ||
2036 | curcpu = raw_smp_processor_id(); | ||
2025 | for_each_online_cpu(cpu) { | 2037 | for_each_online_cpu(cpu) { |
2026 | struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); | 2038 | struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); |
2027 | schedule_work_on(cpu, &stock->work); | 2039 | struct mem_cgroup *mem; |
2040 | |||
2041 | if (cpu == curcpu) | ||
2042 | continue; | ||
2043 | |||
2044 | mem = stock->cached; | ||
2045 | if (!mem) | ||
2046 | continue; | ||
2047 | if (mem != root_mem) { | ||
2048 | if (!root_mem->use_hierarchy) | ||
2049 | continue; | ||
2050 | /* check whether "mem" is under tree of "root_mem" */ | ||
2051 | if (!css_is_ancestor(&mem->css, &root_mem->css)) | ||
2052 | continue; | ||
2053 | } | ||
2054 | if (!test_and_set_bit(FLUSHING_CACHED_CHARGE, &stock->flags)) | ||
2055 | schedule_work_on(cpu, &stock->work); | ||
2028 | } | 2056 | } |
2029 | put_online_cpus(); | 2057 | put_online_cpus(); |
2030 | atomic_dec(&memcg_drain_count); | 2058 | mutex_unlock(&percpu_charge_mutex); |
2031 | /* We don't wait for flush_work */ | 2059 | /* We don't wait for flush_work */ |
2032 | } | 2060 | } |
2033 | 2061 | ||
@@ -2035,9 +2063,9 @@ static void drain_all_stock_async(void) | |||
2035 | static void drain_all_stock_sync(void) | 2063 | static void drain_all_stock_sync(void) |
2036 | { | 2064 | { |
2037 | /* called when force_empty is called */ | 2065 | /* called when force_empty is called */ |
2038 | atomic_inc(&memcg_drain_count); | 2066 | mutex_lock(&percpu_charge_mutex); |
2039 | schedule_on_each_cpu(drain_local_stock); | 2067 | schedule_on_each_cpu(drain_local_stock); |
2040 | atomic_dec(&memcg_drain_count); | 2068 | mutex_unlock(&percpu_charge_mutex); |
2041 | } | 2069 | } |
2042 | 2070 | ||
2043 | /* | 2071 | /* |
@@ -4640,6 +4668,7 @@ static struct cftype mem_cgroup_files[] = { | |||
4640 | { | 4668 | { |
4641 | .name = "numa_stat", | 4669 | .name = "numa_stat", |
4642 | .open = mem_control_numa_stat_open, | 4670 | .open = mem_control_numa_stat_open, |
4671 | .mode = S_IRUGO, | ||
4643 | }, | 4672 | }, |
4644 | #endif | 4673 | #endif |
4645 | }; | 4674 | }; |
@@ -5414,18 +5443,16 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss, | |||
5414 | struct cgroup *old_cont, | 5443 | struct cgroup *old_cont, |
5415 | struct task_struct *p) | 5444 | struct task_struct *p) |
5416 | { | 5445 | { |
5417 | struct mm_struct *mm; | 5446 | struct mm_struct *mm = get_task_mm(p); |
5418 | 5447 | ||
5419 | if (!mc.to) | ||
5420 | /* no need to move charge */ | ||
5421 | return; | ||
5422 | |||
5423 | mm = get_task_mm(p); | ||
5424 | if (mm) { | 5448 | if (mm) { |
5425 | mem_cgroup_move_charge(mm); | 5449 | if (mc.to) |
5450 | mem_cgroup_move_charge(mm); | ||
5451 | put_swap_token(mm); | ||
5426 | mmput(mm); | 5452 | mmput(mm); |
5427 | } | 5453 | } |
5428 | mem_cgroup_clear_mc(); | 5454 | if (mc.to) |
5455 | mem_cgroup_clear_mc(); | ||
5429 | } | 5456 | } |
5430 | #else /* !CONFIG_MMU */ | 5457 | #else /* !CONFIG_MMU */ |
5431 | static int mem_cgroup_can_attach(struct cgroup_subsys *ss, | 5458 | static int mem_cgroup_can_attach(struct cgroup_subsys *ss, |
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 5c8f7e08928d..eac0ba561491 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <linux/swapops.h> | 52 | #include <linux/swapops.h> |
53 | #include <linux/hugetlb.h> | 53 | #include <linux/hugetlb.h> |
54 | #include <linux/memory_hotplug.h> | 54 | #include <linux/memory_hotplug.h> |
55 | #include <linux/mm_inline.h> | ||
55 | #include "internal.h" | 56 | #include "internal.h" |
56 | 57 | ||
57 | int sysctl_memory_failure_early_kill __read_mostly = 0; | 58 | int sysctl_memory_failure_early_kill __read_mostly = 0; |
@@ -1468,7 +1469,8 @@ int soft_offline_page(struct page *page, int flags) | |||
1468 | put_page(page); | 1469 | put_page(page); |
1469 | if (!ret) { | 1470 | if (!ret) { |
1470 | LIST_HEAD(pagelist); | 1471 | LIST_HEAD(pagelist); |
1471 | 1472 | inc_zone_page_state(page, NR_ISOLATED_ANON + | |
1473 | page_is_file_cache(page)); | ||
1472 | list_add(&page->lru, &pagelist); | 1474 | list_add(&page->lru, &pagelist); |
1473 | ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, | 1475 | ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, |
1474 | 0, true); | 1476 | 0, true); |
diff --git a/mm/memory.c b/mm/memory.c index 6953d3926e01..87d935333f0d 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1112,11 +1112,13 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, | |||
1112 | int force_flush = 0; | 1112 | int force_flush = 0; |
1113 | int rss[NR_MM_COUNTERS]; | 1113 | int rss[NR_MM_COUNTERS]; |
1114 | spinlock_t *ptl; | 1114 | spinlock_t *ptl; |
1115 | pte_t *start_pte; | ||
1115 | pte_t *pte; | 1116 | pte_t *pte; |
1116 | 1117 | ||
1117 | again: | 1118 | again: |
1118 | init_rss_vec(rss); | 1119 | init_rss_vec(rss); |
1119 | pte = pte_offset_map_lock(mm, pmd, addr, &ptl); | 1120 | start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl); |
1121 | pte = start_pte; | ||
1120 | arch_enter_lazy_mmu_mode(); | 1122 | arch_enter_lazy_mmu_mode(); |
1121 | do { | 1123 | do { |
1122 | pte_t ptent = *pte; | 1124 | pte_t ptent = *pte; |
@@ -1196,7 +1198,7 @@ again: | |||
1196 | 1198 | ||
1197 | add_mm_rss_vec(mm, rss); | 1199 | add_mm_rss_vec(mm, rss); |
1198 | arch_leave_lazy_mmu_mode(); | 1200 | arch_leave_lazy_mmu_mode(); |
1199 | pte_unmap_unlock(pte - 1, ptl); | 1201 | pte_unmap_unlock(start_pte, ptl); |
1200 | 1202 | ||
1201 | /* | 1203 | /* |
1202 | * mmu_gather ran out of room to batch pages, we break out of | 1204 | * mmu_gather ran out of room to batch pages, we break out of |
@@ -1296,7 +1298,7 @@ static unsigned long unmap_page_range(struct mmu_gather *tlb, | |||
1296 | 1298 | ||
1297 | /** | 1299 | /** |
1298 | * unmap_vmas - unmap a range of memory covered by a list of vma's | 1300 | * unmap_vmas - unmap a range of memory covered by a list of vma's |
1299 | * @tlbp: address of the caller's struct mmu_gather | 1301 | * @tlb: address of the caller's struct mmu_gather |
1300 | * @vma: the starting vma | 1302 | * @vma: the starting vma |
1301 | * @start_addr: virtual address at which to start unmapping | 1303 | * @start_addr: virtual address at which to start unmapping |
1302 | * @end_addr: virtual address at which to end unmapping | 1304 | * @end_addr: virtual address at which to end unmapping |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 9f646374e32f..02159c755136 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -494,6 +494,12 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start) | |||
494 | /* init node's zones as empty zones, we don't have any present pages.*/ | 494 | /* init node's zones as empty zones, we don't have any present pages.*/ |
495 | free_area_init_node(nid, zones_size, start_pfn, zholes_size); | 495 | free_area_init_node(nid, zones_size, start_pfn, zholes_size); |
496 | 496 | ||
497 | /* | ||
498 | * The node we allocated has no zone fallback lists. For avoiding | ||
499 | * to access not-initialized zonelist, build here. | ||
500 | */ | ||
501 | build_all_zonelists(NULL); | ||
502 | |||
497 | return pgdat; | 503 | return pgdat; |
498 | } | 504 | } |
499 | 505 | ||
@@ -906,14 +906,7 @@ struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *vma) | |||
906 | if (anon_vma) | 906 | if (anon_vma) |
907 | return anon_vma; | 907 | return anon_vma; |
908 | try_prev: | 908 | try_prev: |
909 | /* | 909 | near = vma->vm_prev; |
910 | * It is potentially slow to have to call find_vma_prev here. | ||
911 | * But it's only on the first write fault on the vma, not | ||
912 | * every time, and we could devise a way to avoid it later | ||
913 | * (e.g. stash info in next's anon_vma_node when assigning | ||
914 | * an anon_vma, or when trying vma_merge). Another time. | ||
915 | */ | ||
916 | BUG_ON(find_vma_prev(vma->vm_mm, vma->vm_start, &near) != vma); | ||
917 | if (!near) | 910 | if (!near) |
918 | goto none; | 911 | goto none; |
919 | 912 | ||
@@ -2044,9 +2037,10 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) | |||
2044 | return -EINVAL; | 2037 | return -EINVAL; |
2045 | 2038 | ||
2046 | /* Find the first overlapping VMA */ | 2039 | /* Find the first overlapping VMA */ |
2047 | vma = find_vma_prev(mm, start, &prev); | 2040 | vma = find_vma(mm, start); |
2048 | if (!vma) | 2041 | if (!vma) |
2049 | return 0; | 2042 | return 0; |
2043 | prev = vma->vm_prev; | ||
2050 | /* we have start < vma->vm_end */ | 2044 | /* we have start < vma->vm_end */ |
2051 | 2045 | ||
2052 | /* if it doesn't overlap, we have nothing.. */ | 2046 | /* if it doesn't overlap, we have nothing.. */ |
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 74ccff61d1be..53bffc6c293e 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c | |||
@@ -162,13 +162,13 @@ static void free_page_cgroup(void *addr) | |||
162 | } | 162 | } |
163 | #endif | 163 | #endif |
164 | 164 | ||
165 | static int __meminit init_section_page_cgroup(unsigned long pfn) | 165 | static int __meminit init_section_page_cgroup(unsigned long pfn, int nid) |
166 | { | 166 | { |
167 | struct page_cgroup *base, *pc; | 167 | struct page_cgroup *base, *pc; |
168 | struct mem_section *section; | 168 | struct mem_section *section; |
169 | unsigned long table_size; | 169 | unsigned long table_size; |
170 | unsigned long nr; | 170 | unsigned long nr; |
171 | int nid, index; | 171 | int index; |
172 | 172 | ||
173 | nr = pfn_to_section_nr(pfn); | 173 | nr = pfn_to_section_nr(pfn); |
174 | section = __nr_to_section(nr); | 174 | section = __nr_to_section(nr); |
@@ -176,7 +176,6 @@ static int __meminit init_section_page_cgroup(unsigned long pfn) | |||
176 | if (section->page_cgroup) | 176 | if (section->page_cgroup) |
177 | return 0; | 177 | return 0; |
178 | 178 | ||
179 | nid = page_to_nid(pfn_to_page(pfn)); | ||
180 | table_size = sizeof(struct page_cgroup) * PAGES_PER_SECTION; | 179 | table_size = sizeof(struct page_cgroup) * PAGES_PER_SECTION; |
181 | base = alloc_page_cgroup(table_size, nid); | 180 | base = alloc_page_cgroup(table_size, nid); |
182 | 181 | ||
@@ -196,7 +195,11 @@ static int __meminit init_section_page_cgroup(unsigned long pfn) | |||
196 | pc = base + index; | 195 | pc = base + index; |
197 | init_page_cgroup(pc, nr); | 196 | init_page_cgroup(pc, nr); |
198 | } | 197 | } |
199 | 198 | /* | |
199 | * The passed "pfn" may not be aligned to SECTION. For the calculation | ||
200 | * we need to apply a mask. | ||
201 | */ | ||
202 | pfn &= PAGE_SECTION_MASK; | ||
200 | section->page_cgroup = base - pfn; | 203 | section->page_cgroup = base - pfn; |
201 | total_usage += table_size; | 204 | total_usage += table_size; |
202 | return 0; | 205 | return 0; |
@@ -225,10 +228,20 @@ int __meminit online_page_cgroup(unsigned long start_pfn, | |||
225 | start = start_pfn & ~(PAGES_PER_SECTION - 1); | 228 | start = start_pfn & ~(PAGES_PER_SECTION - 1); |
226 | end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION); | 229 | end = ALIGN(start_pfn + nr_pages, PAGES_PER_SECTION); |
227 | 230 | ||
231 | if (nid == -1) { | ||
232 | /* | ||
233 | * In this case, "nid" already exists and contains valid memory. | ||
234 | * "start_pfn" passed to us is a pfn which is an arg for | ||
235 | * online__pages(), and start_pfn should exist. | ||
236 | */ | ||
237 | nid = pfn_to_nid(start_pfn); | ||
238 | VM_BUG_ON(!node_state(nid, N_ONLINE)); | ||
239 | } | ||
240 | |||
228 | for (pfn = start; !fail && pfn < end; pfn += PAGES_PER_SECTION) { | 241 | for (pfn = start; !fail && pfn < end; pfn += PAGES_PER_SECTION) { |
229 | if (!pfn_present(pfn)) | 242 | if (!pfn_present(pfn)) |
230 | continue; | 243 | continue; |
231 | fail = init_section_page_cgroup(pfn); | 244 | fail = init_section_page_cgroup(pfn, nid); |
232 | } | 245 | } |
233 | if (!fail) | 246 | if (!fail) |
234 | return 0; | 247 | return 0; |
@@ -284,25 +297,47 @@ static int __meminit page_cgroup_callback(struct notifier_block *self, | |||
284 | void __init page_cgroup_init(void) | 297 | void __init page_cgroup_init(void) |
285 | { | 298 | { |
286 | unsigned long pfn; | 299 | unsigned long pfn; |
287 | int fail = 0; | 300 | int nid; |
288 | 301 | ||
289 | if (mem_cgroup_disabled()) | 302 | if (mem_cgroup_disabled()) |
290 | return; | 303 | return; |
291 | 304 | ||
292 | for (pfn = 0; !fail && pfn < max_pfn; pfn += PAGES_PER_SECTION) { | 305 | for_each_node_state(nid, N_HIGH_MEMORY) { |
293 | if (!pfn_present(pfn)) | 306 | unsigned long start_pfn, end_pfn; |
294 | continue; | 307 | |
295 | fail = init_section_page_cgroup(pfn); | 308 | start_pfn = node_start_pfn(nid); |
296 | } | 309 | end_pfn = node_end_pfn(nid); |
297 | if (fail) { | 310 | /* |
298 | printk(KERN_CRIT "try 'cgroup_disable=memory' boot option\n"); | 311 | * start_pfn and end_pfn may not be aligned to SECTION and the |
299 | panic("Out of memory"); | 312 | * page->flags of out of node pages are not initialized. So we |
300 | } else { | 313 | * scan [start_pfn, the biggest section's pfn < end_pfn) here. |
301 | hotplug_memory_notifier(page_cgroup_callback, 0); | 314 | */ |
315 | for (pfn = start_pfn; | ||
316 | pfn < end_pfn; | ||
317 | pfn = ALIGN(pfn + 1, PAGES_PER_SECTION)) { | ||
318 | |||
319 | if (!pfn_valid(pfn)) | ||
320 | continue; | ||
321 | /* | ||
322 | * Nodes's pfns can be overlapping. | ||
323 | * We know some arch can have a nodes layout such as | ||
324 | * -------------pfn--------------> | ||
325 | * N0 | N1 | N2 | N0 | N1 | N2|.... | ||
326 | */ | ||
327 | if (pfn_to_nid(pfn) != nid) | ||
328 | continue; | ||
329 | if (init_section_page_cgroup(pfn, nid)) | ||
330 | goto oom; | ||
331 | } | ||
302 | } | 332 | } |
333 | hotplug_memory_notifier(page_cgroup_callback, 0); | ||
303 | printk(KERN_INFO "allocated %ld bytes of page_cgroup\n", total_usage); | 334 | printk(KERN_INFO "allocated %ld bytes of page_cgroup\n", total_usage); |
304 | printk(KERN_INFO "please try 'cgroup_disable=memory' option if you don't" | 335 | printk(KERN_INFO "please try 'cgroup_disable=memory' option if you " |
305 | " want memory cgroups\n"); | 336 | "don't want memory cgroups\n"); |
337 | return; | ||
338 | oom: | ||
339 | printk(KERN_CRIT "try 'cgroup_disable=memory' boot option\n"); | ||
340 | panic("Out of memory"); | ||
306 | } | 341 | } |
307 | 342 | ||
308 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat) | 343 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat) |
diff --git a/mm/thrash.c b/mm/thrash.c index 2372d4ed5dd8..fabf2d0f5169 100644 --- a/mm/thrash.c +++ b/mm/thrash.c | |||
@@ -21,14 +21,40 @@ | |||
21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
23 | #include <linux/swap.h> | 23 | #include <linux/swap.h> |
24 | #include <linux/memcontrol.h> | ||
25 | |||
26 | #include <trace/events/vmscan.h> | ||
27 | |||
28 | #define TOKEN_AGING_INTERVAL (0xFF) | ||
24 | 29 | ||
25 | static DEFINE_SPINLOCK(swap_token_lock); | 30 | static DEFINE_SPINLOCK(swap_token_lock); |
26 | struct mm_struct *swap_token_mm; | 31 | struct mm_struct *swap_token_mm; |
32 | struct mem_cgroup *swap_token_memcg; | ||
27 | static unsigned int global_faults; | 33 | static unsigned int global_faults; |
34 | static unsigned int last_aging; | ||
35 | |||
36 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
37 | static struct mem_cgroup *swap_token_memcg_from_mm(struct mm_struct *mm) | ||
38 | { | ||
39 | struct mem_cgroup *memcg; | ||
40 | |||
41 | memcg = try_get_mem_cgroup_from_mm(mm); | ||
42 | if (memcg) | ||
43 | css_put(mem_cgroup_css(memcg)); | ||
44 | |||
45 | return memcg; | ||
46 | } | ||
47 | #else | ||
48 | static struct mem_cgroup *swap_token_memcg_from_mm(struct mm_struct *mm) | ||
49 | { | ||
50 | return NULL; | ||
51 | } | ||
52 | #endif | ||
28 | 53 | ||
29 | void grab_swap_token(struct mm_struct *mm) | 54 | void grab_swap_token(struct mm_struct *mm) |
30 | { | 55 | { |
31 | int current_interval; | 56 | int current_interval; |
57 | unsigned int old_prio = mm->token_priority; | ||
32 | 58 | ||
33 | global_faults++; | 59 | global_faults++; |
34 | 60 | ||
@@ -38,40 +64,81 @@ void grab_swap_token(struct mm_struct *mm) | |||
38 | return; | 64 | return; |
39 | 65 | ||
40 | /* First come first served */ | 66 | /* First come first served */ |
41 | if (swap_token_mm == NULL) { | 67 | if (!swap_token_mm) |
42 | mm->token_priority = mm->token_priority + 2; | 68 | goto replace_token; |
43 | swap_token_mm = mm; | 69 | |
44 | goto out; | 70 | if ((global_faults - last_aging) > TOKEN_AGING_INTERVAL) { |
71 | swap_token_mm->token_priority /= 2; | ||
72 | last_aging = global_faults; | ||
45 | } | 73 | } |
46 | 74 | ||
47 | if (mm != swap_token_mm) { | 75 | if (mm == swap_token_mm) { |
48 | if (current_interval < mm->last_interval) | ||
49 | mm->token_priority++; | ||
50 | else { | ||
51 | if (likely(mm->token_priority > 0)) | ||
52 | mm->token_priority--; | ||
53 | } | ||
54 | /* Check if we deserve the token */ | ||
55 | if (mm->token_priority > swap_token_mm->token_priority) { | ||
56 | mm->token_priority += 2; | ||
57 | swap_token_mm = mm; | ||
58 | } | ||
59 | } else { | ||
60 | /* Token holder came in again! */ | ||
61 | mm->token_priority += 2; | 76 | mm->token_priority += 2; |
77 | goto update_priority; | ||
78 | } | ||
79 | |||
80 | if (current_interval < mm->last_interval) | ||
81 | mm->token_priority++; | ||
82 | else { | ||
83 | if (likely(mm->token_priority > 0)) | ||
84 | mm->token_priority--; | ||
62 | } | 85 | } |
63 | 86 | ||
87 | /* Check if we deserve the token */ | ||
88 | if (mm->token_priority > swap_token_mm->token_priority) | ||
89 | goto replace_token; | ||
90 | |||
91 | update_priority: | ||
92 | trace_update_swap_token_priority(mm, old_prio, swap_token_mm); | ||
93 | |||
64 | out: | 94 | out: |
65 | mm->faultstamp = global_faults; | 95 | mm->faultstamp = global_faults; |
66 | mm->last_interval = current_interval; | 96 | mm->last_interval = current_interval; |
67 | spin_unlock(&swap_token_lock); | 97 | spin_unlock(&swap_token_lock); |
98 | return; | ||
99 | |||
100 | replace_token: | ||
101 | mm->token_priority += 2; | ||
102 | trace_replace_swap_token(swap_token_mm, mm); | ||
103 | swap_token_mm = mm; | ||
104 | swap_token_memcg = swap_token_memcg_from_mm(mm); | ||
105 | last_aging = global_faults; | ||
106 | goto out; | ||
68 | } | 107 | } |
69 | 108 | ||
70 | /* Called on process exit. */ | 109 | /* Called on process exit. */ |
71 | void __put_swap_token(struct mm_struct *mm) | 110 | void __put_swap_token(struct mm_struct *mm) |
72 | { | 111 | { |
73 | spin_lock(&swap_token_lock); | 112 | spin_lock(&swap_token_lock); |
74 | if (likely(mm == swap_token_mm)) | 113 | if (likely(mm == swap_token_mm)) { |
114 | trace_put_swap_token(swap_token_mm); | ||
75 | swap_token_mm = NULL; | 115 | swap_token_mm = NULL; |
116 | swap_token_memcg = NULL; | ||
117 | } | ||
76 | spin_unlock(&swap_token_lock); | 118 | spin_unlock(&swap_token_lock); |
77 | } | 119 | } |
120 | |||
121 | static bool match_memcg(struct mem_cgroup *a, struct mem_cgroup *b) | ||
122 | { | ||
123 | if (!a) | ||
124 | return true; | ||
125 | if (!b) | ||
126 | return true; | ||
127 | if (a == b) | ||
128 | return true; | ||
129 | return false; | ||
130 | } | ||
131 | |||
132 | void disable_swap_token(struct mem_cgroup *memcg) | ||
133 | { | ||
134 | /* memcg reclaim don't disable unrelated mm token. */ | ||
135 | if (match_memcg(memcg, swap_token_memcg)) { | ||
136 | spin_lock(&swap_token_lock); | ||
137 | if (match_memcg(memcg, swap_token_memcg)) { | ||
138 | trace_disable_swap_token(swap_token_mm); | ||
139 | swap_token_mm = NULL; | ||
140 | swap_token_memcg = NULL; | ||
141 | } | ||
142 | spin_unlock(&swap_token_lock); | ||
143 | } | ||
144 | } | ||
diff --git a/mm/vmscan.c b/mm/vmscan.c index faa0a088f9cc..8ff834e19c24 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1124,8 +1124,20 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, | |||
1124 | nr_lumpy_dirty++; | 1124 | nr_lumpy_dirty++; |
1125 | scan++; | 1125 | scan++; |
1126 | } else { | 1126 | } else { |
1127 | /* the page is freed already. */ | 1127 | /* |
1128 | if (!page_count(cursor_page)) | 1128 | * Check if the page is freed already. |
1129 | * | ||
1130 | * We can't use page_count() as that | ||
1131 | * requires compound_head and we don't | ||
1132 | * have a pin on the page here. If a | ||
1133 | * page is tail, we may or may not | ||
1134 | * have isolated the head, so assume | ||
1135 | * it's not free, it'd be tricky to | ||
1136 | * track the head status without a | ||
1137 | * page pin. | ||
1138 | */ | ||
1139 | if (!PageTail(cursor_page) && | ||
1140 | !atomic_read(&cursor_page->_count)) | ||
1129 | continue; | 1141 | continue; |
1130 | break; | 1142 | break; |
1131 | } | 1143 | } |
@@ -2081,7 +2093,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
2081 | for (priority = DEF_PRIORITY; priority >= 0; priority--) { | 2093 | for (priority = DEF_PRIORITY; priority >= 0; priority--) { |
2082 | sc->nr_scanned = 0; | 2094 | sc->nr_scanned = 0; |
2083 | if (!priority) | 2095 | if (!priority) |
2084 | disable_swap_token(); | 2096 | disable_swap_token(sc->mem_cgroup); |
2085 | total_scanned += shrink_zones(priority, zonelist, sc); | 2097 | total_scanned += shrink_zones(priority, zonelist, sc); |
2086 | /* | 2098 | /* |
2087 | * Don't shrink slabs when reclaiming memory from | 2099 | * Don't shrink slabs when reclaiming memory from |
@@ -2407,7 +2419,7 @@ loop_again: | |||
2407 | 2419 | ||
2408 | /* The swap token gets in the way of swapout... */ | 2420 | /* The swap token gets in the way of swapout... */ |
2409 | if (!priority) | 2421 | if (!priority) |
2410 | disable_swap_token(); | 2422 | disable_swap_token(NULL); |
2411 | 2423 | ||
2412 | all_zones_ok = 1; | 2424 | all_zones_ok = 1; |
2413 | balanced = 0; | 2425 | balanced = 0; |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8657f99bfb2b..b0aa2c680593 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1943,6 +1943,11 @@ sub process { | |||
1943 | WARN("LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr); | 1943 | WARN("LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr); |
1944 | } | 1944 | } |
1945 | 1945 | ||
1946 | # check for uses of printk_ratelimit | ||
1947 | if ($line =~ /\bprintk_ratelimit\s*\(/) { | ||
1948 | WARN("Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit\n" . $herecurr); | ||
1949 | } | ||
1950 | |||
1946 | # printk should use KERN_* levels. Note that follow on printk's on the | 1951 | # printk should use KERN_* levels. Note that follow on printk's on the |
1947 | # same line do not need a level, so we use the current block context | 1952 | # same line do not need a level, so we use the current block context |
1948 | # to try and find and validate the current printk. In summary the current | 1953 | # to try and find and validate the current printk. In summary the current |
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 77d44138864f..35459340019e 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/audit.h> | 29 | #include <linux/audit.h> |
30 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
31 | #include <linux/kobject.h> | 31 | #include <linux/kobject.h> |
32 | #include <linux/ctype.h> | ||
32 | 33 | ||
33 | /* selinuxfs pseudo filesystem for exporting the security policy API. | 34 | /* selinuxfs pseudo filesystem for exporting the security policy API. |
34 | Based on the proc code and the fs/nfsd/nfsctl.c code. */ | 35 | Based on the proc code and the fs/nfsd/nfsctl.c code. */ |
@@ -751,6 +752,14 @@ out: | |||
751 | return length; | 752 | return length; |
752 | } | 753 | } |
753 | 754 | ||
755 | static inline int hexcode_to_int(int code) { | ||
756 | if (code == '\0' || !isxdigit(code)) | ||
757 | return -1; | ||
758 | if (isdigit(code)) | ||
759 | return code - '0'; | ||
760 | return tolower(code) - 'a' + 10; | ||
761 | } | ||
762 | |||
754 | static ssize_t sel_write_create(struct file *file, char *buf, size_t size) | 763 | static ssize_t sel_write_create(struct file *file, char *buf, size_t size) |
755 | { | 764 | { |
756 | char *scon = NULL, *tcon = NULL; | 765 | char *scon = NULL, *tcon = NULL; |
@@ -785,8 +794,34 @@ static ssize_t sel_write_create(struct file *file, char *buf, size_t size) | |||
785 | nargs = sscanf(buf, "%s %s %hu %s", scon, tcon, &tclass, namebuf); | 794 | nargs = sscanf(buf, "%s %s %hu %s", scon, tcon, &tclass, namebuf); |
786 | if (nargs < 3 || nargs > 4) | 795 | if (nargs < 3 || nargs > 4) |
787 | goto out; | 796 | goto out; |
788 | if (nargs == 4) | 797 | if (nargs == 4) { |
798 | /* | ||
799 | * If and when the name of new object to be queried contains | ||
800 | * either whitespace or multibyte characters, they shall be | ||
801 | * encoded based on the percentage-encoding rule. | ||
802 | * If not encoded, the sscanf logic picks up only left-half | ||
803 | * of the supplied name; splitted by a whitespace unexpectedly. | ||
804 | */ | ||
805 | char *r, *w; | ||
806 | int c1, c2; | ||
807 | |||
808 | r = w = namebuf; | ||
809 | do { | ||
810 | c1 = *r++; | ||
811 | if (c1 == '+') | ||
812 | c1 = ' '; | ||
813 | else if (c1 == '%') { | ||
814 | if ((c1 = hexcode_to_int(*r++)) < 0) | ||
815 | goto out; | ||
816 | if ((c2 = hexcode_to_int(*r++)) < 0) | ||
817 | goto out; | ||
818 | c1 = (c1 << 4) | c2; | ||
819 | } | ||
820 | *w++ = c1; | ||
821 | } while (c1 != '\0'); | ||
822 | |||
789 | objname = namebuf; | 823 | objname = namebuf; |
824 | } | ||
790 | 825 | ||
791 | length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); | 826 | length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); |
792 | if (length) | 827 | if (length) |
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 102e9ec1b77a..d246aca3f4fb 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -3222,6 +3222,9 @@ static int filename_trans_write(struct policydb *p, void *fp) | |||
3222 | __le32 buf[1]; | 3222 | __le32 buf[1]; |
3223 | int rc; | 3223 | int rc; |
3224 | 3224 | ||
3225 | if (p->policyvers < POLICYDB_VERSION_FILENAME_TRANS) | ||
3226 | return 0; | ||
3227 | |||
3225 | nel = 0; | 3228 | nel = 0; |
3226 | rc = hashtab_map(p->filename_trans, hashtab_cnt, &nel); | 3229 | rc = hashtab_map(p->filename_trans, hashtab_cnt, &nel); |
3227 | if (rc) | 3230 | if (rc) |
diff --git a/security/tomoyo/mount.c b/security/tomoyo/mount.c index 162a864dba24..9fc2e15841c9 100644 --- a/security/tomoyo/mount.c +++ b/security/tomoyo/mount.c | |||
@@ -138,7 +138,7 @@ static int tomoyo_mount_acl(struct tomoyo_request_info *r, char *dev_name, | |||
138 | } | 138 | } |
139 | if (need_dev) { | 139 | if (need_dev) { |
140 | /* Get mount point or device file. */ | 140 | /* Get mount point or device file. */ |
141 | if (kern_path(dev_name, LOOKUP_FOLLOW, &path)) { | 141 | if (!dev_name || kern_path(dev_name, LOOKUP_FOLLOW, &path)) { |
142 | error = -ENOENT; | 142 | error = -ENOENT; |
143 | goto out; | 143 | goto out; |
144 | } | 144 | } |