diff options
110 files changed, 2144 insertions, 374 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/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 7c163477fcd8..510d64570d60 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -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 | ||
@@ -464,6 +465,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) | 465 | If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) |
465 | value in memory.stat(see 5.2). | 466 | value in memory.stat(see 5.2). |
466 | 467 | ||
468 | 5.6 numa_stat | ||
469 | |||
470 | This is similar to numa_maps but operates on a per-memcg basis. This is | ||
471 | useful for providing visibility into the numa locality information within | ||
472 | an memcg since the pages are allowed to be allocated from any physical | ||
473 | node. One of the usecases is evaluating application performance by | ||
474 | combining this information with the application's cpu allocation. | ||
475 | |||
476 | We export "total", "file", "anon" and "unevictable" pages per-node for | ||
477 | each memcg. The ouput format of memory.numa_stat is: | ||
478 | |||
479 | total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ... | ||
480 | file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ... | ||
481 | anon=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ... | ||
482 | unevictable=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ... | ||
483 | |||
484 | And we have total = file + anon + unevictable. | ||
485 | |||
467 | 6. Hierarchy support | 486 | 6. Hierarchy support |
468 | 487 | ||
469 | The memory controller supports a deep hierarchy and hierarchical accounting. | 488 | The memory controller supports a deep hierarchy and hierarchical accounting. |
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/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/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/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/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/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/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/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/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 | } |
@@ -277,7 +277,7 @@ static int __bprm_mm_init(struct linux_binprm *bprm) | |||
277 | * use STACK_TOP because that can depend on attributes which aren't | 277 | * use STACK_TOP because that can depend on attributes which aren't |
278 | * configured yet. | 278 | * configured yet. |
279 | */ | 279 | */ |
280 | BUG_ON(VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP); | 280 | BUILD_BUG_ON(VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP); |
281 | vma->vm_end = STACK_TOP_MAX; | 281 | vma->vm_end = STACK_TOP_MAX; |
282 | vma->vm_start = vma->vm_end - PAGE_SIZE; | 282 | vma->vm_start = vma->vm_end - PAGE_SIZE; |
283 | vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP; | 283 | vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP; |
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/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 | ||
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/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 | } |