diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-17 09:04:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-17 09:04:38 -0400 |
commit | 54e514b91b95d6441c12a7955addfb9f9d2afc65 (patch) | |
tree | 8b73d901bd2a6ec5a31f34a8954e5ea92216dd6c /arch | |
parent | 4fc8adcfec3da639da76e8314c9ccefe5bf9a045 (diff) | |
parent | 6c8c90319c0bb1c9e0b68e721359b89ae4f28465 (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge third patchbomb from Andrew Morton:
- various misc things
- a couple of lib/ optimisations
- provide DIV_ROUND_CLOSEST_ULL()
- checkpatch updates
- rtc tree
- befs, nilfs2, hfs, hfsplus, fatfs, adfs, affs, bfs
- ptrace fixes
- fork() fixes
- seccomp cleanups
- more mmap_sem hold time reductions from Davidlohr
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (138 commits)
proc: show locks in /proc/pid/fdinfo/X
docs: add missing and new /proc/PID/status file entries, fix typos
drivers/rtc/rtc-at91rm9200.c: make IO endian agnostic
Documentation/spi/spidev_test.c: fix warning
drivers/rtc/rtc-s5m.c: allow usage on device type different than main MFD type
.gitignore: ignore *.tar
MAINTAINERS: add Mediatek SoC mailing list
tomoyo: reduce mmap_sem hold for mm->exe_file
powerpc/oprofile: reduce mmap_sem hold for exe_file
oprofile: reduce mmap_sem hold for mm->exe_file
mips: ip32: add platform data hooks to use DS1685 driver
lib/Kconfig: fix up HAVE_ARCH_BITREVERSE help text
x86: switch to using asm-generic for seccomp.h
sparc: switch to using asm-generic for seccomp.h
powerpc: switch to using asm-generic for seccomp.h
parisc: switch to using asm-generic for seccomp.h
mips: switch to using asm-generic for seccomp.h
microblaze: use asm-generic for seccomp.h
arm: use asm-generic for seccomp.h
seccomp: allow COMPAT sigreturn overrides
...
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/include/asm/processor.h | 1 | ||||
-rw-r--r-- | arch/arc/kernel/troubleshoot.c | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/seccomp.h | 11 | ||||
-rw-r--r-- | arch/microblaze/include/asm/seccomp.h | 8 | ||||
-rw-r--r-- | arch/mips/configs/ip32_defconfig | 3 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-ip32/mc146818rtc.h | 36 | ||||
-rw-r--r-- | arch/mips/include/asm/seccomp.h | 7 | ||||
-rw-r--r-- | arch/mips/sgi-ip32/ip32-platform.c | 46 | ||||
-rw-r--r-- | arch/mips/sgi-ip32/ip32-reset.c | 131 | ||||
-rw-r--r-- | arch/parisc/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/parisc/include/asm/seccomp.h | 16 | ||||
-rw-r--r-- | arch/powerpc/include/asm/seccomp.h | 10 | ||||
-rw-r--r-- | arch/powerpc/include/uapi/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/powerpc/include/uapi/asm/seccomp.h | 16 | ||||
-rw-r--r-- | arch/powerpc/oprofile/cell/spu_task_sync.c | 13 | ||||
-rw-r--r-- | arch/sparc/include/asm/seccomp.h | 11 | ||||
-rw-r--r-- | arch/x86/include/asm/seccomp.h | 21 | ||||
-rw-r--r-- | arch/x86/include/asm/seccomp_32.h | 11 | ||||
-rw-r--r-- | arch/x86/include/asm/seccomp_64.h | 17 |
20 files changed, 126 insertions, 238 deletions
diff --git a/arch/alpha/include/asm/processor.h b/arch/alpha/include/asm/processor.h index b4cf03690394..43a7559c448b 100644 --- a/arch/alpha/include/asm/processor.h +++ b/arch/alpha/include/asm/processor.h | |||
@@ -44,6 +44,7 @@ struct task_struct; | |||
44 | extern unsigned long thread_saved_pc(struct task_struct *); | 44 | extern unsigned long thread_saved_pc(struct task_struct *); |
45 | 45 | ||
46 | /* Do necessary setup to start up a newly executed thread. */ | 46 | /* Do necessary setup to start up a newly executed thread. */ |
47 | struct pt_regs; | ||
47 | extern void start_thread(struct pt_regs *, unsigned long, unsigned long); | 48 | extern void start_thread(struct pt_regs *, unsigned long, unsigned long); |
48 | 49 | ||
49 | /* Free all resources held by a thread. */ | 50 | /* Free all resources held by a thread. */ |
diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c index 1badf9b84b51..e00a01879025 100644 --- a/arch/arc/kernel/troubleshoot.c +++ b/arch/arc/kernel/troubleshoot.c | |||
@@ -52,7 +52,7 @@ static void show_callee_regs(struct callee_regs *cregs) | |||
52 | print_reg_file(&(cregs->r13), 13); | 52 | print_reg_file(&(cregs->r13), 13); |
53 | } | 53 | } |
54 | 54 | ||
55 | void print_task_path_n_nm(struct task_struct *tsk, char *buf) | 55 | static void print_task_path_n_nm(struct task_struct *tsk, char *buf) |
56 | { | 56 | { |
57 | struct path path; | 57 | struct path path; |
58 | char *path_nm = NULL; | 58 | char *path_nm = NULL; |
@@ -77,7 +77,6 @@ void print_task_path_n_nm(struct task_struct *tsk, char *buf) | |||
77 | done: | 77 | done: |
78 | pr_info("Path: %s\n", path_nm); | 78 | pr_info("Path: %s\n", path_nm); |
79 | } | 79 | } |
80 | EXPORT_SYMBOL(print_task_path_n_nm); | ||
81 | 80 | ||
82 | static void show_faulting_vma(unsigned long address, char *buf) | 81 | static void show_faulting_vma(unsigned long address, char *buf) |
83 | { | 82 | { |
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index eb0f43f3e3f1..3c4596d0ce6c 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild | |||
@@ -21,6 +21,7 @@ generic-y += preempt.h | |||
21 | generic-y += resource.h | 21 | generic-y += resource.h |
22 | generic-y += rwsem.h | 22 | generic-y += rwsem.h |
23 | generic-y += scatterlist.h | 23 | generic-y += scatterlist.h |
24 | generic-y += seccomp.h | ||
24 | generic-y += sections.h | 25 | generic-y += sections.h |
25 | generic-y += segment.h | 26 | generic-y += segment.h |
26 | generic-y += sembuf.h | 27 | generic-y += sembuf.h |
diff --git a/arch/arm/include/asm/seccomp.h b/arch/arm/include/asm/seccomp.h deleted file mode 100644 index 52b156b341f5..000000000000 --- a/arch/arm/include/asm/seccomp.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef _ASM_ARM_SECCOMP_H | ||
2 | #define _ASM_ARM_SECCOMP_H | ||
3 | |||
4 | #include <linux/unistd.h> | ||
5 | |||
6 | #define __NR_seccomp_read __NR_read | ||
7 | #define __NR_seccomp_write __NR_write | ||
8 | #define __NR_seccomp_exit __NR_exit | ||
9 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
10 | |||
11 | #endif /* _ASM_ARM_SECCOMP_H */ | ||
diff --git a/arch/microblaze/include/asm/seccomp.h b/arch/microblaze/include/asm/seccomp.h index 0d912758a0d7..204618a2ce84 100644 --- a/arch/microblaze/include/asm/seccomp.h +++ b/arch/microblaze/include/asm/seccomp.h | |||
@@ -3,14 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
5 | 5 | ||
6 | #define __NR_seccomp_read __NR_read | ||
7 | #define __NR_seccomp_write __NR_write | ||
8 | #define __NR_seccomp_exit __NR_exit | ||
9 | #define __NR_seccomp_sigreturn __NR_sigreturn | 6 | #define __NR_seccomp_sigreturn __NR_sigreturn |
10 | 7 | ||
11 | #define __NR_seccomp_read_32 __NR_read | 8 | #include <asm-generic/seccomp.h> |
12 | #define __NR_seccomp_write_32 __NR_write | ||
13 | #define __NR_seccomp_exit_32 __NR_exit | ||
14 | #define __NR_seccomp_sigreturn_32 __NR_sigreturn | ||
15 | 9 | ||
16 | #endif /* _ASM_MICROBLAZE_SECCOMP_H */ | 10 | #endif /* _ASM_MICROBLAZE_SECCOMP_H */ |
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig index 70ffe9b55829..fe48220157a9 100644 --- a/arch/mips/configs/ip32_defconfig +++ b/arch/mips/configs/ip32_defconfig | |||
@@ -105,7 +105,8 @@ CONFIG_RTC_CLASS=y | |||
105 | # CONFIG_RTC_HCTOSYS is not set | 105 | # CONFIG_RTC_HCTOSYS is not set |
106 | # CONFIG_RTC_INTF_SYSFS is not set | 106 | # CONFIG_RTC_INTF_SYSFS is not set |
107 | # CONFIG_RTC_INTF_PROC is not set | 107 | # CONFIG_RTC_INTF_PROC is not set |
108 | CONFIG_RTC_DRV_CMOS=y | 108 | CONFIG_RTC_DRV_DS1685_FAMILY=y |
109 | CONFIG_RTC_DRV_DS1685=y | ||
109 | CONFIG_EXT2_FS=y | 110 | CONFIG_EXT2_FS=y |
110 | CONFIG_EXT2_FS_XATTR=y | 111 | CONFIG_EXT2_FS_XATTR=y |
111 | CONFIG_EXT2_FS_POSIX_ACL=y | 112 | CONFIG_EXT2_FS_POSIX_ACL=y |
diff --git a/arch/mips/include/asm/mach-ip32/mc146818rtc.h b/arch/mips/include/asm/mach-ip32/mc146818rtc.h deleted file mode 100644 index 6b6bab43d5c1..000000000000 --- a/arch/mips/include/asm/mach-ip32/mc146818rtc.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2001, 03 by Ralf Baechle | ||
7 | * Copyright (C) 2000 Harald Koerfgen | ||
8 | * | ||
9 | * RTC routines for IP32 style attached Dallas chip. | ||
10 | */ | ||
11 | #ifndef __ASM_MACH_IP32_MC146818RTC_H | ||
12 | #define __ASM_MACH_IP32_MC146818RTC_H | ||
13 | |||
14 | #include <asm/ip32/mace.h> | ||
15 | |||
16 | #define RTC_PORT(x) (0x70 + (x)) | ||
17 | |||
18 | static unsigned char CMOS_READ(unsigned long addr) | ||
19 | { | ||
20 | return mace->isa.rtc[addr << 8]; | ||
21 | } | ||
22 | |||
23 | static inline void CMOS_WRITE(unsigned char data, unsigned long addr) | ||
24 | { | ||
25 | mace->isa.rtc[addr << 8] = data; | ||
26 | } | ||
27 | |||
28 | /* | ||
29 | * FIXME: Do it right. For now just assume that no one lives in 20th century | ||
30 | * and no O2 user in 22th century ;-) | ||
31 | */ | ||
32 | #define mc146818_decode_year(year) ((year) + 2000) | ||
33 | |||
34 | #define RTC_ALWAYS_BCD 0 | ||
35 | |||
36 | #endif /* __ASM_MACH_IP32_MC146818RTC_H */ | ||
diff --git a/arch/mips/include/asm/seccomp.h b/arch/mips/include/asm/seccomp.h index f29c75cf83c6..1d8a2e2c75c1 100644 --- a/arch/mips/include/asm/seccomp.h +++ b/arch/mips/include/asm/seccomp.h | |||
@@ -2,11 +2,6 @@ | |||
2 | 2 | ||
3 | #include <linux/unistd.h> | 3 | #include <linux/unistd.h> |
4 | 4 | ||
5 | #define __NR_seccomp_read __NR_read | ||
6 | #define __NR_seccomp_write __NR_write | ||
7 | #define __NR_seccomp_exit __NR_exit | ||
8 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
9 | |||
10 | /* | 5 | /* |
11 | * Kludge alert: | 6 | * Kludge alert: |
12 | * | 7 | * |
@@ -29,4 +24,6 @@ | |||
29 | 24 | ||
30 | #endif /* CONFIG_MIPS32_O32 */ | 25 | #endif /* CONFIG_MIPS32_O32 */ |
31 | 26 | ||
27 | #include <asm-generic/seccomp.h> | ||
28 | |||
32 | #endif /* __ASM_SECCOMP_H */ | 29 | #endif /* __ASM_SECCOMP_H */ |
diff --git a/arch/mips/sgi-ip32/ip32-platform.c b/arch/mips/sgi-ip32/ip32-platform.c index 511e9ff2acfd..b522477129a5 100644 --- a/arch/mips/sgi-ip32/ip32-platform.c +++ b/arch/mips/sgi-ip32/ip32-platform.c | |||
@@ -9,10 +9,13 @@ | |||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/platform_device.h> | 10 | #include <linux/platform_device.h> |
11 | #include <linux/serial_8250.h> | 11 | #include <linux/serial_8250.h> |
12 | #include <linux/rtc/ds1685.h> | ||
12 | 13 | ||
13 | #include <asm/ip32/mace.h> | 14 | #include <asm/ip32/mace.h> |
14 | #include <asm/ip32/ip32_ints.h> | 15 | #include <asm/ip32/ip32_ints.h> |
15 | 16 | ||
17 | extern void ip32_prepare_poweroff(void); | ||
18 | |||
16 | #define MACEISA_SERIAL1_OFFS offsetof(struct sgi_mace, isa.serial1) | 19 | #define MACEISA_SERIAL1_OFFS offsetof(struct sgi_mace, isa.serial1) |
17 | #define MACEISA_SERIAL2_OFFS offsetof(struct sgi_mace, isa.serial2) | 20 | #define MACEISA_SERIAL2_OFFS offsetof(struct sgi_mace, isa.serial2) |
18 | 21 | ||
@@ -90,18 +93,47 @@ static __init int sgio2btns_devinit(void) | |||
90 | 93 | ||
91 | device_initcall(sgio2btns_devinit); | 94 | device_initcall(sgio2btns_devinit); |
92 | 95 | ||
93 | static struct resource sgio2_cmos_rsrc[] = { | 96 | #define MACE_RTC_RES_START (MACE_BASE + offsetof(struct sgi_mace, isa.rtc)) |
97 | #define MACE_RTC_RES_END (MACE_RTC_RES_START + 32767) | ||
98 | |||
99 | static struct resource ip32_rtc_resources[] = { | ||
94 | { | 100 | { |
95 | .start = 0x70, | 101 | .start = MACEISA_RTC_IRQ, |
96 | .end = 0x71, | 102 | .end = MACEISA_RTC_IRQ, |
97 | .flags = IORESOURCE_IO | 103 | .flags = IORESOURCE_IRQ |
104 | }, { | ||
105 | .start = MACE_RTC_RES_START, | ||
106 | .end = MACE_RTC_RES_END, | ||
107 | .flags = IORESOURCE_MEM, | ||
98 | } | 108 | } |
99 | }; | 109 | }; |
100 | 110 | ||
101 | static __init int sgio2_cmos_devinit(void) | 111 | /* RTC registers on IP32 are each padded by 256 bytes (0x100). */ |
112 | static struct ds1685_rtc_platform_data | ||
113 | ip32_rtc_platform_data[] = { | ||
114 | { | ||
115 | .regstep = 0x100, | ||
116 | .bcd_mode = true, | ||
117 | .no_irq = false, | ||
118 | .uie_unsupported = false, | ||
119 | .alloc_io_resources = true, | ||
120 | .plat_prepare_poweroff = ip32_prepare_poweroff, | ||
121 | }, | ||
122 | }; | ||
123 | |||
124 | struct platform_device ip32_rtc_device = { | ||
125 | .name = "rtc-ds1685", | ||
126 | .id = -1, | ||
127 | .dev = { | ||
128 | .platform_data = ip32_rtc_platform_data, | ||
129 | }, | ||
130 | .num_resources = ARRAY_SIZE(ip32_rtc_resources), | ||
131 | .resource = ip32_rtc_resources, | ||
132 | }; | ||
133 | |||
134 | +static int __init sgio2_rtc_devinit(void) | ||
102 | { | 135 | { |
103 | return IS_ERR(platform_device_register_simple("rtc_cmos", -1, | 136 | return platform_device_register(&ip32_rtc_device); |
104 | sgio2_cmos_rsrc, 1)); | ||
105 | } | 137 | } |
106 | 138 | ||
107 | device_initcall(sgio2_cmos_devinit); | 139 | device_initcall(sgio2_cmos_devinit); |
diff --git a/arch/mips/sgi-ip32/ip32-reset.c b/arch/mips/sgi-ip32/ip32-reset.c index 44b3470a0bbb..8bd415c8729f 100644 --- a/arch/mips/sgi-ip32/ip32-reset.c +++ b/arch/mips/sgi-ip32/ip32-reset.c | |||
@@ -11,10 +11,11 @@ | |||
11 | #include <linux/compiler.h> | 11 | #include <linux/compiler.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/module.h> | ||
14 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
15 | #include <linux/notifier.h> | 16 | #include <linux/notifier.h> |
16 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
17 | #include <linux/ds17287rtc.h> | 18 | #include <linux/rtc/ds1685.h> |
18 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
19 | #include <linux/pm.h> | 20 | #include <linux/pm.h> |
20 | 21 | ||
@@ -33,53 +34,40 @@ | |||
33 | #define POWERDOWN_FREQ (HZ / 4) | 34 | #define POWERDOWN_FREQ (HZ / 4) |
34 | #define PANIC_FREQ (HZ / 8) | 35 | #define PANIC_FREQ (HZ / 8) |
35 | 36 | ||
36 | static struct timer_list power_timer, blink_timer, debounce_timer; | 37 | extern struct platform_device ip32_rtc_device; |
37 | static int has_panicked, shuting_down; | ||
38 | 38 | ||
39 | static void ip32_machine_restart(char *command) __noreturn; | 39 | static struct timer_list power_timer, blink_timer; |
40 | static void ip32_machine_halt(void) __noreturn; | 40 | static int has_panicked, shutting_down; |
41 | static void ip32_machine_power_off(void) __noreturn; | ||
42 | 41 | ||
43 | static void ip32_machine_restart(char *cmd) | 42 | static __noreturn void ip32_poweroff(void *data) |
44 | { | 43 | { |
45 | crime->control = CRIME_CONTROL_HARD_RESET; | 44 | void (*poweroff_func)(struct platform_device *) = |
46 | while (1); | 45 | symbol_get(ds1685_rtc_poweroff); |
47 | } | 46 | |
47 | #ifdef CONFIG_MODULES | ||
48 | /* If the first __symbol_get failed, our module wasn't loaded. */ | ||
49 | if (!poweroff_func) { | ||
50 | request_module("rtc-ds1685"); | ||
51 | poweroff_func = symbol_get(ds1685_rtc_poweroff); | ||
52 | } | ||
53 | #endif | ||
48 | 54 | ||
49 | static inline void ip32_machine_halt(void) | 55 | if (!poweroff_func) |
50 | { | 56 | pr_emerg("RTC not available for power-off. Spinning forever ...\n"); |
51 | ip32_machine_power_off(); | 57 | else { |
52 | } | 58 | (*poweroff_func)((struct platform_device *)data); |
59 | symbol_put(ds1685_rtc_poweroff); | ||
60 | } | ||
53 | 61 | ||
54 | static void ip32_machine_power_off(void) | 62 | unreachable(); |
55 | { | ||
56 | unsigned char reg_a, xctrl_a, xctrl_b; | ||
57 | |||
58 | disable_irq(MACEISA_RTC_IRQ); | ||
59 | reg_a = CMOS_READ(RTC_REG_A); | ||
60 | |||
61 | /* setup for kickstart & wake-up (DS12287 Ref. Man. p. 19) */ | ||
62 | reg_a &= ~DS_REGA_DV2; | ||
63 | reg_a |= DS_REGA_DV1; | ||
64 | |||
65 | CMOS_WRITE(reg_a | DS_REGA_DV0, RTC_REG_A); | ||
66 | wbflush(); | ||
67 | xctrl_b = CMOS_READ(DS_B1_XCTRL4B) | ||
68 | | DS_XCTRL4B_ABE | DS_XCTRL4B_KFE; | ||
69 | CMOS_WRITE(xctrl_b, DS_B1_XCTRL4B); | ||
70 | xctrl_a = CMOS_READ(DS_B1_XCTRL4A) & ~DS_XCTRL4A_IFS; | ||
71 | CMOS_WRITE(xctrl_a, DS_B1_XCTRL4A); | ||
72 | wbflush(); | ||
73 | /* adios amigos... */ | ||
74 | CMOS_WRITE(xctrl_a | DS_XCTRL4A_PAB, DS_B1_XCTRL4A); | ||
75 | CMOS_WRITE(reg_a, RTC_REG_A); | ||
76 | wbflush(); | ||
77 | while (1); | ||
78 | } | 63 | } |
79 | 64 | ||
80 | static void power_timeout(unsigned long data) | 65 | static void ip32_machine_restart(char *cmd) __noreturn; |
66 | static void ip32_machine_restart(char *cmd) | ||
81 | { | 67 | { |
82 | ip32_machine_power_off(); | 68 | msleep(20); |
69 | crime->control = CRIME_CONTROL_HARD_RESET; | ||
70 | unreachable(); | ||
83 | } | 71 | } |
84 | 72 | ||
85 | static void blink_timeout(unsigned long data) | 73 | static void blink_timeout(unsigned long data) |
@@ -89,44 +77,27 @@ static void blink_timeout(unsigned long data) | |||
89 | mod_timer(&blink_timer, jiffies + data); | 77 | mod_timer(&blink_timer, jiffies + data); |
90 | } | 78 | } |
91 | 79 | ||
92 | static void debounce(unsigned long data) | 80 | static void ip32_machine_halt(void) |
93 | { | 81 | { |
94 | unsigned char reg_a, reg_c, xctrl_a; | 82 | ip32_poweroff(&ip32_rtc_device); |
95 | 83 | } | |
96 | reg_c = CMOS_READ(RTC_INTR_FLAGS); | ||
97 | reg_a = CMOS_READ(RTC_REG_A); | ||
98 | CMOS_WRITE(reg_a | DS_REGA_DV0, RTC_REG_A); | ||
99 | wbflush(); | ||
100 | xctrl_a = CMOS_READ(DS_B1_XCTRL4A); | ||
101 | if ((xctrl_a & DS_XCTRL4A_IFS) || (reg_c & RTC_IRQF )) { | ||
102 | /* Interrupt still being sent. */ | ||
103 | debounce_timer.expires = jiffies + 50; | ||
104 | add_timer(&debounce_timer); | ||
105 | |||
106 | /* clear interrupt source */ | ||
107 | CMOS_WRITE(xctrl_a & ~DS_XCTRL4A_IFS, DS_B1_XCTRL4A); | ||
108 | CMOS_WRITE(reg_a & ~DS_REGA_DV0, RTC_REG_A); | ||
109 | return; | ||
110 | } | ||
111 | CMOS_WRITE(reg_a & ~DS_REGA_DV0, RTC_REG_A); | ||
112 | |||
113 | if (has_panicked) | ||
114 | ip32_machine_restart(NULL); | ||
115 | 84 | ||
116 | enable_irq(MACEISA_RTC_IRQ); | 85 | static void power_timeout(unsigned long data) |
86 | { | ||
87 | ip32_poweroff(&ip32_rtc_device); | ||
117 | } | 88 | } |
118 | 89 | ||
119 | static inline void ip32_power_button(void) | 90 | void ip32_prepare_poweroff(void) |
120 | { | 91 | { |
121 | if (has_panicked) | 92 | if (has_panicked) |
122 | return; | 93 | return; |
123 | 94 | ||
124 | if (shuting_down || kill_cad_pid(SIGINT, 1)) { | 95 | if (shutting_down || kill_cad_pid(SIGINT, 1)) { |
125 | /* No init process or button pressed twice. */ | 96 | /* No init process or button pressed twice. */ |
126 | ip32_machine_power_off(); | 97 | ip32_poweroff(&ip32_rtc_device); |
127 | } | 98 | } |
128 | 99 | ||
129 | shuting_down = 1; | 100 | shutting_down = 1; |
130 | blink_timer.data = POWERDOWN_FREQ; | 101 | blink_timer.data = POWERDOWN_FREQ; |
131 | blink_timeout(POWERDOWN_FREQ); | 102 | blink_timeout(POWERDOWN_FREQ); |
132 | 103 | ||
@@ -136,27 +107,6 @@ static inline void ip32_power_button(void) | |||
136 | add_timer(&power_timer); | 107 | add_timer(&power_timer); |
137 | } | 108 | } |
138 | 109 | ||
139 | static irqreturn_t ip32_rtc_int(int irq, void *dev_id) | ||
140 | { | ||
141 | unsigned char reg_c; | ||
142 | |||
143 | reg_c = CMOS_READ(RTC_INTR_FLAGS); | ||
144 | if (!(reg_c & RTC_IRQF)) { | ||
145 | printk(KERN_WARNING | ||
146 | "%s: RTC IRQ without RTC_IRQF\n", __func__); | ||
147 | } | ||
148 | /* Wait until interrupt goes away */ | ||
149 | disable_irq_nosync(MACEISA_RTC_IRQ); | ||
150 | init_timer(&debounce_timer); | ||
151 | debounce_timer.function = debounce; | ||
152 | debounce_timer.expires = jiffies + 50; | ||
153 | add_timer(&debounce_timer); | ||
154 | |||
155 | printk(KERN_DEBUG "Power button pressed\n"); | ||
156 | ip32_power_button(); | ||
157 | return IRQ_HANDLED; | ||
158 | } | ||
159 | |||
160 | static int panic_event(struct notifier_block *this, unsigned long event, | 110 | static int panic_event(struct notifier_block *this, unsigned long event, |
161 | void *ptr) | 111 | void *ptr) |
162 | { | 112 | { |
@@ -190,15 +140,12 @@ static __init int ip32_reboot_setup(void) | |||
190 | 140 | ||
191 | _machine_restart = ip32_machine_restart; | 141 | _machine_restart = ip32_machine_restart; |
192 | _machine_halt = ip32_machine_halt; | 142 | _machine_halt = ip32_machine_halt; |
193 | pm_power_off = ip32_machine_power_off; | 143 | pm_power_off = ip32_machine_halt; |
194 | 144 | ||
195 | init_timer(&blink_timer); | 145 | init_timer(&blink_timer); |
196 | blink_timer.function = blink_timeout; | 146 | blink_timer.function = blink_timeout; |
197 | atomic_notifier_chain_register(&panic_notifier_list, &panic_block); | 147 | atomic_notifier_chain_register(&panic_notifier_list, &panic_block); |
198 | 148 | ||
199 | if (request_irq(MACEISA_RTC_IRQ, ip32_rtc_int, 0, "rtc", NULL)) | ||
200 | panic("Can't allocate MACEISA RTC IRQ"); | ||
201 | |||
202 | return 0; | 149 | return 0; |
203 | } | 150 | } |
204 | 151 | ||
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild index 8686237a3c3c..12b341d04f88 100644 --- a/arch/parisc/include/asm/Kbuild +++ b/arch/parisc/include/asm/Kbuild | |||
@@ -20,6 +20,7 @@ generic-y += param.h | |||
20 | generic-y += percpu.h | 20 | generic-y += percpu.h |
21 | generic-y += poll.h | 21 | generic-y += poll.h |
22 | generic-y += preempt.h | 22 | generic-y += preempt.h |
23 | generic-y += seccomp.h | ||
23 | generic-y += segment.h | 24 | generic-y += segment.h |
24 | generic-y += topology.h | 25 | generic-y += topology.h |
25 | generic-y += trace_clock.h | 26 | generic-y += trace_clock.h |
diff --git a/arch/parisc/include/asm/seccomp.h b/arch/parisc/include/asm/seccomp.h deleted file mode 100644 index 015f7887aa29..000000000000 --- a/arch/parisc/include/asm/seccomp.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef _ASM_PARISC_SECCOMP_H | ||
2 | #define _ASM_PARISC_SECCOMP_H | ||
3 | |||
4 | #include <linux/unistd.h> | ||
5 | |||
6 | #define __NR_seccomp_read __NR_read | ||
7 | #define __NR_seccomp_write __NR_write | ||
8 | #define __NR_seccomp_exit __NR_exit | ||
9 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
10 | |||
11 | #define __NR_seccomp_read_32 __NR_read | ||
12 | #define __NR_seccomp_write_32 __NR_write | ||
13 | #define __NR_seccomp_exit_32 __NR_exit | ||
14 | #define __NR_seccomp_sigreturn_32 __NR_rt_sigreturn | ||
15 | |||
16 | #endif /* _ASM_PARISC_SECCOMP_H */ | ||
diff --git a/arch/powerpc/include/asm/seccomp.h b/arch/powerpc/include/asm/seccomp.h new file mode 100644 index 000000000000..c1818e35cf02 --- /dev/null +++ b/arch/powerpc/include/asm/seccomp.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef _ASM_POWERPC_SECCOMP_H | ||
2 | #define _ASM_POWERPC_SECCOMP_H | ||
3 | |||
4 | #include <linux/unistd.h> | ||
5 | |||
6 | #define __NR_seccomp_sigreturn_32 __NR_sigreturn | ||
7 | |||
8 | #include <asm-generic/seccomp.h> | ||
9 | |||
10 | #endif /* _ASM_POWERPC_SECCOMP_H */ | ||
diff --git a/arch/powerpc/include/uapi/asm/Kbuild b/arch/powerpc/include/uapi/asm/Kbuild index 7a3f795ac218..79c4068be278 100644 --- a/arch/powerpc/include/uapi/asm/Kbuild +++ b/arch/powerpc/include/uapi/asm/Kbuild | |||
@@ -25,7 +25,6 @@ header-y += posix_types.h | |||
25 | header-y += ps3fb.h | 25 | header-y += ps3fb.h |
26 | header-y += ptrace.h | 26 | header-y += ptrace.h |
27 | header-y += resource.h | 27 | header-y += resource.h |
28 | header-y += seccomp.h | ||
29 | header-y += sembuf.h | 28 | header-y += sembuf.h |
30 | header-y += setup.h | 29 | header-y += setup.h |
31 | header-y += shmbuf.h | 30 | header-y += shmbuf.h |
diff --git a/arch/powerpc/include/uapi/asm/seccomp.h b/arch/powerpc/include/uapi/asm/seccomp.h deleted file mode 100644 index 00c1d9133cfe..000000000000 --- a/arch/powerpc/include/uapi/asm/seccomp.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef _ASM_POWERPC_SECCOMP_H | ||
2 | #define _ASM_POWERPC_SECCOMP_H | ||
3 | |||
4 | #include <linux/unistd.h> | ||
5 | |||
6 | #define __NR_seccomp_read __NR_read | ||
7 | #define __NR_seccomp_write __NR_write | ||
8 | #define __NR_seccomp_exit __NR_exit | ||
9 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
10 | |||
11 | #define __NR_seccomp_read_32 __NR_read | ||
12 | #define __NR_seccomp_write_32 __NR_write | ||
13 | #define __NR_seccomp_exit_32 __NR_exit | ||
14 | #define __NR_seccomp_sigreturn_32 __NR_sigreturn | ||
15 | |||
16 | #endif /* _ASM_POWERPC_SECCOMP_H */ | ||
diff --git a/arch/powerpc/oprofile/cell/spu_task_sync.c b/arch/powerpc/oprofile/cell/spu_task_sync.c index 1c27831df1ac..ed7b0977072a 100644 --- a/arch/powerpc/oprofile/cell/spu_task_sync.c +++ b/arch/powerpc/oprofile/cell/spu_task_sync.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/kref.h> | 22 | #include <linux/kref.h> |
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
25 | #include <linux/file.h> | ||
25 | #include <linux/module.h> | 26 | #include <linux/module.h> |
26 | #include <linux/notifier.h> | 27 | #include <linux/notifier.h> |
27 | #include <linux/numa.h> | 28 | #include <linux/numa.h> |
@@ -322,18 +323,20 @@ get_exec_dcookie_and_offset(struct spu *spu, unsigned int *offsetp, | |||
322 | unsigned long app_cookie = 0; | 323 | unsigned long app_cookie = 0; |
323 | unsigned int my_offset = 0; | 324 | unsigned int my_offset = 0; |
324 | struct vm_area_struct *vma; | 325 | struct vm_area_struct *vma; |
326 | struct file *exe_file; | ||
325 | struct mm_struct *mm = spu->mm; | 327 | struct mm_struct *mm = spu->mm; |
326 | 328 | ||
327 | if (!mm) | 329 | if (!mm) |
328 | goto out; | 330 | goto out; |
329 | 331 | ||
330 | down_read(&mm->mmap_sem); | 332 | exe_file = get_mm_exe_file(mm); |
331 | 333 | if (exe_file) { | |
332 | if (mm->exe_file) { | 334 | app_cookie = fast_get_dcookie(&exe_file->f_path); |
333 | app_cookie = fast_get_dcookie(&mm->exe_file->f_path); | 335 | pr_debug("got dcookie for %pD\n", exe_file); |
334 | pr_debug("got dcookie for %pD\n", mm->exe_file); | 336 | fput(exe_file); |
335 | } | 337 | } |
336 | 338 | ||
339 | down_read(&mm->mmap_sem); | ||
337 | for (vma = mm->mmap; vma; vma = vma->vm_next) { | 340 | for (vma = mm->mmap; vma; vma = vma->vm_next) { |
338 | if (vma->vm_start > spu_ref || vma->vm_end <= spu_ref) | 341 | if (vma->vm_start > spu_ref || vma->vm_end <= spu_ref) |
339 | continue; | 342 | continue; |
diff --git a/arch/sparc/include/asm/seccomp.h b/arch/sparc/include/asm/seccomp.h index adca1bce41d4..5ef8826d44f8 100644 --- a/arch/sparc/include/asm/seccomp.h +++ b/arch/sparc/include/asm/seccomp.h | |||
@@ -1,15 +1,10 @@ | |||
1 | #ifndef _ASM_SECCOMP_H | 1 | #ifndef _ASM_SECCOMP_H |
2 | #define _ASM_SECCOMP_H | ||
2 | 3 | ||
3 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
4 | 5 | ||
5 | #define __NR_seccomp_read __NR_read | ||
6 | #define __NR_seccomp_write __NR_write | ||
7 | #define __NR_seccomp_exit __NR_exit | ||
8 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
9 | |||
10 | #define __NR_seccomp_read_32 __NR_read | ||
11 | #define __NR_seccomp_write_32 __NR_write | ||
12 | #define __NR_seccomp_exit_32 __NR_exit | ||
13 | #define __NR_seccomp_sigreturn_32 __NR_sigreturn | 6 | #define __NR_seccomp_sigreturn_32 __NR_sigreturn |
14 | 7 | ||
8 | #include <asm-generic/seccomp.h> | ||
9 | |||
15 | #endif /* _ASM_SECCOMP_H */ | 10 | #endif /* _ASM_SECCOMP_H */ |
diff --git a/arch/x86/include/asm/seccomp.h b/arch/x86/include/asm/seccomp.h index 0f3d7f099224..0c8c7c8861b4 100644 --- a/arch/x86/include/asm/seccomp.h +++ b/arch/x86/include/asm/seccomp.h | |||
@@ -1,5 +1,20 @@ | |||
1 | #ifndef _ASM_X86_SECCOMP_H | ||
2 | #define _ASM_X86_SECCOMP_H | ||
3 | |||
4 | #include <asm/unistd.h> | ||
5 | |||
1 | #ifdef CONFIG_X86_32 | 6 | #ifdef CONFIG_X86_32 |
2 | # include <asm/seccomp_32.h> | 7 | #define __NR_seccomp_sigreturn __NR_sigreturn |
3 | #else | ||
4 | # include <asm/seccomp_64.h> | ||
5 | #endif | 8 | #endif |
9 | |||
10 | #ifdef CONFIG_COMPAT | ||
11 | #include <asm/ia32_unistd.h> | ||
12 | #define __NR_seccomp_read_32 __NR_ia32_read | ||
13 | #define __NR_seccomp_write_32 __NR_ia32_write | ||
14 | #define __NR_seccomp_exit_32 __NR_ia32_exit | ||
15 | #define __NR_seccomp_sigreturn_32 __NR_ia32_sigreturn | ||
16 | #endif | ||
17 | |||
18 | #include <asm-generic/seccomp.h> | ||
19 | |||
20 | #endif /* _ASM_X86_SECCOMP_H */ | ||
diff --git a/arch/x86/include/asm/seccomp_32.h b/arch/x86/include/asm/seccomp_32.h deleted file mode 100644 index b811d6f5780c..000000000000 --- a/arch/x86/include/asm/seccomp_32.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef _ASM_X86_SECCOMP_32_H | ||
2 | #define _ASM_X86_SECCOMP_32_H | ||
3 | |||
4 | #include <linux/unistd.h> | ||
5 | |||
6 | #define __NR_seccomp_read __NR_read | ||
7 | #define __NR_seccomp_write __NR_write | ||
8 | #define __NR_seccomp_exit __NR_exit | ||
9 | #define __NR_seccomp_sigreturn __NR_sigreturn | ||
10 | |||
11 | #endif /* _ASM_X86_SECCOMP_32_H */ | ||
diff --git a/arch/x86/include/asm/seccomp_64.h b/arch/x86/include/asm/seccomp_64.h deleted file mode 100644 index 84ec1bd161a5..000000000000 --- a/arch/x86/include/asm/seccomp_64.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef _ASM_X86_SECCOMP_64_H | ||
2 | #define _ASM_X86_SECCOMP_64_H | ||
3 | |||
4 | #include <linux/unistd.h> | ||
5 | #include <asm/ia32_unistd.h> | ||
6 | |||
7 | #define __NR_seccomp_read __NR_read | ||
8 | #define __NR_seccomp_write __NR_write | ||
9 | #define __NR_seccomp_exit __NR_exit | ||
10 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
11 | |||
12 | #define __NR_seccomp_read_32 __NR_ia32_read | ||
13 | #define __NR_seccomp_write_32 __NR_ia32_write | ||
14 | #define __NR_seccomp_exit_32 __NR_ia32_exit | ||
15 | #define __NR_seccomp_sigreturn_32 __NR_ia32_sigreturn | ||
16 | |||
17 | #endif /* _ASM_X86_SECCOMP_64_H */ | ||