diff options
787 files changed, 3338 insertions, 2886 deletions
diff --git a/Documentation/devicetree/bindings/arm/psci.txt b/Documentation/devicetree/bindings/arm/psci.txt new file mode 100644 index 000000000000..433afe9cb590 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/psci.txt | |||
@@ -0,0 +1,55 @@ | |||
1 | * Power State Coordination Interface (PSCI) | ||
2 | |||
3 | Firmware implementing the PSCI functions described in ARM document number | ||
4 | ARM DEN 0022A ("Power State Coordination Interface System Software on ARM | ||
5 | processors") can be used by Linux to initiate various CPU-centric power | ||
6 | operations. | ||
7 | |||
8 | Issue A of the specification describes functions for CPU suspend, hotplug | ||
9 | and migration of secure software. | ||
10 | |||
11 | Functions are invoked by trapping to the privilege level of the PSCI | ||
12 | firmware (specified as part of the binding below) and passing arguments | ||
13 | in a manner similar to that specified by AAPCS: | ||
14 | |||
15 | r0 => 32-bit Function ID / return value | ||
16 | {r1 - r3} => Parameters | ||
17 | |||
18 | Note that the immediate field of the trapping instruction must be set | ||
19 | to #0. | ||
20 | |||
21 | |||
22 | Main node required properties: | ||
23 | |||
24 | - compatible : Must be "arm,psci" | ||
25 | |||
26 | - method : The method of calling the PSCI firmware. Permitted | ||
27 | values are: | ||
28 | |||
29 | "smc" : SMC #0, with the register assignments specified | ||
30 | in this binding. | ||
31 | |||
32 | "hvc" : HVC #0, with the register assignments specified | ||
33 | in this binding. | ||
34 | |||
35 | Main node optional properties: | ||
36 | |||
37 | - cpu_suspend : Function ID for CPU_SUSPEND operation | ||
38 | |||
39 | - cpu_off : Function ID for CPU_OFF operation | ||
40 | |||
41 | - cpu_on : Function ID for CPU_ON operation | ||
42 | |||
43 | - migrate : Function ID for MIGRATE operation | ||
44 | |||
45 | |||
46 | Example: | ||
47 | |||
48 | psci { | ||
49 | compatible = "arm,psci"; | ||
50 | method = "smc"; | ||
51 | cpu_suspend = <0x95c10000>; | ||
52 | cpu_off = <0x95c10001>; | ||
53 | cpu_on = <0x95c10002>; | ||
54 | migrate = <0x95c10003>; | ||
55 | }; | ||
diff --git a/Documentation/hid/hid-sensor.txt b/Documentation/hid/hid-sensor.txt index 948b0989c433..948b0989c433 100755..100644 --- a/Documentation/hid/hid-sensor.txt +++ b/Documentation/hid/hid-sensor.txt | |||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 363e348bff9b..6c723811c0a0 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -2438,7 +2438,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2438 | real-time workloads. It can also improve energy | 2438 | real-time workloads. It can also improve energy |
2439 | efficiency for asymmetric multiprocessors. | 2439 | efficiency for asymmetric multiprocessors. |
2440 | 2440 | ||
2441 | rcu_nocbs_poll [KNL,BOOT] | 2441 | rcu_nocb_poll [KNL,BOOT] |
2442 | Rather than requiring that offloaded CPUs | 2442 | Rather than requiring that offloaded CPUs |
2443 | (specified by rcu_nocbs= above) explicitly | 2443 | (specified by rcu_nocbs= above) explicitly |
2444 | awaken the corresponding "rcuoN" kthreads, | 2444 | awaken the corresponding "rcuoN" kthreads, |
diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt index 3edb4c2887a1..e540fd67f767 100644 --- a/Documentation/x86/boot.txt +++ b/Documentation/x86/boot.txt | |||
@@ -57,7 +57,7 @@ Protocol 2.10: (Kernel 2.6.31) Added a protocol for relaxed alignment | |||
57 | Protocol 2.11: (Kernel 3.6) Added a field for offset of EFI handover | 57 | Protocol 2.11: (Kernel 3.6) Added a field for offset of EFI handover |
58 | protocol entry point. | 58 | protocol entry point. |
59 | 59 | ||
60 | Protocol 2.12: (Kernel 3.9) Added the xloadflags field and extension fields | 60 | Protocol 2.12: (Kernel 3.8) Added the xloadflags field and extension fields |
61 | to struct boot_params for for loading bzImage and ramdisk | 61 | to struct boot_params for for loading bzImage and ramdisk |
62 | above 4G in 64bit. | 62 | above 4G in 64bit. |
63 | 63 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 70ea870a9f85..38633ee8b2d0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1489,7 +1489,7 @@ AVR32 ARCHITECTURE | |||
1489 | M: Haavard Skinnemoen <hskinnemoen@gmail.com> | 1489 | M: Haavard Skinnemoen <hskinnemoen@gmail.com> |
1490 | M: Hans-Christian Egtvedt <egtvedt@samfundet.no> | 1490 | M: Hans-Christian Egtvedt <egtvedt@samfundet.no> |
1491 | W: http://www.atmel.com/products/AVR32/ | 1491 | W: http://www.atmel.com/products/AVR32/ |
1492 | W: http://avr32linux.org/ | 1492 | W: http://mirror.egtvedt.no/avr32linux.org/ |
1493 | W: http://avrfreaks.net/ | 1493 | W: http://avrfreaks.net/ |
1494 | S: Maintained | 1494 | S: Maintained |
1495 | F: arch/avr32/ | 1495 | F: arch/avr32/ |
@@ -1,8 +1,8 @@ | |||
1 | VERSION = 3 | 1 | VERSION = 3 |
2 | PATCHLEVEL = 8 | 2 | PATCHLEVEL = 8 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc5 | 4 | EXTRAVERSION = -rc7 |
5 | NAME = Terrified Chipmunk | 5 | NAME = Unicycling Gorilla |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
8 | # To see a list of typical targets execute "make help" | 8 | # To see a list of typical targets execute "make help" |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 0ad2823bf8c2..441eda19b86f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1128,6 +1128,8 @@ source "arch/arm/mach-versatile/Kconfig" | |||
1128 | source "arch/arm/mach-vexpress/Kconfig" | 1128 | source "arch/arm/mach-vexpress/Kconfig" |
1129 | source "arch/arm/plat-versatile/Kconfig" | 1129 | source "arch/arm/plat-versatile/Kconfig" |
1130 | 1130 | ||
1131 | source "arch/arm/mach-virt/Kconfig" | ||
1132 | |||
1131 | source "arch/arm/mach-vt8500/Kconfig" | 1133 | source "arch/arm/mach-vt8500/Kconfig" |
1132 | 1134 | ||
1133 | source "arch/arm/mach-w90x900/Kconfig" | 1135 | source "arch/arm/mach-w90x900/Kconfig" |
@@ -1622,6 +1624,16 @@ config HOTPLUG_CPU | |||
1622 | Say Y here to experiment with turning CPUs off and on. CPUs | 1624 | Say Y here to experiment with turning CPUs off and on. CPUs |
1623 | can be controlled through /sys/devices/system/cpu. | 1625 | can be controlled through /sys/devices/system/cpu. |
1624 | 1626 | ||
1627 | config ARM_PSCI | ||
1628 | bool "Support for the ARM Power State Coordination Interface (PSCI)" | ||
1629 | depends on CPU_V7 | ||
1630 | help | ||
1631 | Say Y here if you want Linux to communicate with system firmware | ||
1632 | implementing the PSCI specification for CPU-centric power | ||
1633 | management operations described in ARM document number ARM DEN | ||
1634 | 0022A ("Power State Coordination Interface System Software on | ||
1635 | ARM processors"). | ||
1636 | |||
1625 | config LOCAL_TIMERS | 1637 | config LOCAL_TIMERS |
1626 | bool "Use local timer interrupts" | 1638 | bool "Use local timer interrupts" |
1627 | depends on SMP | 1639 | depends on SMP |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 4bcd2d6b0535..3b82b36eec3f 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -194,6 +194,7 @@ machine-$(CONFIG_ARCH_SOCFPGA) += socfpga | |||
194 | machine-$(CONFIG_ARCH_SPEAR13XX) += spear13xx | 194 | machine-$(CONFIG_ARCH_SPEAR13XX) += spear13xx |
195 | machine-$(CONFIG_ARCH_SPEAR3XX) += spear3xx | 195 | machine-$(CONFIG_ARCH_SPEAR3XX) += spear3xx |
196 | machine-$(CONFIG_MACH_SPEAR600) += spear6xx | 196 | machine-$(CONFIG_MACH_SPEAR600) += spear6xx |
197 | machine-$(CONFIG_ARCH_VIRT) += virt | ||
197 | machine-$(CONFIG_ARCH_ZYNQ) += zynq | 198 | machine-$(CONFIG_ARCH_ZYNQ) += zynq |
198 | machine-$(CONFIG_ARCH_SUNXI) += sunxi | 199 | machine-$(CONFIG_ARCH_SUNXI) += sunxi |
199 | 200 | ||
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h index 917d4fcfd9b4..308ad7d6f98b 100644 --- a/arch/arm/include/asm/mach/arch.h +++ b/arch/arm/include/asm/mach/arch.h | |||
@@ -12,7 +12,6 @@ | |||
12 | 12 | ||
13 | struct tag; | 13 | struct tag; |
14 | struct meminfo; | 14 | struct meminfo; |
15 | struct sys_timer; | ||
16 | struct pt_regs; | 15 | struct pt_regs; |
17 | struct smp_operations; | 16 | struct smp_operations; |
18 | #ifdef CONFIG_SMP | 17 | #ifdef CONFIG_SMP |
@@ -48,7 +47,7 @@ struct machine_desc { | |||
48 | void (*map_io)(void);/* IO mapping function */ | 47 | void (*map_io)(void);/* IO mapping function */ |
49 | void (*init_early)(void); | 48 | void (*init_early)(void); |
50 | void (*init_irq)(void); | 49 | void (*init_irq)(void); |
51 | struct sys_timer *timer; /* system tick timer */ | 50 | void (*init_time)(void); |
52 | void (*init_machine)(void); | 51 | void (*init_machine)(void); |
53 | void (*init_late)(void); | 52 | void (*init_late)(void); |
54 | #ifdef CONFIG_MULTI_IRQ_HANDLER | 53 | #ifdef CONFIG_MULTI_IRQ_HANDLER |
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index 6ca945f534ab..90c12e1e695c 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h | |||
@@ -10,36 +10,6 @@ | |||
10 | #ifndef __ASM_ARM_MACH_TIME_H | 10 | #ifndef __ASM_ARM_MACH_TIME_H |
11 | #define __ASM_ARM_MACH_TIME_H | 11 | #define __ASM_ARM_MACH_TIME_H |
12 | 12 | ||
13 | /* | ||
14 | * This is our kernel timer structure. | ||
15 | * | ||
16 | * - init | ||
17 | * Initialise the kernels jiffy timer source, claim interrupt | ||
18 | * using setup_irq. This is called early on during initialisation | ||
19 | * while interrupts are still disabled on the local CPU. | ||
20 | * - suspend | ||
21 | * Suspend the kernel jiffy timer source, if necessary. This | ||
22 | * is called with interrupts disabled, after all normal devices | ||
23 | * have been suspended. If no action is required, set this to | ||
24 | * NULL. | ||
25 | * - resume | ||
26 | * Resume the kernel jiffy timer source, if necessary. This | ||
27 | * is called with interrupts disabled before any normal devices | ||
28 | * are resumed. If no action is required, set this to NULL. | ||
29 | * - offset | ||
30 | * Return the timer offset in microseconds since the last timer | ||
31 | * interrupt. Note: this must take account of any unprocessed | ||
32 | * timer interrupt which may be pending. | ||
33 | */ | ||
34 | struct sys_timer { | ||
35 | void (*init)(void); | ||
36 | void (*suspend)(void); | ||
37 | void (*resume)(void); | ||
38 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | ||
39 | unsigned long (*offset)(void); | ||
40 | #endif | ||
41 | }; | ||
42 | |||
43 | extern void timer_tick(void); | 13 | extern void timer_tick(void); |
44 | 14 | ||
45 | struct timespec; | 15 | struct timespec; |
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 73cf03aa981e..1c4df27f9332 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h | |||
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) | 38 | #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) |
39 | #define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000)) | 39 | #define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000)) |
40 | #define TASK_UNMAPPED_BASE (UL(CONFIG_PAGE_OFFSET) / 3) | 40 | #define TASK_UNMAPPED_BASE ALIGN(TASK_SIZE / 3, SZ_16M) |
41 | 41 | ||
42 | /* | 42 | /* |
43 | * The maximum size of a 26-bit user space task. | 43 | * The maximum size of a 26-bit user space task. |
diff --git a/arch/arm/include/asm/opcodes-sec.h b/arch/arm/include/asm/opcodes-sec.h new file mode 100644 index 000000000000..bc3a9174417c --- /dev/null +++ b/arch/arm/include/asm/opcodes-sec.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | ||
4 | * published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope that it will be useful, | ||
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
9 | * GNU General Public License for more details. | ||
10 | * | ||
11 | * Copyright (C) 2012 ARM Limited | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARM_OPCODES_SEC_H | ||
15 | #define __ASM_ARM_OPCODES_SEC_H | ||
16 | |||
17 | #include <asm/opcodes.h> | ||
18 | |||
19 | #define __SMC(imm4) __inst_arm_thumb32( \ | ||
20 | 0xE1600070 | (((imm4) & 0xF) << 0), \ | ||
21 | 0xF7F08000 | (((imm4) & 0xF) << 16) \ | ||
22 | ) | ||
23 | |||
24 | #endif /* __ASM_ARM_OPCODES_SEC_H */ | ||
diff --git a/arch/arm/include/asm/opcodes.h b/arch/arm/include/asm/opcodes.h index 74e211a6fb24..e796c598513b 100644 --- a/arch/arm/include/asm/opcodes.h +++ b/arch/arm/include/asm/opcodes.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define __ASM_ARM_OPCODES_H | 10 | #define __ASM_ARM_OPCODES_H |
11 | 11 | ||
12 | #ifndef __ASSEMBLY__ | 12 | #ifndef __ASSEMBLY__ |
13 | #include <linux/linkage.h> | ||
13 | extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr); | 14 | extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr); |
14 | #endif | 15 | #endif |
15 | 16 | ||
diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h new file mode 100644 index 000000000000..ce0dbe7c1625 --- /dev/null +++ b/arch/arm/include/asm/psci.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | ||
4 | * published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope that it will be useful, | ||
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
9 | * GNU General Public License for more details. | ||
10 | * | ||
11 | * Copyright (C) 2012 ARM Limited | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARM_PSCI_H | ||
15 | #define __ASM_ARM_PSCI_H | ||
16 | |||
17 | #define PSCI_POWER_STATE_TYPE_STANDBY 0 | ||
18 | #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 | ||
19 | |||
20 | struct psci_power_state { | ||
21 | u16 id; | ||
22 | u8 type; | ||
23 | u8 affinity_level; | ||
24 | }; | ||
25 | |||
26 | struct psci_operations { | ||
27 | int (*cpu_suspend)(struct psci_power_state state, | ||
28 | unsigned long entry_point); | ||
29 | int (*cpu_off)(struct psci_power_state state); | ||
30 | int (*cpu_on)(unsigned long cpuid, unsigned long entry_point); | ||
31 | int (*migrate)(unsigned long cpuid); | ||
32 | }; | ||
33 | |||
34 | extern struct psci_operations psci_ops; | ||
35 | |||
36 | #endif /* __ASM_ARM_PSCI_H */ | ||
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 5bbec7b8183e..5f3338eacad2 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -82,5 +82,6 @@ obj-$(CONFIG_DEBUG_LL) += debug.o | |||
82 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 82 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
83 | 83 | ||
84 | obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o | 84 | obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o |
85 | obj-$(CONFIG_ARM_PSCI) += psci.o | ||
85 | 86 | ||
86 | extra-y := $(head-y) vmlinux.lds | 87 | extra-y := $(head-y) vmlinux.lds |
diff --git a/arch/arm/kernel/psci.c b/arch/arm/kernel/psci.c new file mode 100644 index 000000000000..36531643cc2c --- /dev/null +++ b/arch/arm/kernel/psci.c | |||
@@ -0,0 +1,211 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | ||
4 | * published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope that it will be useful, | ||
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
9 | * GNU General Public License for more details. | ||
10 | * | ||
11 | * Copyright (C) 2012 ARM Limited | ||
12 | * | ||
13 | * Author: Will Deacon <will.deacon@arm.com> | ||
14 | */ | ||
15 | |||
16 | #define pr_fmt(fmt) "psci: " fmt | ||
17 | |||
18 | #include <linux/init.h> | ||
19 | #include <linux/of.h> | ||
20 | |||
21 | #include <asm/compiler.h> | ||
22 | #include <asm/errno.h> | ||
23 | #include <asm/opcodes-sec.h> | ||
24 | #include <asm/opcodes-virt.h> | ||
25 | #include <asm/psci.h> | ||
26 | |||
27 | struct psci_operations psci_ops; | ||
28 | |||
29 | static int (*invoke_psci_fn)(u32, u32, u32, u32); | ||
30 | |||
31 | enum psci_function { | ||
32 | PSCI_FN_CPU_SUSPEND, | ||
33 | PSCI_FN_CPU_ON, | ||
34 | PSCI_FN_CPU_OFF, | ||
35 | PSCI_FN_MIGRATE, | ||
36 | PSCI_FN_MAX, | ||
37 | }; | ||
38 | |||
39 | static u32 psci_function_id[PSCI_FN_MAX]; | ||
40 | |||
41 | #define PSCI_RET_SUCCESS 0 | ||
42 | #define PSCI_RET_EOPNOTSUPP -1 | ||
43 | #define PSCI_RET_EINVAL -2 | ||
44 | #define PSCI_RET_EPERM -3 | ||
45 | |||
46 | static int psci_to_linux_errno(int errno) | ||
47 | { | ||
48 | switch (errno) { | ||
49 | case PSCI_RET_SUCCESS: | ||
50 | return 0; | ||
51 | case PSCI_RET_EOPNOTSUPP: | ||
52 | return -EOPNOTSUPP; | ||
53 | case PSCI_RET_EINVAL: | ||
54 | return -EINVAL; | ||
55 | case PSCI_RET_EPERM: | ||
56 | return -EPERM; | ||
57 | }; | ||
58 | |||
59 | return -EINVAL; | ||
60 | } | ||
61 | |||
62 | #define PSCI_POWER_STATE_ID_MASK 0xffff | ||
63 | #define PSCI_POWER_STATE_ID_SHIFT 0 | ||
64 | #define PSCI_POWER_STATE_TYPE_MASK 0x1 | ||
65 | #define PSCI_POWER_STATE_TYPE_SHIFT 16 | ||
66 | #define PSCI_POWER_STATE_AFFL_MASK 0x3 | ||
67 | #define PSCI_POWER_STATE_AFFL_SHIFT 24 | ||
68 | |||
69 | static u32 psci_power_state_pack(struct psci_power_state state) | ||
70 | { | ||
71 | return ((state.id & PSCI_POWER_STATE_ID_MASK) | ||
72 | << PSCI_POWER_STATE_ID_SHIFT) | | ||
73 | ((state.type & PSCI_POWER_STATE_TYPE_MASK) | ||
74 | << PSCI_POWER_STATE_TYPE_SHIFT) | | ||
75 | ((state.affinity_level & PSCI_POWER_STATE_AFFL_MASK) | ||
76 | << PSCI_POWER_STATE_AFFL_SHIFT); | ||
77 | } | ||
78 | |||
79 | /* | ||
80 | * The following two functions are invoked via the invoke_psci_fn pointer | ||
81 | * and will not be inlined, allowing us to piggyback on the AAPCS. | ||
82 | */ | ||
83 | static noinline int __invoke_psci_fn_hvc(u32 function_id, u32 arg0, u32 arg1, | ||
84 | u32 arg2) | ||
85 | { | ||
86 | asm volatile( | ||
87 | __asmeq("%0", "r0") | ||
88 | __asmeq("%1", "r1") | ||
89 | __asmeq("%2", "r2") | ||
90 | __asmeq("%3", "r3") | ||
91 | __HVC(0) | ||
92 | : "+r" (function_id) | ||
93 | : "r" (arg0), "r" (arg1), "r" (arg2)); | ||
94 | |||
95 | return function_id; | ||
96 | } | ||
97 | |||
98 | static noinline int __invoke_psci_fn_smc(u32 function_id, u32 arg0, u32 arg1, | ||
99 | u32 arg2) | ||
100 | { | ||
101 | asm volatile( | ||
102 | __asmeq("%0", "r0") | ||
103 | __asmeq("%1", "r1") | ||
104 | __asmeq("%2", "r2") | ||
105 | __asmeq("%3", "r3") | ||
106 | __SMC(0) | ||
107 | : "+r" (function_id) | ||
108 | : "r" (arg0), "r" (arg1), "r" (arg2)); | ||
109 | |||
110 | return function_id; | ||
111 | } | ||
112 | |||
113 | static int psci_cpu_suspend(struct psci_power_state state, | ||
114 | unsigned long entry_point) | ||
115 | { | ||
116 | int err; | ||
117 | u32 fn, power_state; | ||
118 | |||
119 | fn = psci_function_id[PSCI_FN_CPU_SUSPEND]; | ||
120 | power_state = psci_power_state_pack(state); | ||
121 | err = invoke_psci_fn(fn, power_state, entry_point, 0); | ||
122 | return psci_to_linux_errno(err); | ||
123 | } | ||
124 | |||
125 | static int psci_cpu_off(struct psci_power_state state) | ||
126 | { | ||
127 | int err; | ||
128 | u32 fn, power_state; | ||
129 | |||
130 | fn = psci_function_id[PSCI_FN_CPU_OFF]; | ||
131 | power_state = psci_power_state_pack(state); | ||
132 | err = invoke_psci_fn(fn, power_state, 0, 0); | ||
133 | return psci_to_linux_errno(err); | ||
134 | } | ||
135 | |||
136 | static int psci_cpu_on(unsigned long cpuid, unsigned long entry_point) | ||
137 | { | ||
138 | int err; | ||
139 | u32 fn; | ||
140 | |||
141 | fn = psci_function_id[PSCI_FN_CPU_ON]; | ||
142 | err = invoke_psci_fn(fn, cpuid, entry_point, 0); | ||
143 | return psci_to_linux_errno(err); | ||
144 | } | ||
145 | |||
146 | static int psci_migrate(unsigned long cpuid) | ||
147 | { | ||
148 | int err; | ||
149 | u32 fn; | ||
150 | |||
151 | fn = psci_function_id[PSCI_FN_MIGRATE]; | ||
152 | err = invoke_psci_fn(fn, cpuid, 0, 0); | ||
153 | return psci_to_linux_errno(err); | ||
154 | } | ||
155 | |||
156 | static const struct of_device_id psci_of_match[] __initconst = { | ||
157 | { .compatible = "arm,psci", }, | ||
158 | {}, | ||
159 | }; | ||
160 | |||
161 | static int __init psci_init(void) | ||
162 | { | ||
163 | struct device_node *np; | ||
164 | const char *method; | ||
165 | u32 id; | ||
166 | |||
167 | np = of_find_matching_node(NULL, psci_of_match); | ||
168 | if (!np) | ||
169 | return 0; | ||
170 | |||
171 | pr_info("probing function IDs from device-tree\n"); | ||
172 | |||
173 | if (of_property_read_string(np, "method", &method)) { | ||
174 | pr_warning("missing \"method\" property\n"); | ||
175 | goto out_put_node; | ||
176 | } | ||
177 | |||
178 | if (!strcmp("hvc", method)) { | ||
179 | invoke_psci_fn = __invoke_psci_fn_hvc; | ||
180 | } else if (!strcmp("smc", method)) { | ||
181 | invoke_psci_fn = __invoke_psci_fn_smc; | ||
182 | } else { | ||
183 | pr_warning("invalid \"method\" property: %s\n", method); | ||
184 | goto out_put_node; | ||
185 | } | ||
186 | |||
187 | if (!of_property_read_u32(np, "cpu_suspend", &id)) { | ||
188 | psci_function_id[PSCI_FN_CPU_SUSPEND] = id; | ||
189 | psci_ops.cpu_suspend = psci_cpu_suspend; | ||
190 | } | ||
191 | |||
192 | if (!of_property_read_u32(np, "cpu_off", &id)) { | ||
193 | psci_function_id[PSCI_FN_CPU_OFF] = id; | ||
194 | psci_ops.cpu_off = psci_cpu_off; | ||
195 | } | ||
196 | |||
197 | if (!of_property_read_u32(np, "cpu_on", &id)) { | ||
198 | psci_function_id[PSCI_FN_CPU_ON] = id; | ||
199 | psci_ops.cpu_on = psci_cpu_on; | ||
200 | } | ||
201 | |||
202 | if (!of_property_read_u32(np, "migrate", &id)) { | ||
203 | psci_function_id[PSCI_FN_MIGRATE] = id; | ||
204 | psci_ops.migrate = psci_migrate; | ||
205 | } | ||
206 | |||
207 | out_put_node: | ||
208 | of_node_put(np); | ||
209 | return 0; | ||
210 | } | ||
211 | early_initcall(psci_init); | ||
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 09be0c3c9069..955d92d265e5 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/timex.h> | 21 | #include <linux/timex.h> |
22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
23 | #include <linux/profile.h> | 23 | #include <linux/profile.h> |
24 | #include <linux/syscore_ops.h> | ||
25 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
26 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
27 | 26 | ||
@@ -31,11 +30,6 @@ | |||
31 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/time.h> | 31 | #include <asm/mach/time.h> |
33 | 32 | ||
34 | /* | ||
35 | * Our system timer. | ||
36 | */ | ||
37 | static struct sys_timer *system_timer; | ||
38 | |||
39 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \ | 33 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \ |
40 | defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) | 34 | defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) |
41 | /* this needs a better home */ | 35 | /* this needs a better home */ |
@@ -69,16 +63,6 @@ unsigned long profile_pc(struct pt_regs *regs) | |||
69 | EXPORT_SYMBOL(profile_pc); | 63 | EXPORT_SYMBOL(profile_pc); |
70 | #endif | 64 | #endif |
71 | 65 | ||
72 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | ||
73 | u32 arch_gettimeoffset(void) | ||
74 | { | ||
75 | if (system_timer->offset != NULL) | ||
76 | return system_timer->offset() * 1000; | ||
77 | |||
78 | return 0; | ||
79 | } | ||
80 | #endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */ | ||
81 | |||
82 | #ifndef CONFIG_GENERIC_CLOCKEVENTS | 66 | #ifndef CONFIG_GENERIC_CLOCKEVENTS |
83 | /* | 67 | /* |
84 | * Kernel system timer support. | 68 | * Kernel system timer support. |
@@ -129,43 +113,8 @@ int __init register_persistent_clock(clock_access_fn read_boot, | |||
129 | return -EINVAL; | 113 | return -EINVAL; |
130 | } | 114 | } |
131 | 115 | ||
132 | #if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS) | ||
133 | static int timer_suspend(void) | ||
134 | { | ||
135 | if (system_timer->suspend) | ||
136 | system_timer->suspend(); | ||
137 | |||
138 | return 0; | ||
139 | } | ||
140 | |||
141 | static void timer_resume(void) | ||
142 | { | ||
143 | if (system_timer->resume) | ||
144 | system_timer->resume(); | ||
145 | } | ||
146 | #else | ||
147 | #define timer_suspend NULL | ||
148 | #define timer_resume NULL | ||
149 | #endif | ||
150 | |||
151 | static struct syscore_ops timer_syscore_ops = { | ||
152 | .suspend = timer_suspend, | ||
153 | .resume = timer_resume, | ||
154 | }; | ||
155 | |||
156 | static int __init timer_init_syscore_ops(void) | ||
157 | { | ||
158 | register_syscore_ops(&timer_syscore_ops); | ||
159 | |||
160 | return 0; | ||
161 | } | ||
162 | |||
163 | device_initcall(timer_init_syscore_ops); | ||
164 | |||
165 | void __init time_init(void) | 116 | void __init time_init(void) |
166 | { | 117 | { |
167 | system_timer = machine_desc->timer; | 118 | machine_desc->init_time(); |
168 | system_timer->init(); | ||
169 | sched_clock_postinit(); | 119 | sched_clock_postinit(); |
170 | } | 120 | } |
171 | |||
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index cafe98836c8a..2acdff4c1dfe 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c | |||
@@ -174,7 +174,6 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev) | |||
174 | static struct clock_event_device clkevt = { | 174 | static struct clock_event_device clkevt = { |
175 | .name = "at91_tick", | 175 | .name = "at91_tick", |
176 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 176 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
177 | .shift = 32, | ||
178 | .rating = 150, | 177 | .rating = 150, |
179 | .set_next_event = clkevt32k_next_event, | 178 | .set_next_event = clkevt32k_next_event, |
180 | .set_mode = clkevt32k_mode, | 179 | .set_mode = clkevt32k_mode, |
@@ -265,17 +264,10 @@ void __init at91rm9200_timer_init(void) | |||
265 | at91_st_write(AT91_ST_RTMR, 1); | 264 | at91_st_write(AT91_ST_RTMR, 1); |
266 | 265 | ||
267 | /* Setup timer clockevent, with minimum of two ticks (important!!) */ | 266 | /* Setup timer clockevent, with minimum of two ticks (important!!) */ |
268 | clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift); | ||
269 | clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt); | ||
270 | clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1; | ||
271 | clkevt.cpumask = cpumask_of(0); | 267 | clkevt.cpumask = cpumask_of(0); |
272 | clockevents_register_device(&clkevt); | 268 | clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK, |
269 | 2, AT91_ST_ALMV); | ||
273 | 270 | ||
274 | /* register clocksource */ | 271 | /* register clocksource */ |
275 | clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); | 272 | clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); |
276 | } | 273 | } |
277 | |||
278 | struct sys_timer at91rm9200_timer = { | ||
279 | .init = at91rm9200_timer_init, | ||
280 | }; | ||
281 | |||
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c index 358412f1f5f8..3a4bc2e1a65e 100644 --- a/arch/arm/mach-at91/at91sam926x_time.c +++ b/arch/arm/mach-at91/at91sam926x_time.c | |||
@@ -104,12 +104,38 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev) | |||
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | static void at91sam926x_pit_suspend(struct clock_event_device *cedev) | ||
108 | { | ||
109 | /* Disable timer */ | ||
110 | pit_write(AT91_PIT_MR, 0); | ||
111 | } | ||
112 | |||
113 | static void at91sam926x_pit_reset(void) | ||
114 | { | ||
115 | /* Disable timer and irqs */ | ||
116 | pit_write(AT91_PIT_MR, 0); | ||
117 | |||
118 | /* Clear any pending interrupts, wait for PIT to stop counting */ | ||
119 | while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0) | ||
120 | cpu_relax(); | ||
121 | |||
122 | /* Start PIT but don't enable IRQ */ | ||
123 | pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); | ||
124 | } | ||
125 | |||
126 | static void at91sam926x_pit_resume(struct clock_event_device *cedev) | ||
127 | { | ||
128 | at91sam926x_pit_reset(); | ||
129 | } | ||
130 | |||
107 | static struct clock_event_device pit_clkevt = { | 131 | static struct clock_event_device pit_clkevt = { |
108 | .name = "pit", | 132 | .name = "pit", |
109 | .features = CLOCK_EVT_FEAT_PERIODIC, | 133 | .features = CLOCK_EVT_FEAT_PERIODIC, |
110 | .shift = 32, | 134 | .shift = 32, |
111 | .rating = 100, | 135 | .rating = 100, |
112 | .set_mode = pit_clkevt_mode, | 136 | .set_mode = pit_clkevt_mode, |
137 | .suspend = at91sam926x_pit_suspend, | ||
138 | .resume = at91sam926x_pit_resume, | ||
113 | }; | 139 | }; |
114 | 140 | ||
115 | 141 | ||
@@ -150,19 +176,6 @@ static struct irqaction at91sam926x_pit_irq = { | |||
150 | .irq = NR_IRQS_LEGACY + AT91_ID_SYS, | 176 | .irq = NR_IRQS_LEGACY + AT91_ID_SYS, |
151 | }; | 177 | }; |
152 | 178 | ||
153 | static void at91sam926x_pit_reset(void) | ||
154 | { | ||
155 | /* Disable timer and irqs */ | ||
156 | pit_write(AT91_PIT_MR, 0); | ||
157 | |||
158 | /* Clear any pending interrupts, wait for PIT to stop counting */ | ||
159 | while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0) | ||
160 | cpu_relax(); | ||
161 | |||
162 | /* Start PIT but don't enable IRQ */ | ||
163 | pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); | ||
164 | } | ||
165 | |||
166 | #ifdef CONFIG_OF | 179 | #ifdef CONFIG_OF |
167 | static struct of_device_id pit_timer_ids[] = { | 180 | static struct of_device_id pit_timer_ids[] = { |
168 | { .compatible = "atmel,at91sam9260-pit" }, | 181 | { .compatible = "atmel,at91sam9260-pit" }, |
@@ -211,7 +224,7 @@ static int __init of_at91sam926x_pit_init(void) | |||
211 | /* | 224 | /* |
212 | * Set up both clocksource and clockevent support. | 225 | * Set up both clocksource and clockevent support. |
213 | */ | 226 | */ |
214 | static void __init at91sam926x_pit_init(void) | 227 | void __init at91sam926x_pit_init(void) |
215 | { | 228 | { |
216 | unsigned long pit_rate; | 229 | unsigned long pit_rate; |
217 | unsigned bits; | 230 | unsigned bits; |
@@ -250,12 +263,6 @@ static void __init at91sam926x_pit_init(void) | |||
250 | clockevents_register_device(&pit_clkevt); | 263 | clockevents_register_device(&pit_clkevt); |
251 | } | 264 | } |
252 | 265 | ||
253 | static void at91sam926x_pit_suspend(void) | ||
254 | { | ||
255 | /* Disable timer */ | ||
256 | pit_write(AT91_PIT_MR, 0); | ||
257 | } | ||
258 | |||
259 | void __init at91sam926x_ioremap_pit(u32 addr) | 266 | void __init at91sam926x_ioremap_pit(u32 addr) |
260 | { | 267 | { |
261 | #if defined(CONFIG_OF) | 268 | #if defined(CONFIG_OF) |
@@ -272,9 +279,3 @@ void __init at91sam926x_ioremap_pit(u32 addr) | |||
272 | if (!pit_base_addr) | 279 | if (!pit_base_addr) |
273 | panic("Impossible to ioremap PIT\n"); | 280 | panic("Impossible to ioremap PIT\n"); |
274 | } | 281 | } |
275 | |||
276 | struct sys_timer at91sam926x_timer = { | ||
277 | .init = at91sam926x_pit_init, | ||
278 | .suspend = at91sam926x_pit_suspend, | ||
279 | .resume = at91sam926x_pit_reset, | ||
280 | }; | ||
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c index 0e57e440c061..0c07a4459cb2 100644 --- a/arch/arm/mach-at91/at91x40_time.c +++ b/arch/arm/mach-at91/at91x40_time.c | |||
@@ -42,9 +42,10 @@ | |||
42 | #define AT91_TC_CLK1BASE 0x40 | 42 | #define AT91_TC_CLK1BASE 0x40 |
43 | #define AT91_TC_CLK2BASE 0x80 | 43 | #define AT91_TC_CLK2BASE 0x80 |
44 | 44 | ||
45 | static unsigned long at91x40_gettimeoffset(void) | 45 | static u32 at91x40_gettimeoffset(void) |
46 | { | 46 | { |
47 | return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128)); | 47 | return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / |
48 | (AT91X40_MASTER_CLOCK / 128)) * 1000; | ||
48 | } | 49 | } |
49 | 50 | ||
50 | static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) | 51 | static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) |
@@ -64,6 +65,8 @@ void __init at91x40_timer_init(void) | |||
64 | { | 65 | { |
65 | unsigned int v; | 66 | unsigned int v; |
66 | 67 | ||
68 | arch_gettimeoffset = at91x40_gettimeoffset; | ||
69 | |||
67 | at91_tc_write(AT91_TC_BCR, 0); | 70 | at91_tc_write(AT91_TC_BCR, 0); |
68 | v = at91_tc_read(AT91_TC_BMR); | 71 | v = at91_tc_read(AT91_TC_BMR); |
69 | v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE; | 72 | v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE; |
@@ -79,9 +82,3 @@ void __init at91x40_timer_init(void) | |||
79 | 82 | ||
80 | at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN)); | 83 | at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN)); |
81 | } | 84 | } |
82 | |||
83 | struct sys_timer at91x40_timer = { | ||
84 | .init = at91x40_timer_init, | ||
85 | .offset = at91x40_gettimeoffset, | ||
86 | }; | ||
87 | |||
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c index b99b5752cc10..35ab632bbf68 100644 --- a/arch/arm/mach-at91/board-1arm.c +++ b/arch/arm/mach-at91/board-1arm.c | |||
@@ -90,7 +90,7 @@ static void __init onearm_board_init(void) | |||
90 | 90 | ||
91 | MACHINE_START(ONEARM, "Ajeco 1ARM single board computer") | 91 | MACHINE_START(ONEARM, "Ajeco 1ARM single board computer") |
92 | /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ | 92 | /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ |
93 | .timer = &at91rm9200_timer, | 93 | .init_time = at91rm9200_timer_init, |
94 | .map_io = at91_map_io, | 94 | .map_io = at91_map_io, |
95 | .handle_irq = at91_aic_handle_irq, | 95 | .handle_irq = at91_aic_handle_irq, |
96 | .init_early = onearm_init_early, | 96 | .init_early = onearm_init_early, |
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c index 854b97974287..f95e31cda4b3 100644 --- a/arch/arm/mach-at91/board-afeb-9260v1.c +++ b/arch/arm/mach-at91/board-afeb-9260v1.c | |||
@@ -210,7 +210,7 @@ static void __init afeb9260_board_init(void) | |||
210 | 210 | ||
211 | MACHINE_START(AFEB9260, "Custom afeb9260 board") | 211 | MACHINE_START(AFEB9260, "Custom afeb9260 board") |
212 | /* Maintainer: Sergey Lapin <slapin@ossfans.org> */ | 212 | /* Maintainer: Sergey Lapin <slapin@ossfans.org> */ |
213 | .timer = &at91sam926x_timer, | 213 | .init_time = at91sam926x_pit_init, |
214 | .map_io = at91_map_io, | 214 | .map_io = at91_map_io, |
215 | .handle_irq = at91_aic_handle_irq, | 215 | .handle_irq = at91_aic_handle_irq, |
216 | .init_early = afeb9260_init_early, | 216 | .init_early = afeb9260_init_early, |
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c index 28a18ce6d914..ade948b82662 100644 --- a/arch/arm/mach-at91/board-cam60.c +++ b/arch/arm/mach-at91/board-cam60.c | |||
@@ -187,7 +187,7 @@ static void __init cam60_board_init(void) | |||
187 | 187 | ||
188 | MACHINE_START(CAM60, "KwikByte CAM60") | 188 | MACHINE_START(CAM60, "KwikByte CAM60") |
189 | /* Maintainer: KwikByte */ | 189 | /* Maintainer: KwikByte */ |
190 | .timer = &at91sam926x_timer, | 190 | .init_time = at91sam926x_pit_init, |
191 | .map_io = at91_map_io, | 191 | .map_io = at91_map_io, |
192 | .handle_irq = at91_aic_handle_irq, | 192 | .handle_irq = at91_aic_handle_irq, |
193 | .init_early = cam60_init_early, | 193 | .init_early = cam60_init_early, |
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c index c17bb533a949..92983050a9bd 100644 --- a/arch/arm/mach-at91/board-carmeva.c +++ b/arch/arm/mach-at91/board-carmeva.c | |||
@@ -157,7 +157,7 @@ static void __init carmeva_board_init(void) | |||
157 | 157 | ||
158 | MACHINE_START(CARMEVA, "Carmeva") | 158 | MACHINE_START(CARMEVA, "Carmeva") |
159 | /* Maintainer: Conitec Datasystems */ | 159 | /* Maintainer: Conitec Datasystems */ |
160 | .timer = &at91rm9200_timer, | 160 | .init_time = at91rm9200_timer_init, |
161 | .map_io = at91_map_io, | 161 | .map_io = at91_map_io, |
162 | .handle_irq = at91_aic_handle_irq, | 162 | .handle_irq = at91_aic_handle_irq, |
163 | .init_early = carmeva_init_early, | 163 | .init_early = carmeva_init_early, |
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c index 847432441ecc..008527efdbcf 100644 --- a/arch/arm/mach-at91/board-cpu9krea.c +++ b/arch/arm/mach-at91/board-cpu9krea.c | |||
@@ -374,7 +374,7 @@ MACHINE_START(CPUAT9260, "Eukrea CPU9260") | |||
374 | MACHINE_START(CPUAT9G20, "Eukrea CPU9G20") | 374 | MACHINE_START(CPUAT9G20, "Eukrea CPU9G20") |
375 | #endif | 375 | #endif |
376 | /* Maintainer: Eric Benard - EUKREA Electromatique */ | 376 | /* Maintainer: Eric Benard - EUKREA Electromatique */ |
377 | .timer = &at91sam926x_timer, | 377 | .init_time = at91sam926x_pit_init, |
378 | .map_io = at91_map_io, | 378 | .map_io = at91_map_io, |
379 | .handle_irq = at91_aic_handle_irq, | 379 | .handle_irq = at91_aic_handle_irq, |
380 | .init_early = cpu9krea_init_early, | 380 | .init_early = cpu9krea_init_early, |
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c index 2a7af7868747..42f1353a4baf 100644 --- a/arch/arm/mach-at91/board-cpuat91.c +++ b/arch/arm/mach-at91/board-cpuat91.c | |||
@@ -178,7 +178,7 @@ static void __init cpuat91_board_init(void) | |||
178 | 178 | ||
179 | MACHINE_START(CPUAT91, "Eukrea") | 179 | MACHINE_START(CPUAT91, "Eukrea") |
180 | /* Maintainer: Eric Benard - EUKREA Electromatique */ | 180 | /* Maintainer: Eric Benard - EUKREA Electromatique */ |
181 | .timer = &at91rm9200_timer, | 181 | .init_time = at91rm9200_timer_init, |
182 | .map_io = at91_map_io, | 182 | .map_io = at91_map_io, |
183 | .handle_irq = at91_aic_handle_irq, | 183 | .handle_irq = at91_aic_handle_irq, |
184 | .init_early = cpuat91_init_early, | 184 | .init_early = cpuat91_init_early, |
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c index 48a531e05be3..e5fde215225b 100644 --- a/arch/arm/mach-at91/board-csb337.c +++ b/arch/arm/mach-at91/board-csb337.c | |||
@@ -251,7 +251,7 @@ static void __init csb337_board_init(void) | |||
251 | 251 | ||
252 | MACHINE_START(CSB337, "Cogent CSB337") | 252 | MACHINE_START(CSB337, "Cogent CSB337") |
253 | /* Maintainer: Bill Gatliff */ | 253 | /* Maintainer: Bill Gatliff */ |
254 | .timer = &at91rm9200_timer, | 254 | .init_time = at91rm9200_timer_init, |
255 | .map_io = at91_map_io, | 255 | .map_io = at91_map_io, |
256 | .handle_irq = at91_aic_handle_irq, | 256 | .handle_irq = at91_aic_handle_irq, |
257 | .init_early = csb337_init_early, | 257 | .init_early = csb337_init_early, |
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c index ec0f3abd504b..fdf11061c577 100644 --- a/arch/arm/mach-at91/board-csb637.c +++ b/arch/arm/mach-at91/board-csb637.c | |||
@@ -132,7 +132,7 @@ static void __init csb637_board_init(void) | |||
132 | 132 | ||
133 | MACHINE_START(CSB637, "Cogent CSB637") | 133 | MACHINE_START(CSB637, "Cogent CSB637") |
134 | /* Maintainer: Bill Gatliff */ | 134 | /* Maintainer: Bill Gatliff */ |
135 | .timer = &at91rm9200_timer, | 135 | .init_time = at91rm9200_timer_init, |
136 | .map_io = at91_map_io, | 136 | .map_io = at91_map_io, |
137 | .handle_irq = at91_aic_handle_irq, | 137 | .handle_irq = at91_aic_handle_irq, |
138 | .init_early = csb637_init_early, | 138 | .init_early = csb637_init_early, |
diff --git a/arch/arm/mach-at91/board-dt.c b/arch/arm/mach-at91/board-dt.c index 881170ce61dd..8db30132abed 100644 --- a/arch/arm/mach-at91/board-dt.c +++ b/arch/arm/mach-at91/board-dt.c | |||
@@ -49,7 +49,7 @@ static const char *at91_dt_board_compat[] __initdata = { | |||
49 | 49 | ||
50 | DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") | 50 | DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") |
51 | /* Maintainer: Atmel */ | 51 | /* Maintainer: Atmel */ |
52 | .timer = &at91sam926x_timer, | 52 | .init_time = at91sam926x_pit_init, |
53 | .map_io = at91_map_io, | 53 | .map_io = at91_map_io, |
54 | .handle_irq = at91_aic_handle_irq, | 54 | .handle_irq = at91_aic_handle_irq, |
55 | .init_early = at91_dt_initialize, | 55 | .init_early = at91_dt_initialize, |
diff --git a/arch/arm/mach-at91/board-eb01.c b/arch/arm/mach-at91/board-eb01.c index b489388a6f84..becf0a6a289e 100644 --- a/arch/arm/mach-at91/board-eb01.c +++ b/arch/arm/mach-at91/board-eb01.c | |||
@@ -44,7 +44,7 @@ static void __init at91eb01_init_early(void) | |||
44 | 44 | ||
45 | MACHINE_START(AT91EB01, "Atmel AT91 EB01") | 45 | MACHINE_START(AT91EB01, "Atmel AT91 EB01") |
46 | /* Maintainer: Greg Ungerer <gerg@snapgear.com> */ | 46 | /* Maintainer: Greg Ungerer <gerg@snapgear.com> */ |
47 | .timer = &at91x40_timer, | 47 | .init_time = at91x40_timer_init, |
48 | .handle_irq = at91_aic_handle_irq, | 48 | .handle_irq = at91_aic_handle_irq, |
49 | .init_early = at91eb01_init_early, | 49 | .init_early = at91eb01_init_early, |
50 | .init_irq = at91eb01_init_irq, | 50 | .init_irq = at91eb01_init_irq, |
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c index 9f5e71c95f05..f9be8161bbfa 100644 --- a/arch/arm/mach-at91/board-eb9200.c +++ b/arch/arm/mach-at91/board-eb9200.c | |||
@@ -116,7 +116,7 @@ static void __init eb9200_board_init(void) | |||
116 | } | 116 | } |
117 | 117 | ||
118 | MACHINE_START(ATEB9200, "Embest ATEB9200") | 118 | MACHINE_START(ATEB9200, "Embest ATEB9200") |
119 | .timer = &at91rm9200_timer, | 119 | .init_time = at91rm9200_timer_init, |
120 | .map_io = at91_map_io, | 120 | .map_io = at91_map_io, |
121 | .handle_irq = at91_aic_handle_irq, | 121 | .handle_irq = at91_aic_handle_irq, |
122 | .init_early = eb9200_init_early, | 122 | .init_early = eb9200_init_early, |
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c index ef69e0ebe949..b2fcd71262ba 100644 --- a/arch/arm/mach-at91/board-ecbat91.c +++ b/arch/arm/mach-at91/board-ecbat91.c | |||
@@ -181,7 +181,7 @@ static void __init ecb_at91board_init(void) | |||
181 | 181 | ||
182 | MACHINE_START(ECBAT91, "emQbit's ECB_AT91") | 182 | MACHINE_START(ECBAT91, "emQbit's ECB_AT91") |
183 | /* Maintainer: emQbit.com */ | 183 | /* Maintainer: emQbit.com */ |
184 | .timer = &at91rm9200_timer, | 184 | .init_time = at91rm9200_timer_init, |
185 | .map_io = at91_map_io, | 185 | .map_io = at91_map_io, |
186 | .handle_irq = at91_aic_handle_irq, | 186 | .handle_irq = at91_aic_handle_irq, |
187 | .init_early = ecb_at91init_early, | 187 | .init_early = ecb_at91init_early, |
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c index 50f3d3795c05..77de410efc90 100644 --- a/arch/arm/mach-at91/board-eco920.c +++ b/arch/arm/mach-at91/board-eco920.c | |||
@@ -149,7 +149,7 @@ static void __init eco920_board_init(void) | |||
149 | 149 | ||
150 | MACHINE_START(ECO920, "eco920") | 150 | MACHINE_START(ECO920, "eco920") |
151 | /* Maintainer: Sascha Hauer */ | 151 | /* Maintainer: Sascha Hauer */ |
152 | .timer = &at91rm9200_timer, | 152 | .init_time = at91rm9200_timer_init, |
153 | .map_io = at91_map_io, | 153 | .map_io = at91_map_io, |
154 | .handle_irq = at91_aic_handle_irq, | 154 | .handle_irq = at91_aic_handle_irq, |
155 | .init_early = eco920_init_early, | 155 | .init_early = eco920_init_early, |
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c index 5d44eba0f20f..737c08563628 100644 --- a/arch/arm/mach-at91/board-flexibity.c +++ b/arch/arm/mach-at91/board-flexibity.c | |||
@@ -159,7 +159,7 @@ static void __init flexibity_board_init(void) | |||
159 | 159 | ||
160 | MACHINE_START(FLEXIBITY, "Flexibity Connect") | 160 | MACHINE_START(FLEXIBITY, "Flexibity Connect") |
161 | /* Maintainer: Maxim Osipov */ | 161 | /* Maintainer: Maxim Osipov */ |
162 | .timer = &at91sam926x_timer, | 162 | .init_time = at91sam926x_pit_init, |
163 | .map_io = at91_map_io, | 163 | .map_io = at91_map_io, |
164 | .handle_irq = at91_aic_handle_irq, | 164 | .handle_irq = at91_aic_handle_irq, |
165 | .init_early = flexibity_init_early, | 165 | .init_early = flexibity_init_early, |
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c index 191d37c16bab..2ea7059b840b 100644 --- a/arch/arm/mach-at91/board-foxg20.c +++ b/arch/arm/mach-at91/board-foxg20.c | |||
@@ -261,7 +261,7 @@ static void __init foxg20_board_init(void) | |||
261 | 261 | ||
262 | MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20") | 262 | MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20") |
263 | /* Maintainer: Sergio Tanzilli */ | 263 | /* Maintainer: Sergio Tanzilli */ |
264 | .timer = &at91sam926x_timer, | 264 | .init_time = at91sam926x_pit_init, |
265 | .map_io = at91_map_io, | 265 | .map_io = at91_map_io, |
266 | .handle_irq = at91_aic_handle_irq, | 266 | .handle_irq = at91_aic_handle_irq, |
267 | .init_early = foxg20_init_early, | 267 | .init_early = foxg20_init_early, |
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c index 23a2fa17ab29..c1d61d247790 100644 --- a/arch/arm/mach-at91/board-gsia18s.c +++ b/arch/arm/mach-at91/board-gsia18s.c | |||
@@ -574,7 +574,7 @@ static void __init gsia18s_board_init(void) | |||
574 | } | 574 | } |
575 | 575 | ||
576 | MACHINE_START(GSIA18S, "GS_IA18_S") | 576 | MACHINE_START(GSIA18S, "GS_IA18_S") |
577 | .timer = &at91sam926x_timer, | 577 | .init_time = at91sam926x_pit_init, |
578 | .map_io = at91_map_io, | 578 | .map_io = at91_map_io, |
579 | .handle_irq = at91_aic_handle_irq, | 579 | .handle_irq = at91_aic_handle_irq, |
580 | .init_early = gsia18s_init_early, | 580 | .init_early = gsia18s_init_early, |
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c index 9a43d1e1a037..88e2f5d2d16d 100644 --- a/arch/arm/mach-at91/board-kafa.c +++ b/arch/arm/mach-at91/board-kafa.c | |||
@@ -103,7 +103,7 @@ static void __init kafa_board_init(void) | |||
103 | 103 | ||
104 | MACHINE_START(KAFA, "Sperry-Sun KAFA") | 104 | MACHINE_START(KAFA, "Sperry-Sun KAFA") |
105 | /* Maintainer: Sergei Sharonov */ | 105 | /* Maintainer: Sergei Sharonov */ |
106 | .timer = &at91rm9200_timer, | 106 | .init_time = at91rm9200_timer_init, |
107 | .map_io = at91_map_io, | 107 | .map_io = at91_map_io, |
108 | .handle_irq = at91_aic_handle_irq, | 108 | .handle_irq = at91_aic_handle_irq, |
109 | .init_early = kafa_init_early, | 109 | .init_early = kafa_init_early, |
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c index f168bec2369f..0c519d9ebffc 100644 --- a/arch/arm/mach-at91/board-kb9202.c +++ b/arch/arm/mach-at91/board-kb9202.c | |||
@@ -149,7 +149,7 @@ static void __init kb9202_board_init(void) | |||
149 | 149 | ||
150 | MACHINE_START(KB9200, "KB920x") | 150 | MACHINE_START(KB9200, "KB920x") |
151 | /* Maintainer: KwikByte, Inc. */ | 151 | /* Maintainer: KwikByte, Inc. */ |
152 | .timer = &at91rm9200_timer, | 152 | .init_time = at91rm9200_timer_init, |
153 | .map_io = at91_map_io, | 153 | .map_io = at91_map_io, |
154 | .handle_irq = at91_aic_handle_irq, | 154 | .handle_irq = at91_aic_handle_irq, |
155 | .init_early = kb9202_init_early, | 155 | .init_early = kb9202_init_early, |
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c index bc7a1c4a1f6a..5b4760fe53de 100644 --- a/arch/arm/mach-at91/board-neocore926.c +++ b/arch/arm/mach-at91/board-neocore926.c | |||
@@ -378,7 +378,7 @@ static void __init neocore926_board_init(void) | |||
378 | 378 | ||
379 | MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926") | 379 | MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926") |
380 | /* Maintainer: ADENEO */ | 380 | /* Maintainer: ADENEO */ |
381 | .timer = &at91sam926x_timer, | 381 | .init_time = at91sam926x_pit_init, |
382 | .map_io = at91_map_io, | 382 | .map_io = at91_map_io, |
383 | .handle_irq = at91_aic_handle_irq, | 383 | .handle_irq = at91_aic_handle_irq, |
384 | .init_early = neocore926_init_early, | 384 | .init_early = neocore926_init_early, |
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c index 0299554495dd..65c0d6b5ecba 100644 --- a/arch/arm/mach-at91/board-pcontrol-g20.c +++ b/arch/arm/mach-at91/board-pcontrol-g20.c | |||
@@ -217,7 +217,7 @@ static void __init pcontrol_g20_board_init(void) | |||
217 | 217 | ||
218 | MACHINE_START(PCONTROL_G20, "PControl G20") | 218 | MACHINE_START(PCONTROL_G20, "PControl G20") |
219 | /* Maintainer: pgsellmann@portner-elektronik.at */ | 219 | /* Maintainer: pgsellmann@portner-elektronik.at */ |
220 | .timer = &at91sam926x_timer, | 220 | .init_time = at91sam926x_pit_init, |
221 | .map_io = at91_map_io, | 221 | .map_io = at91_map_io, |
222 | .handle_irq = at91_aic_handle_irq, | 222 | .handle_irq = at91_aic_handle_irq, |
223 | .init_early = pcontrol_g20_init_early, | 223 | .init_early = pcontrol_g20_init_early, |
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c index 4938f1cd5e13..ab2b2ec36c14 100644 --- a/arch/arm/mach-at91/board-picotux200.c +++ b/arch/arm/mach-at91/board-picotux200.c | |||
@@ -119,7 +119,7 @@ static void __init picotux200_board_init(void) | |||
119 | 119 | ||
120 | MACHINE_START(PICOTUX2XX, "picotux 200") | 120 | MACHINE_START(PICOTUX2XX, "picotux 200") |
121 | /* Maintainer: Kleinhenz Elektronik GmbH */ | 121 | /* Maintainer: Kleinhenz Elektronik GmbH */ |
122 | .timer = &at91rm9200_timer, | 122 | .init_time = at91rm9200_timer_init, |
123 | .map_io = at91_map_io, | 123 | .map_io = at91_map_io, |
124 | .handle_irq = at91_aic_handle_irq, | 124 | .handle_irq = at91_aic_handle_irq, |
125 | .init_early = picotux200_init_early, | 125 | .init_early = picotux200_init_early, |
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c index 33b1628467ea..aa3bc9b0f150 100644 --- a/arch/arm/mach-at91/board-qil-a9260.c +++ b/arch/arm/mach-at91/board-qil-a9260.c | |||
@@ -257,7 +257,7 @@ static void __init ek_board_init(void) | |||
257 | 257 | ||
258 | MACHINE_START(QIL_A9260, "CALAO QIL_A9260") | 258 | MACHINE_START(QIL_A9260, "CALAO QIL_A9260") |
259 | /* Maintainer: calao-systems */ | 259 | /* Maintainer: calao-systems */ |
260 | .timer = &at91sam926x_timer, | 260 | .init_time = at91sam926x_pit_init, |
261 | .map_io = at91_map_io, | 261 | .map_io = at91_map_io, |
262 | .handle_irq = at91_aic_handle_irq, | 262 | .handle_irq = at91_aic_handle_irq, |
263 | .init_early = ek_init_early, | 263 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-rm9200-dt.c b/arch/arm/mach-at91/board-rm9200-dt.c index 5f9ce3da3fde..3fcb6623a33e 100644 --- a/arch/arm/mach-at91/board-rm9200-dt.c +++ b/arch/arm/mach-at91/board-rm9200-dt.c | |||
@@ -47,7 +47,7 @@ static const char *at91rm9200_dt_board_compat[] __initdata = { | |||
47 | }; | 47 | }; |
48 | 48 | ||
49 | DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)") | 49 | DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)") |
50 | .timer = &at91rm9200_timer, | 50 | .init_time = at91rm9200_timer_init, |
51 | .map_io = at91_map_io, | 51 | .map_io = at91_map_io, |
52 | .handle_irq = at91_aic_handle_irq, | 52 | .handle_irq = at91_aic_handle_irq, |
53 | .init_early = at91rm9200_dt_initialize, | 53 | .init_early = at91rm9200_dt_initialize, |
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c index 9e5061bef0d0..690541b18cbc 100644 --- a/arch/arm/mach-at91/board-rm9200dk.c +++ b/arch/arm/mach-at91/board-rm9200dk.c | |||
@@ -219,7 +219,7 @@ static void __init dk_board_init(void) | |||
219 | 219 | ||
220 | MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK") | 220 | MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK") |
221 | /* Maintainer: SAN People/Atmel */ | 221 | /* Maintainer: SAN People/Atmel */ |
222 | .timer = &at91rm9200_timer, | 222 | .init_time = at91rm9200_timer_init, |
223 | .map_io = at91_map_io, | 223 | .map_io = at91_map_io, |
224 | .handle_irq = at91_aic_handle_irq, | 224 | .handle_irq = at91_aic_handle_irq, |
225 | .init_early = dk_init_early, | 225 | .init_early = dk_init_early, |
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c index 58277dbc718f..8b17dadc1aba 100644 --- a/arch/arm/mach-at91/board-rm9200ek.c +++ b/arch/arm/mach-at91/board-rm9200ek.c | |||
@@ -186,7 +186,7 @@ static void __init ek_board_init(void) | |||
186 | 186 | ||
187 | MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK") | 187 | MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK") |
188 | /* Maintainer: SAN People/Atmel */ | 188 | /* Maintainer: SAN People/Atmel */ |
189 | .timer = &at91rm9200_timer, | 189 | .init_time = at91rm9200_timer_init, |
190 | .map_io = at91_map_io, | 190 | .map_io = at91_map_io, |
191 | .handle_irq = at91_aic_handle_irq, | 191 | .handle_irq = at91_aic_handle_irq, |
192 | .init_early = ek_init_early, | 192 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-rsi-ews.c b/arch/arm/mach-at91/board-rsi-ews.c index 2e8b8339a206..f6d7f1958c7e 100644 --- a/arch/arm/mach-at91/board-rsi-ews.c +++ b/arch/arm/mach-at91/board-rsi-ews.c | |||
@@ -222,7 +222,7 @@ static void __init rsi_ews_board_init(void) | |||
222 | 222 | ||
223 | MACHINE_START(RSI_EWS, "RSI EWS") | 223 | MACHINE_START(RSI_EWS, "RSI EWS") |
224 | /* Maintainer: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de> */ | 224 | /* Maintainer: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de> */ |
225 | .timer = &at91rm9200_timer, | 225 | .init_time = at91rm9200_timer_init, |
226 | .map_io = at91_map_io, | 226 | .map_io = at91_map_io, |
227 | .handle_irq = at91_aic_handle_irq, | 227 | .handle_irq = at91_aic_handle_irq, |
228 | .init_early = rsi_ews_init_early, | 228 | .init_early = rsi_ews_init_early, |
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c index b75fbf6003a1..43ee4dc43b50 100644 --- a/arch/arm/mach-at91/board-sam9-l9260.c +++ b/arch/arm/mach-at91/board-sam9-l9260.c | |||
@@ -218,7 +218,7 @@ static void __init ek_board_init(void) | |||
218 | 218 | ||
219 | MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260") | 219 | MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260") |
220 | /* Maintainer: Olimex */ | 220 | /* Maintainer: Olimex */ |
221 | .timer = &at91sam926x_timer, | 221 | .init_time = at91sam926x_pit_init, |
222 | .map_io = at91_map_io, | 222 | .map_io = at91_map_io, |
223 | .handle_irq = at91_aic_handle_irq, | 223 | .handle_irq = at91_aic_handle_irq, |
224 | .init_early = ek_init_early, | 224 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c index f0135cd1d858..0b153c87521d 100644 --- a/arch/arm/mach-at91/board-sam9260ek.c +++ b/arch/arm/mach-at91/board-sam9260ek.c | |||
@@ -343,7 +343,7 @@ static void __init ek_board_init(void) | |||
343 | 343 | ||
344 | MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") | 344 | MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") |
345 | /* Maintainer: Atmel */ | 345 | /* Maintainer: Atmel */ |
346 | .timer = &at91sam926x_timer, | 346 | .init_time = at91sam926x_pit_init, |
347 | .map_io = at91_map_io, | 347 | .map_io = at91_map_io, |
348 | .handle_irq = at91_aic_handle_irq, | 348 | .handle_irq = at91_aic_handle_irq, |
349 | .init_early = ek_init_early, | 349 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 13ebaa8e4100..b446645c7727 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c | |||
@@ -612,7 +612,7 @@ MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK") | |||
612 | MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK") | 612 | MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK") |
613 | #endif | 613 | #endif |
614 | /* Maintainer: Atmel */ | 614 | /* Maintainer: Atmel */ |
615 | .timer = &at91sam926x_timer, | 615 | .init_time = at91sam926x_pit_init, |
616 | .map_io = at91_map_io, | 616 | .map_io = at91_map_io, |
617 | .handle_irq = at91_aic_handle_irq, | 617 | .handle_irq = at91_aic_handle_irq, |
618 | .init_early = ek_init_early, | 618 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 89b9608742a7..3284df05df14 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -443,7 +443,7 @@ static void __init ek_board_init(void) | |||
443 | 443 | ||
444 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") | 444 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") |
445 | /* Maintainer: Atmel */ | 445 | /* Maintainer: Atmel */ |
446 | .timer = &at91sam926x_timer, | 446 | .init_time = at91sam926x_pit_init, |
447 | .map_io = at91_map_io, | 447 | .map_io = at91_map_io, |
448 | .handle_irq = at91_aic_handle_irq, | 448 | .handle_irq = at91_aic_handle_irq, |
449 | .init_early = ek_init_early, | 449 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c index 1b7dd9f688d3..f9cd1f2c7146 100644 --- a/arch/arm/mach-at91/board-sam9g20ek.c +++ b/arch/arm/mach-at91/board-sam9g20ek.c | |||
@@ -409,7 +409,7 @@ static void __init ek_board_init(void) | |||
409 | 409 | ||
410 | MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") | 410 | MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") |
411 | /* Maintainer: Atmel */ | 411 | /* Maintainer: Atmel */ |
412 | .timer = &at91sam926x_timer, | 412 | .init_time = at91sam926x_pit_init, |
413 | .map_io = at91_map_io, | 413 | .map_io = at91_map_io, |
414 | .handle_irq = at91_aic_handle_irq, | 414 | .handle_irq = at91_aic_handle_irq, |
415 | .init_early = ek_init_early, | 415 | .init_early = ek_init_early, |
@@ -419,7 +419,7 @@ MACHINE_END | |||
419 | 419 | ||
420 | MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") | 420 | MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") |
421 | /* Maintainer: Atmel */ | 421 | /* Maintainer: Atmel */ |
422 | .timer = &at91sam926x_timer, | 422 | .init_time = at91sam926x_pit_init, |
423 | .map_io = at91_map_io, | 423 | .map_io = at91_map_io, |
424 | .handle_irq = at91_aic_handle_irq, | 424 | .handle_irq = at91_aic_handle_irq, |
425 | .init_early = ek_init_early, | 425 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index e4cc375e3a32..2a94896a1375 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c | |||
@@ -502,7 +502,7 @@ static void __init ek_board_init(void) | |||
502 | 502 | ||
503 | MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK") | 503 | MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK") |
504 | /* Maintainer: Atmel */ | 504 | /* Maintainer: Atmel */ |
505 | .timer = &at91sam926x_timer, | 505 | .init_time = at91sam926x_pit_init, |
506 | .map_io = at91_map_io, | 506 | .map_io = at91_map_io, |
507 | .handle_irq = at91_aic_handle_irq, | 507 | .handle_irq = at91_aic_handle_irq, |
508 | .init_early = ek_init_early, | 508 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c index 377a1097afa7..aa265dcf2128 100644 --- a/arch/arm/mach-at91/board-sam9rlek.c +++ b/arch/arm/mach-at91/board-sam9rlek.c | |||
@@ -320,7 +320,7 @@ static void __init ek_board_init(void) | |||
320 | 320 | ||
321 | MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK") | 321 | MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK") |
322 | /* Maintainer: Atmel */ | 322 | /* Maintainer: Atmel */ |
323 | .timer = &at91sam926x_timer, | 323 | .init_time = at91sam926x_pit_init, |
324 | .map_io = at91_map_io, | 324 | .map_io = at91_map_io, |
325 | .handle_irq = at91_aic_handle_irq, | 325 | .handle_irq = at91_aic_handle_irq, |
326 | .init_early = ek_init_early, | 326 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c index 98771500ddb9..3aaa9784cf0e 100644 --- a/arch/arm/mach-at91/board-snapper9260.c +++ b/arch/arm/mach-at91/board-snapper9260.c | |||
@@ -177,7 +177,7 @@ static void __init snapper9260_board_init(void) | |||
177 | } | 177 | } |
178 | 178 | ||
179 | MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module") | 179 | MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module") |
180 | .timer = &at91sam926x_timer, | 180 | .init_time = at91sam926x_pit_init, |
181 | .map_io = at91_map_io, | 181 | .map_io = at91_map_io, |
182 | .handle_irq = at91_aic_handle_irq, | 182 | .handle_irq = at91_aic_handle_irq, |
183 | .init_early = snapper9260_init_early, | 183 | .init_early = snapper9260_init_early, |
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c index 48a962b61fa3..a033b8df9fb2 100644 --- a/arch/arm/mach-at91/board-stamp9g20.c +++ b/arch/arm/mach-at91/board-stamp9g20.c | |||
@@ -272,7 +272,7 @@ static void __init stamp9g20evb_board_init(void) | |||
272 | 272 | ||
273 | MACHINE_START(PORTUXG20, "taskit PortuxG20") | 273 | MACHINE_START(PORTUXG20, "taskit PortuxG20") |
274 | /* Maintainer: taskit GmbH */ | 274 | /* Maintainer: taskit GmbH */ |
275 | .timer = &at91sam926x_timer, | 275 | .init_time = at91sam926x_pit_init, |
276 | .map_io = at91_map_io, | 276 | .map_io = at91_map_io, |
277 | .handle_irq = at91_aic_handle_irq, | 277 | .handle_irq = at91_aic_handle_irq, |
278 | .init_early = stamp9g20_init_early, | 278 | .init_early = stamp9g20_init_early, |
@@ -282,7 +282,7 @@ MACHINE_END | |||
282 | 282 | ||
283 | MACHINE_START(STAMP9G20, "taskit Stamp9G20") | 283 | MACHINE_START(STAMP9G20, "taskit Stamp9G20") |
284 | /* Maintainer: taskit GmbH */ | 284 | /* Maintainer: taskit GmbH */ |
285 | .timer = &at91sam926x_timer, | 285 | .init_time = at91sam926x_pit_init, |
286 | .map_io = at91_map_io, | 286 | .map_io = at91_map_io, |
287 | .handle_irq = at91_aic_handle_irq, | 287 | .handle_irq = at91_aic_handle_irq, |
288 | .init_early = stamp9g20_init_early, | 288 | .init_early = stamp9g20_init_early, |
diff --git a/arch/arm/mach-at91/board-usb-a926x.c b/arch/arm/mach-at91/board-usb-a926x.c index c1060f96e589..2487d944a1bc 100644 --- a/arch/arm/mach-at91/board-usb-a926x.c +++ b/arch/arm/mach-at91/board-usb-a926x.c | |||
@@ -355,7 +355,7 @@ static void __init ek_board_init(void) | |||
355 | 355 | ||
356 | MACHINE_START(USB_A9263, "CALAO USB_A9263") | 356 | MACHINE_START(USB_A9263, "CALAO USB_A9263") |
357 | /* Maintainer: calao-systems */ | 357 | /* Maintainer: calao-systems */ |
358 | .timer = &at91sam926x_timer, | 358 | .init_time = at91sam926x_pit_init, |
359 | .map_io = at91_map_io, | 359 | .map_io = at91_map_io, |
360 | .handle_irq = at91_aic_handle_irq, | 360 | .handle_irq = at91_aic_handle_irq, |
361 | .init_early = ek_init_early, | 361 | .init_early = ek_init_early, |
@@ -365,7 +365,7 @@ MACHINE_END | |||
365 | 365 | ||
366 | MACHINE_START(USB_A9260, "CALAO USB_A9260") | 366 | MACHINE_START(USB_A9260, "CALAO USB_A9260") |
367 | /* Maintainer: calao-systems */ | 367 | /* Maintainer: calao-systems */ |
368 | .timer = &at91sam926x_timer, | 368 | .init_time = at91sam926x_pit_init, |
369 | .map_io = at91_map_io, | 369 | .map_io = at91_map_io, |
370 | .handle_irq = at91_aic_handle_irq, | 370 | .handle_irq = at91_aic_handle_irq, |
371 | .init_early = ek_init_early, | 371 | .init_early = ek_init_early, |
@@ -375,7 +375,7 @@ MACHINE_END | |||
375 | 375 | ||
376 | MACHINE_START(USB_A9G20, "CALAO USB_A92G0") | 376 | MACHINE_START(USB_A9G20, "CALAO USB_A92G0") |
377 | /* Maintainer: Jean-Christophe PLAGNIOL-VILLARD */ | 377 | /* Maintainer: Jean-Christophe PLAGNIOL-VILLARD */ |
378 | .timer = &at91sam926x_timer, | 378 | .init_time = at91sam926x_pit_init, |
379 | .map_io = at91_map_io, | 379 | .map_io = at91_map_io, |
380 | .handle_irq = at91_aic_handle_irq, | 380 | .handle_irq = at91_aic_handle_irq, |
381 | .init_early = ek_init_early, | 381 | .init_early = ek_init_early, |
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c index 8673aebcb85d..be083771df2e 100644 --- a/arch/arm/mach-at91/board-yl-9200.c +++ b/arch/arm/mach-at91/board-yl-9200.c | |||
@@ -587,7 +587,7 @@ static void __init yl9200_board_init(void) | |||
587 | 587 | ||
588 | MACHINE_START(YL9200, "uCdragon YL-9200") | 588 | MACHINE_START(YL9200, "uCdragon YL-9200") |
589 | /* Maintainer: S.Birtles */ | 589 | /* Maintainer: S.Birtles */ |
590 | .timer = &at91rm9200_timer, | 590 | .init_time = at91rm9200_timer_init, |
591 | .map_io = at91_map_io, | 591 | .map_io = at91_map_io, |
592 | .handle_irq = at91_aic_handle_irq, | 592 | .handle_irq = at91_aic_handle_irq, |
593 | .init_early = yl9200_init_early, | 593 | .init_early = yl9200_init_early, |
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index fc593d615e7d..78ab06548658 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h | |||
@@ -36,12 +36,11 @@ extern int __init at91_aic5_of_init(struct device_node *node, | |||
36 | 36 | ||
37 | 37 | ||
38 | /* Timer */ | 38 | /* Timer */ |
39 | struct sys_timer; | ||
40 | extern void at91rm9200_ioremap_st(u32 addr); | 39 | extern void at91rm9200_ioremap_st(u32 addr); |
41 | extern struct sys_timer at91rm9200_timer; | 40 | extern void at91rm9200_timer_init(void); |
42 | extern void at91sam926x_ioremap_pit(u32 addr); | 41 | extern void at91sam926x_ioremap_pit(u32 addr); |
43 | extern struct sys_timer at91sam926x_timer; | 42 | extern void at91sam926x_pit_init(void); |
44 | extern struct sys_timer at91x40_timer; | 43 | extern void at91x40_timer_init(void); |
45 | 44 | ||
46 | /* Clocks */ | 45 | /* Clocks */ |
47 | #ifdef CONFIG_AT91_PMC_UNIT | 46 | #ifdef CONFIG_AT91_PMC_UNIT |
diff --git a/arch/arm/mach-bcm/board_bcm.c b/arch/arm/mach-bcm/board_bcm.c index 5c920bde6791..f0f9abafad29 100644 --- a/arch/arm/mach-bcm/board_bcm.c +++ b/arch/arm/mach-bcm/board_bcm.c | |||
@@ -24,9 +24,6 @@ static void timer_init(void) | |||
24 | { | 24 | { |
25 | } | 25 | } |
26 | 26 | ||
27 | static struct sys_timer timer = { | ||
28 | .init = timer_init, | ||
29 | }; | ||
30 | 27 | ||
31 | static void __init board_init(void) | 28 | static void __init board_init(void) |
32 | { | 29 | { |
@@ -38,7 +35,7 @@ static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, }; | |||
38 | 35 | ||
39 | DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor") | 36 | DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor") |
40 | .init_irq = irqchip_init, | 37 | .init_irq = irqchip_init, |
41 | .timer = &timer, | 38 | .init_time = timer_init, |
42 | .init_machine = board_init, | 39 | .init_machine = board_init, |
43 | .dt_compat = bcm11351_dt_compat, | 40 | .dt_compat = bcm11351_dt_compat, |
44 | MACHINE_END | 41 | MACHINE_END |
diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm2835/bcm2835.c index f0d739f4b7a3..176d2d24782d 100644 --- a/arch/arm/mach-bcm2835/bcm2835.c +++ b/arch/arm/mach-bcm2835/bcm2835.c | |||
@@ -104,7 +104,7 @@ DT_MACHINE_START(BCM2835, "BCM2835") | |||
104 | .init_irq = bcm2835_init_irq, | 104 | .init_irq = bcm2835_init_irq, |
105 | .handle_irq = bcm2835_handle_irq, | 105 | .handle_irq = bcm2835_handle_irq, |
106 | .init_machine = bcm2835_init, | 106 | .init_machine = bcm2835_init, |
107 | .timer = &bcm2835_timer, | 107 | .init_time = bcm2835_timer_init, |
108 | .restart = bcm2835_restart, | 108 | .restart = bcm2835_restart, |
109 | .dt_compat = bcm2835_compat | 109 | .dt_compat = bcm2835_compat |
110 | MACHINE_END | 110 | MACHINE_END |
diff --git a/arch/arm/mach-clps711x/board-autcpu12.c b/arch/arm/mach-clps711x/board-autcpu12.c index 3fbf43f72589..f38584709df7 100644 --- a/arch/arm/mach-clps711x/board-autcpu12.c +++ b/arch/arm/mach-clps711x/board-autcpu12.c | |||
@@ -170,7 +170,7 @@ MACHINE_START(AUTCPU12, "autronix autcpu12") | |||
170 | .nr_irqs = CLPS711X_NR_IRQS, | 170 | .nr_irqs = CLPS711X_NR_IRQS, |
171 | .map_io = clps711x_map_io, | 171 | .map_io = clps711x_map_io, |
172 | .init_irq = clps711x_init_irq, | 172 | .init_irq = clps711x_init_irq, |
173 | .timer = &clps711x_timer, | 173 | .init_time = clps711x_timer_init, |
174 | .init_machine = autcpu12_init, | 174 | .init_machine = autcpu12_init, |
175 | .init_late = autcpu12_init_late, | 175 | .init_late = autcpu12_init_late, |
176 | .handle_irq = clps711x_handle_irq, | 176 | .handle_irq = clps711x_handle_irq, |
diff --git a/arch/arm/mach-clps711x/board-cdb89712.c b/arch/arm/mach-clps711x/board-cdb89712.c index 60900ddf97c9..baab7da33c9b 100644 --- a/arch/arm/mach-clps711x/board-cdb89712.c +++ b/arch/arm/mach-clps711x/board-cdb89712.c | |||
@@ -140,7 +140,7 @@ MACHINE_START(CDB89712, "Cirrus-CDB89712") | |||
140 | .nr_irqs = CLPS711X_NR_IRQS, | 140 | .nr_irqs = CLPS711X_NR_IRQS, |
141 | .map_io = clps711x_map_io, | 141 | .map_io = clps711x_map_io, |
142 | .init_irq = clps711x_init_irq, | 142 | .init_irq = clps711x_init_irq, |
143 | .timer = &clps711x_timer, | 143 | .init_time = clps711x_timer_init, |
144 | .init_machine = cdb89712_init, | 144 | .init_machine = cdb89712_init, |
145 | .handle_irq = clps711x_handle_irq, | 145 | .handle_irq = clps711x_handle_irq, |
146 | .restart = clps711x_restart, | 146 | .restart = clps711x_restart, |
diff --git a/arch/arm/mach-clps711x/board-clep7312.c b/arch/arm/mach-clps711x/board-clep7312.c index 0b32a487183b..014aa3c19a03 100644 --- a/arch/arm/mach-clps711x/board-clep7312.c +++ b/arch/arm/mach-clps711x/board-clep7312.c | |||
@@ -40,7 +40,7 @@ MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") | |||
40 | .fixup = fixup_clep7312, | 40 | .fixup = fixup_clep7312, |
41 | .map_io = clps711x_map_io, | 41 | .map_io = clps711x_map_io, |
42 | .init_irq = clps711x_init_irq, | 42 | .init_irq = clps711x_init_irq, |
43 | .timer = &clps711x_timer, | 43 | .init_time = clps711x_timer_init, |
44 | .handle_irq = clps711x_handle_irq, | 44 | .handle_irq = clps711x_handle_irq, |
45 | .restart = clps711x_restart, | 45 | .restart = clps711x_restart, |
46 | MACHINE_END | 46 | MACHINE_END |
diff --git a/arch/arm/mach-clps711x/board-edb7211.c b/arch/arm/mach-clps711x/board-edb7211.c index 71aa5cf2c0d3..5f928e9ed2ef 100644 --- a/arch/arm/mach-clps711x/board-edb7211.c +++ b/arch/arm/mach-clps711x/board-edb7211.c | |||
@@ -173,7 +173,7 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") | |||
173 | .reserve = edb7211_reserve, | 173 | .reserve = edb7211_reserve, |
174 | .map_io = edb7211_map_io, | 174 | .map_io = edb7211_map_io, |
175 | .init_irq = clps711x_init_irq, | 175 | .init_irq = clps711x_init_irq, |
176 | .timer = &clps711x_timer, | 176 | .init_time = clps711x_timer_init, |
177 | .init_machine = edb7211_init, | 177 | .init_machine = edb7211_init, |
178 | .handle_irq = clps711x_handle_irq, | 178 | .handle_irq = clps711x_handle_irq, |
179 | .restart = clps711x_restart, | 179 | .restart = clps711x_restart, |
diff --git a/arch/arm/mach-clps711x/board-fortunet.c b/arch/arm/mach-clps711x/board-fortunet.c index 7d0125580366..c5675efc8c6a 100644 --- a/arch/arm/mach-clps711x/board-fortunet.c +++ b/arch/arm/mach-clps711x/board-fortunet.c | |||
@@ -78,7 +78,7 @@ MACHINE_START(FORTUNET, "ARM-FortuNet") | |||
78 | .fixup = fortunet_fixup, | 78 | .fixup = fortunet_fixup, |
79 | .map_io = clps711x_map_io, | 79 | .map_io = clps711x_map_io, |
80 | .init_irq = clps711x_init_irq, | 80 | .init_irq = clps711x_init_irq, |
81 | .timer = &clps711x_timer, | 81 | .init_time = clps711x_timer_init, |
82 | .handle_irq = clps711x_handle_irq, | 82 | .handle_irq = clps711x_handle_irq, |
83 | .restart = clps711x_restart, | 83 | .restart = clps711x_restart, |
84 | MACHINE_END | 84 | MACHINE_END |
diff --git a/arch/arm/mach-clps711x/board-p720t.c b/arch/arm/mach-clps711x/board-p720t.c index 1518fc83babd..8d3ee6771135 100644 --- a/arch/arm/mach-clps711x/board-p720t.c +++ b/arch/arm/mach-clps711x/board-p720t.c | |||
@@ -224,7 +224,7 @@ MACHINE_START(P720T, "ARM-Prospector720T") | |||
224 | .map_io = p720t_map_io, | 224 | .map_io = p720t_map_io, |
225 | .init_early = p720t_init_early, | 225 | .init_early = p720t_init_early, |
226 | .init_irq = clps711x_init_irq, | 226 | .init_irq = clps711x_init_irq, |
227 | .timer = &clps711x_timer, | 227 | .init_time = clps711x_timer_init, |
228 | .init_machine = p720t_init, | 228 | .init_machine = p720t_init, |
229 | .init_late = p720t_init_late, | 229 | .init_late = p720t_init_late, |
230 | .handle_irq = clps711x_handle_irq, | 230 | .handle_irq = clps711x_handle_irq, |
diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c index e046439573ee..20ff50f3ccf0 100644 --- a/arch/arm/mach-clps711x/common.c +++ b/arch/arm/mach-clps711x/common.c | |||
@@ -282,7 +282,7 @@ static void add_fixed_clk(struct clk *clk, const char *name, int rate) | |||
282 | clk_register_clkdev(clk, name, NULL); | 282 | clk_register_clkdev(clk, name, NULL); |
283 | } | 283 | } |
284 | 284 | ||
285 | static void __init clps711x_timer_init(void) | 285 | void __init clps711x_timer_init(void) |
286 | { | 286 | { |
287 | int osc, ext, pll, cpu, bus, timl, timh, uart, spi; | 287 | int osc, ext, pll, cpu, bus, timl, timh, uart, spi; |
288 | u32 tmp; | 288 | u32 tmp; |
@@ -345,10 +345,6 @@ static void __init clps711x_timer_init(void) | |||
345 | setup_irq(IRQ_TC2OI, &clps711x_timer_irq); | 345 | setup_irq(IRQ_TC2OI, &clps711x_timer_irq); |
346 | } | 346 | } |
347 | 347 | ||
348 | struct sys_timer clps711x_timer = { | ||
349 | .init = clps711x_timer_init, | ||
350 | }; | ||
351 | |||
352 | void clps711x_restart(char mode, const char *cmd) | 348 | void clps711x_restart(char mode, const char *cmd) |
353 | { | 349 | { |
354 | soft_restart(0); | 350 | soft_restart(0); |
diff --git a/arch/arm/mach-clps711x/common.h b/arch/arm/mach-clps711x/common.h index b7c0c75c90c0..f84a7292c70e 100644 --- a/arch/arm/mach-clps711x/common.h +++ b/arch/arm/mach-clps711x/common.h | |||
@@ -8,10 +8,8 @@ | |||
8 | #define CLPS711X_NR_GPIO (4 * 8 + 3) | 8 | #define CLPS711X_NR_GPIO (4 * 8 + 3) |
9 | #define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit)) | 9 | #define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit)) |
10 | 10 | ||
11 | struct sys_timer; | ||
12 | |||
13 | extern void clps711x_map_io(void); | 11 | extern void clps711x_map_io(void); |
14 | extern void clps711x_init_irq(void); | 12 | extern void clps711x_init_irq(void); |
13 | extern void clps711x_timer_init(void); | ||
15 | extern void clps711x_handle_irq(struct pt_regs *regs); | 14 | extern void clps711x_handle_irq(struct pt_regs *regs); |
16 | extern void clps711x_restart(char mode, const char *cmd); | 15 | extern void clps711x_restart(char mode, const char *cmd); |
17 | extern struct sys_timer clps711x_timer; | ||
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c index 26f36d7efecd..a71867e1d8d6 100644 --- a/arch/arm/mach-cns3xxx/cns3420vb.c +++ b/arch/arm/mach-cns3xxx/cns3420vb.c | |||
@@ -249,7 +249,7 @@ MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board") | |||
249 | .atag_offset = 0x100, | 249 | .atag_offset = 0x100, |
250 | .map_io = cns3420_map_io, | 250 | .map_io = cns3420_map_io, |
251 | .init_irq = cns3xxx_init_irq, | 251 | .init_irq = cns3xxx_init_irq, |
252 | .timer = &cns3xxx_timer, | 252 | .init_time = cns3xxx_timer_init, |
253 | .init_machine = cns3420_init, | 253 | .init_machine = cns3420_init, |
254 | .restart = cns3xxx_restart, | 254 | .restart = cns3xxx_restart, |
255 | MACHINE_END | 255 | MACHINE_END |
diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c index db3806c00f4b..e698f26cc0cb 100644 --- a/arch/arm/mach-cns3xxx/core.c +++ b/arch/arm/mach-cns3xxx/core.c | |||
@@ -134,7 +134,6 @@ static int cns3xxx_timer_set_next_event(unsigned long evt, | |||
134 | 134 | ||
135 | static struct clock_event_device cns3xxx_tmr1_clockevent = { | 135 | static struct clock_event_device cns3xxx_tmr1_clockevent = { |
136 | .name = "cns3xxx timer1", | 136 | .name = "cns3xxx timer1", |
137 | .shift = 8, | ||
138 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 137 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
139 | .set_mode = cns3xxx_timer_set_mode, | 138 | .set_mode = cns3xxx_timer_set_mode, |
140 | .set_next_event = cns3xxx_timer_set_next_event, | 139 | .set_next_event = cns3xxx_timer_set_next_event, |
@@ -145,15 +144,9 @@ static struct clock_event_device cns3xxx_tmr1_clockevent = { | |||
145 | static void __init cns3xxx_clockevents_init(unsigned int timer_irq) | 144 | static void __init cns3xxx_clockevents_init(unsigned int timer_irq) |
146 | { | 145 | { |
147 | cns3xxx_tmr1_clockevent.irq = timer_irq; | 146 | cns3xxx_tmr1_clockevent.irq = timer_irq; |
148 | cns3xxx_tmr1_clockevent.mult = | 147 | clockevents_config_and_register(&cns3xxx_tmr1_clockevent, |
149 | div_sc((cns3xxx_cpu_clock() >> 3) * 1000000, NSEC_PER_SEC, | 148 | (cns3xxx_cpu_clock() >> 3) * 1000000, |
150 | cns3xxx_tmr1_clockevent.shift); | 149 | 0xf, 0xffffffff); |
151 | cns3xxx_tmr1_clockevent.max_delta_ns = | ||
152 | clockevent_delta2ns(0xffffffff, &cns3xxx_tmr1_clockevent); | ||
153 | cns3xxx_tmr1_clockevent.min_delta_ns = | ||
154 | clockevent_delta2ns(0xf, &cns3xxx_tmr1_clockevent); | ||
155 | |||
156 | clockevents_register_device(&cns3xxx_tmr1_clockevent); | ||
157 | } | 150 | } |
158 | 151 | ||
159 | /* | 152 | /* |
@@ -235,17 +228,13 @@ static void __init __cns3xxx_timer_init(unsigned int timer_irq) | |||
235 | cns3xxx_clockevents_init(timer_irq); | 228 | cns3xxx_clockevents_init(timer_irq); |
236 | } | 229 | } |
237 | 230 | ||
238 | static void __init cns3xxx_timer_init(void) | 231 | void __init cns3xxx_timer_init(void) |
239 | { | 232 | { |
240 | cns3xxx_tmr1 = IOMEM(CNS3XXX_TIMER1_2_3_BASE_VIRT); | 233 | cns3xxx_tmr1 = IOMEM(CNS3XXX_TIMER1_2_3_BASE_VIRT); |
241 | 234 | ||
242 | __cns3xxx_timer_init(IRQ_CNS3XXX_TIMER0); | 235 | __cns3xxx_timer_init(IRQ_CNS3XXX_TIMER0); |
243 | } | 236 | } |
244 | 237 | ||
245 | struct sys_timer cns3xxx_timer = { | ||
246 | .init = cns3xxx_timer_init, | ||
247 | }; | ||
248 | |||
249 | #ifdef CONFIG_CACHE_L2X0 | 238 | #ifdef CONFIG_CACHE_L2X0 |
250 | 239 | ||
251 | void __init cns3xxx_l2x0_init(void) | 240 | void __init cns3xxx_l2x0_init(void) |
diff --git a/arch/arm/mach-cns3xxx/core.h b/arch/arm/mach-cns3xxx/core.h index 4894b8c17151..b23b17b4da10 100644 --- a/arch/arm/mach-cns3xxx/core.h +++ b/arch/arm/mach-cns3xxx/core.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #ifndef __CNS3XXX_CORE_H | 11 | #ifndef __CNS3XXX_CORE_H |
12 | #define __CNS3XXX_CORE_H | 12 | #define __CNS3XXX_CORE_H |
13 | 13 | ||
14 | extern struct sys_timer cns3xxx_timer; | 14 | extern void cns3xxx_timer_init(void); |
15 | 15 | ||
16 | #ifdef CONFIG_CACHE_L2X0 | 16 | #ifdef CONFIG_CACHE_L2X0 |
17 | void __init cns3xxx_l2x0_init(void); | 17 | void __init cns3xxx_l2x0_init(void); |
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 95b5e102ceb1..e3742716cbaa 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c | |||
@@ -679,7 +679,7 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM") | |||
679 | .atag_offset = 0x100, | 679 | .atag_offset = 0x100, |
680 | .map_io = da830_evm_map_io, | 680 | .map_io = da830_evm_map_io, |
681 | .init_irq = cp_intc_init, | 681 | .init_irq = cp_intc_init, |
682 | .timer = &davinci_timer, | 682 | .init_time = davinci_timer_init, |
683 | .init_machine = da830_evm_init, | 683 | .init_machine = da830_evm_init, |
684 | .init_late = davinci_init_late, | 684 | .init_late = davinci_init_late, |
685 | .dma_zone_size = SZ_128M, | 685 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 0299915575a8..3b3356097bb0 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -1599,7 +1599,7 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM") | |||
1599 | .atag_offset = 0x100, | 1599 | .atag_offset = 0x100, |
1600 | .map_io = da850_evm_map_io, | 1600 | .map_io = da850_evm_map_io, |
1601 | .init_irq = cp_intc_init, | 1601 | .init_irq = cp_intc_init, |
1602 | .timer = &davinci_timer, | 1602 | .init_time = davinci_timer_init, |
1603 | .init_machine = da850_evm_init, | 1603 | .init_machine = da850_evm_init, |
1604 | .init_late = davinci_init_late, | 1604 | .init_late = davinci_init_late, |
1605 | .dma_zone_size = SZ_128M, | 1605 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index cdf8d0746e79..147b8e1a4407 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c | |||
@@ -355,7 +355,7 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM") | |||
355 | .atag_offset = 0x100, | 355 | .atag_offset = 0x100, |
356 | .map_io = dm355_evm_map_io, | 356 | .map_io = dm355_evm_map_io, |
357 | .init_irq = davinci_irq_init, | 357 | .init_irq = davinci_irq_init, |
358 | .timer = &davinci_timer, | 358 | .init_time = davinci_timer_init, |
359 | .init_machine = dm355_evm_init, | 359 | .init_machine = dm355_evm_init, |
360 | .init_late = davinci_init_late, | 360 | .init_late = davinci_init_late, |
361 | .dma_zone_size = SZ_128M, | 361 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c index d41954507fc2..dff4ddc5ef81 100644 --- a/arch/arm/mach-davinci/board-dm355-leopard.c +++ b/arch/arm/mach-davinci/board-dm355-leopard.c | |||
@@ -274,7 +274,7 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard") | |||
274 | .atag_offset = 0x100, | 274 | .atag_offset = 0x100, |
275 | .map_io = dm355_leopard_map_io, | 275 | .map_io = dm355_leopard_map_io, |
276 | .init_irq = davinci_irq_init, | 276 | .init_irq = davinci_irq_init, |
277 | .timer = &davinci_timer, | 277 | .init_time = davinci_timer_init, |
278 | .init_machine = dm355_leopard_init, | 278 | .init_machine = dm355_leopard_init, |
279 | .init_late = davinci_init_late, | 279 | .init_late = davinci_init_late, |
280 | .dma_zone_size = SZ_128M, | 280 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 5d49c75388ca..c2d4958a0cb6 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -616,7 +616,7 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM") | |||
616 | .atag_offset = 0x100, | 616 | .atag_offset = 0x100, |
617 | .map_io = dm365_evm_map_io, | 617 | .map_io = dm365_evm_map_io, |
618 | .init_irq = davinci_irq_init, | 618 | .init_irq = davinci_irq_init, |
619 | .timer = &davinci_timer, | 619 | .init_time = davinci_timer_init, |
620 | .init_machine = dm365_evm_init, | 620 | .init_machine = dm365_evm_init, |
621 | .init_late = davinci_init_late, | 621 | .init_late = davinci_init_late, |
622 | .dma_zone_size = SZ_128M, | 622 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index f5e018de7fa5..e4a16f98e6a2 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
@@ -825,7 +825,7 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM") | |||
825 | .atag_offset = 0x100, | 825 | .atag_offset = 0x100, |
826 | .map_io = davinci_evm_map_io, | 826 | .map_io = davinci_evm_map_io, |
827 | .init_irq = davinci_irq_init, | 827 | .init_irq = davinci_irq_init, |
828 | .timer = &davinci_timer, | 828 | .init_time = davinci_timer_init, |
829 | .init_machine = davinci_evm_init, | 829 | .init_machine = davinci_evm_init, |
830 | .init_late = davinci_init_late, | 830 | .init_late = davinci_init_late, |
831 | .dma_zone_size = SZ_128M, | 831 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 6e2f1631df5b..de7adff324dc 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c | |||
@@ -818,7 +818,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") | |||
818 | .atag_offset = 0x100, | 818 | .atag_offset = 0x100, |
819 | .map_io = davinci_map_io, | 819 | .map_io = davinci_map_io, |
820 | .init_irq = davinci_irq_init, | 820 | .init_irq = davinci_irq_init, |
821 | .timer = &davinci_timer, | 821 | .init_time = davinci_timer_init, |
822 | .init_machine = evm_init, | 822 | .init_machine = evm_init, |
823 | .init_late = davinci_init_late, | 823 | .init_late = davinci_init_late, |
824 | .dma_zone_size = SZ_128M, | 824 | .dma_zone_size = SZ_128M, |
@@ -829,7 +829,7 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM") | |||
829 | .atag_offset = 0x100, | 829 | .atag_offset = 0x100, |
830 | .map_io = davinci_map_io, | 830 | .map_io = davinci_map_io, |
831 | .init_irq = davinci_irq_init, | 831 | .init_irq = davinci_irq_init, |
832 | .timer = &davinci_timer, | 832 | .init_time = davinci_timer_init, |
833 | .init_machine = evm_init, | 833 | .init_machine = evm_init, |
834 | .init_late = davinci_init_late, | 834 | .init_late = davinci_init_late, |
835 | .dma_zone_size = SZ_128M, | 835 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 43e4a0d663fa..b0df578bf744 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c | |||
@@ -570,7 +570,7 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808") | |||
570 | .atag_offset = 0x100, | 570 | .atag_offset = 0x100, |
571 | .map_io = mityomapl138_map_io, | 571 | .map_io = mityomapl138_map_io, |
572 | .init_irq = cp_intc_init, | 572 | .init_irq = cp_intc_init, |
573 | .timer = &davinci_timer, | 573 | .init_time = davinci_timer_init, |
574 | .init_machine = mityomapl138_init, | 574 | .init_machine = mityomapl138_init, |
575 | .init_late = davinci_init_late, | 575 | .init_late = davinci_init_late, |
576 | .dma_zone_size = SZ_128M, | 576 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c index 3e3e3afebf88..1c98107527fa 100644 --- a/arch/arm/mach-davinci/board-neuros-osd2.c +++ b/arch/arm/mach-davinci/board-neuros-osd2.c | |||
@@ -237,7 +237,7 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2") | |||
237 | .atag_offset = 0x100, | 237 | .atag_offset = 0x100, |
238 | .map_io = davinci_ntosd2_map_io, | 238 | .map_io = davinci_ntosd2_map_io, |
239 | .init_irq = davinci_irq_init, | 239 | .init_irq = davinci_irq_init, |
240 | .timer = &davinci_timer, | 240 | .init_time = davinci_timer_init, |
241 | .init_machine = davinci_ntosd2_init, | 241 | .init_machine = davinci_ntosd2_init, |
242 | .init_late = davinci_init_late, | 242 | .init_late = davinci_init_late, |
243 | .dma_zone_size = SZ_128M, | 243 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c index dc1208e9e664..deb3922612b9 100644 --- a/arch/arm/mach-davinci/board-omapl138-hawk.c +++ b/arch/arm/mach-davinci/board-omapl138-hawk.c | |||
@@ -341,7 +341,7 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard") | |||
341 | .atag_offset = 0x100, | 341 | .atag_offset = 0x100, |
342 | .map_io = omapl138_hawk_map_io, | 342 | .map_io = omapl138_hawk_map_io, |
343 | .init_irq = cp_intc_init, | 343 | .init_irq = cp_intc_init, |
344 | .timer = &davinci_timer, | 344 | .init_time = davinci_timer_init, |
345 | .init_machine = omapl138_hawk_init, | 345 | .init_machine = omapl138_hawk_init, |
346 | .init_late = davinci_init_late, | 346 | .init_late = davinci_init_late, |
347 | .dma_zone_size = SZ_128M, | 347 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c index 6957787fa7f3..739be7e738fe 100644 --- a/arch/arm/mach-davinci/board-sffsdr.c +++ b/arch/arm/mach-davinci/board-sffsdr.c | |||
@@ -155,7 +155,7 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR") | |||
155 | .atag_offset = 0x100, | 155 | .atag_offset = 0x100, |
156 | .map_io = davinci_sffsdr_map_io, | 156 | .map_io = davinci_sffsdr_map_io, |
157 | .init_irq = davinci_irq_init, | 157 | .init_irq = davinci_irq_init, |
158 | .timer = &davinci_timer, | 158 | .init_time = davinci_timer_init, |
159 | .init_machine = davinci_sffsdr_init, | 159 | .init_machine = davinci_sffsdr_init, |
160 | .init_late = davinci_init_late, | 160 | .init_late = davinci_init_late, |
161 | .dma_zone_size = SZ_128M, | 161 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c index be3099733b1f..4f416023d4e2 100644 --- a/arch/arm/mach-davinci/board-tnetv107x-evm.c +++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c | |||
@@ -280,7 +280,7 @@ MACHINE_START(TNETV107X, "TNETV107X EVM") | |||
280 | .atag_offset = 0x100, | 280 | .atag_offset = 0x100, |
281 | .map_io = tnetv107x_init, | 281 | .map_io = tnetv107x_init, |
282 | .init_irq = cp_intc_init, | 282 | .init_irq = cp_intc_init, |
283 | .timer = &davinci_timer, | 283 | .init_time = davinci_timer_init, |
284 | .init_machine = tnetv107x_evm_board_init, | 284 | .init_machine = tnetv107x_evm_board_init, |
285 | .init_late = davinci_init_late, | 285 | .init_late = davinci_init_late, |
286 | .dma_zone_size = SZ_128M, | 286 | .dma_zone_size = SZ_128M, |
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 37c27af18fa0..9a7c76efc8f8 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c | |||
@@ -56,7 +56,7 @@ static const char *da850_boards_compat[] __initdata = { | |||
56 | DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x") | 56 | DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x") |
57 | .map_io = da850_init, | 57 | .map_io = da850_init, |
58 | .init_irq = da8xx_init_irq, | 58 | .init_irq = da8xx_init_irq, |
59 | .timer = &davinci_timer, | 59 | .init_time = davinci_timer_init, |
60 | .init_machine = da850_init_machine, | 60 | .init_machine = da850_init_machine, |
61 | .dt_compat = da850_boards_compat, | 61 | .dt_compat = da850_boards_compat, |
62 | .init_late = davinci_init_late, | 62 | .init_late = davinci_init_late, |
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h index 046c7238a3d6..b124b77c90c5 100644 --- a/arch/arm/mach-davinci/include/mach/common.h +++ b/arch/arm/mach-davinci/include/mach/common.h | |||
@@ -15,9 +15,7 @@ | |||
15 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | 17 | ||
18 | struct sys_timer; | 18 | extern void davinci_timer_init(void); |
19 | |||
20 | extern struct sys_timer davinci_timer; | ||
21 | 19 | ||
22 | extern void davinci_irq_init(void); | 20 | extern void davinci_irq_init(void); |
23 | extern void __iomem *davinci_intc_base; | 21 | extern void __iomem *davinci_intc_base; |
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index 9847938785ca..bad361ec1666 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c | |||
@@ -337,7 +337,7 @@ static struct clock_event_device clockevent_davinci = { | |||
337 | }; | 337 | }; |
338 | 338 | ||
339 | 339 | ||
340 | static void __init davinci_timer_init(void) | 340 | void __init davinci_timer_init(void) |
341 | { | 341 | { |
342 | struct clk *timer_clk; | 342 | struct clk *timer_clk; |
343 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 343 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
@@ -410,11 +410,6 @@ static void __init davinci_timer_init(void) | |||
410 | timer32_config(&timers[i]); | 410 | timer32_config(&timers[i]); |
411 | } | 411 | } |
412 | 412 | ||
413 | struct sys_timer davinci_timer = { | ||
414 | .init = davinci_timer_init, | ||
415 | }; | ||
416 | |||
417 | |||
418 | /* reset board using watchdog timer */ | 413 | /* reset board using watchdog timer */ |
419 | void davinci_watchdog_reset(struct platform_device *pdev) | 414 | void davinci_watchdog_reset(struct platform_device *pdev) |
420 | { | 415 | { |
diff --git a/arch/arm/mach-dove/cm-a510.c b/arch/arm/mach-dove/cm-a510.c index 792b4e2e24f1..0dc39cf30fdd 100644 --- a/arch/arm/mach-dove/cm-a510.c +++ b/arch/arm/mach-dove/cm-a510.c | |||
@@ -92,6 +92,6 @@ MACHINE_START(CM_A510, "Compulab CM-A510 Board") | |||
92 | .map_io = dove_map_io, | 92 | .map_io = dove_map_io, |
93 | .init_early = dove_init_early, | 93 | .init_early = dove_init_early, |
94 | .init_irq = dove_init_irq, | 94 | .init_irq = dove_init_irq, |
95 | .timer = &dove_timer, | 95 | .init_time = dove_timer_init, |
96 | .restart = dove_restart, | 96 | .restart = dove_restart, |
97 | MACHINE_END | 97 | MACHINE_END |
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 89f4f993cd03..0c7911b3e155 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
@@ -242,17 +242,13 @@ static int __init dove_find_tclk(void) | |||
242 | return 166666667; | 242 | return 166666667; |
243 | } | 243 | } |
244 | 244 | ||
245 | static void __init dove_timer_init(void) | 245 | void __init dove_timer_init(void) |
246 | { | 246 | { |
247 | dove_tclk = dove_find_tclk(); | 247 | dove_tclk = dove_find_tclk(); |
248 | orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, | 248 | orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, |
249 | IRQ_DOVE_BRIDGE, dove_tclk); | 249 | IRQ_DOVE_BRIDGE, dove_tclk); |
250 | } | 250 | } |
251 | 251 | ||
252 | struct sys_timer dove_timer = { | ||
253 | .init = dove_timer_init, | ||
254 | }; | ||
255 | |||
256 | /***************************************************************************** | 252 | /***************************************************************************** |
257 | * Cryptographic Engines and Security Accelerator (CESA) | 253 | * Cryptographic Engines and Security Accelerator (CESA) |
258 | ****************************************************************************/ | 254 | ****************************************************************************/ |
@@ -454,7 +450,7 @@ DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)") | |||
454 | .map_io = dove_map_io, | 450 | .map_io = dove_map_io, |
455 | .init_early = dove_init_early, | 451 | .init_early = dove_init_early, |
456 | .init_irq = orion_dt_init_irq, | 452 | .init_irq = orion_dt_init_irq, |
457 | .timer = &dove_timer, | 453 | .init_time = dove_timer_init, |
458 | .init_machine = dove_dt_init, | 454 | .init_machine = dove_dt_init, |
459 | .restart = dove_restart, | 455 | .restart = dove_restart, |
460 | .dt_compat = dove_dt_board_compat, | 456 | .dt_compat = dove_dt_board_compat, |
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h index 1a233404b735..ee59fba4c6d1 100644 --- a/arch/arm/mach-dove/common.h +++ b/arch/arm/mach-dove/common.h | |||
@@ -14,7 +14,7 @@ | |||
14 | struct mv643xx_eth_platform_data; | 14 | struct mv643xx_eth_platform_data; |
15 | struct mv_sata_platform_data; | 15 | struct mv_sata_platform_data; |
16 | 16 | ||
17 | extern struct sys_timer dove_timer; | 17 | extern void dove_timer_init(void); |
18 | 18 | ||
19 | /* | 19 | /* |
20 | * Basic Dove init functions used early by machine-setup. | 20 | * Basic Dove init functions used early by machine-setup. |
diff --git a/arch/arm/mach-dove/dove-db-setup.c b/arch/arm/mach-dove/dove-db-setup.c index bc2867f11346..76e26f949c27 100644 --- a/arch/arm/mach-dove/dove-db-setup.c +++ b/arch/arm/mach-dove/dove-db-setup.c | |||
@@ -98,6 +98,6 @@ MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board") | |||
98 | .map_io = dove_map_io, | 98 | .map_io = dove_map_io, |
99 | .init_early = dove_init_early, | 99 | .init_early = dove_init_early, |
100 | .init_irq = dove_init_irq, | 100 | .init_irq = dove_init_irq, |
101 | .timer = &dove_timer, | 101 | .init_time = dove_timer_init, |
102 | .restart = dove_restart, | 102 | .restart = dove_restart, |
103 | MACHINE_END | 103 | MACHINE_END |
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c index f0fe6b5350e2..b13cc74114db 100644 --- a/arch/arm/mach-ebsa110/core.c +++ b/arch/arm/mach-ebsa110/core.c | |||
@@ -158,7 +158,7 @@ static void __init ebsa110_init_early(void) | |||
158 | * interrupt, then the PIT counter will roll over (ie, be negative). | 158 | * interrupt, then the PIT counter will roll over (ie, be negative). |
159 | * This actually works out to be convenient. | 159 | * This actually works out to be convenient. |
160 | */ | 160 | */ |
161 | static unsigned long ebsa110_gettimeoffset(void) | 161 | static u32 ebsa110_gettimeoffset(void) |
162 | { | 162 | { |
163 | unsigned long offset, count; | 163 | unsigned long offset, count; |
164 | 164 | ||
@@ -181,7 +181,7 @@ static unsigned long ebsa110_gettimeoffset(void) | |||
181 | */ | 181 | */ |
182 | offset = offset * (1000000 / HZ) / COUNT; | 182 | offset = offset * (1000000 / HZ) / COUNT; |
183 | 183 | ||
184 | return offset; | 184 | return offset * 1000; |
185 | } | 185 | } |
186 | 186 | ||
187 | static irqreturn_t | 187 | static irqreturn_t |
@@ -213,8 +213,10 @@ static struct irqaction ebsa110_timer_irq = { | |||
213 | /* | 213 | /* |
214 | * Set up timer interrupt. | 214 | * Set up timer interrupt. |
215 | */ | 215 | */ |
216 | static void __init ebsa110_timer_init(void) | 216 | void __init ebsa110_timer_init(void) |
217 | { | 217 | { |
218 | arch_gettimeoffset = ebsa110_gettimeoffset; | ||
219 | |||
218 | /* | 220 | /* |
219 | * Timer 1, mode 2, LSB/MSB | 221 | * Timer 1, mode 2, LSB/MSB |
220 | */ | 222 | */ |
@@ -225,11 +227,6 @@ static void __init ebsa110_timer_init(void) | |||
225 | setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq); | 227 | setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq); |
226 | } | 228 | } |
227 | 229 | ||
228 | static struct sys_timer ebsa110_timer = { | ||
229 | .init = ebsa110_timer_init, | ||
230 | .offset = ebsa110_gettimeoffset, | ||
231 | }; | ||
232 | |||
233 | static struct plat_serial8250_port serial_platform_data[] = { | 230 | static struct plat_serial8250_port serial_platform_data[] = { |
234 | { | 231 | { |
235 | .iobase = 0x3f8, | 232 | .iobase = 0x3f8, |
@@ -328,6 +325,6 @@ MACHINE_START(EBSA110, "EBSA110") | |||
328 | .map_io = ebsa110_map_io, | 325 | .map_io = ebsa110_map_io, |
329 | .init_early = ebsa110_init_early, | 326 | .init_early = ebsa110_init_early, |
330 | .init_irq = ebsa110_init_irq, | 327 | .init_irq = ebsa110_init_irq, |
331 | .timer = &ebsa110_timer, | 328 | .init_time = ebsa110_timer_init, |
332 | .restart = ebsa110_restart, | 329 | .restart = ebsa110_restart, |
333 | MACHINE_END | 330 | MACHINE_END |
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c index 19332bf022bc..bda6c3a5c923 100644 --- a/arch/arm/mach-ep93xx/adssphere.c +++ b/arch/arm/mach-ep93xx/adssphere.c | |||
@@ -38,7 +38,7 @@ MACHINE_START(ADSSPHERE, "ADS Sphere board") | |||
38 | .atag_offset = 0x100, | 38 | .atag_offset = 0x100, |
39 | .map_io = ep93xx_map_io, | 39 | .map_io = ep93xx_map_io, |
40 | .init_irq = ep93xx_init_irq, | 40 | .init_irq = ep93xx_init_irq, |
41 | .timer = &ep93xx_timer, | 41 | .init_time = ep93xx_timer_init, |
42 | .init_machine = adssphere_init_machine, | 42 | .init_machine = adssphere_init_machine, |
43 | .init_late = ep93xx_init_late, | 43 | .init_late = ep93xx_init_late, |
44 | .restart = ep93xx_restart, | 44 | .restart = ep93xx_restart, |
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index c533f37aad2f..c49ed3dc1aea 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -139,11 +139,29 @@ static struct irqaction ep93xx_timer_irq = { | |||
139 | .handler = ep93xx_timer_interrupt, | 139 | .handler = ep93xx_timer_interrupt, |
140 | }; | 140 | }; |
141 | 141 | ||
142 | static void __init ep93xx_timer_init(void) | 142 | static u32 ep93xx_gettimeoffset(void) |
143 | { | ||
144 | int offset; | ||
145 | |||
146 | offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time; | ||
147 | |||
148 | /* | ||
149 | * Timer 4 is based on a 983.04 kHz reference clock, | ||
150 | * so dividing by 983040 gives the fraction of a second, | ||
151 | * so dividing by 0.983040 converts to uS. | ||
152 | * Refactor the calculation to avoid overflow. | ||
153 | * Finally, multiply by 1000 to give nS. | ||
154 | */ | ||
155 | return (offset + (53 * offset / 3072)) * 1000; | ||
156 | } | ||
157 | |||
158 | void __init ep93xx_timer_init(void) | ||
143 | { | 159 | { |
144 | u32 tmode = EP93XX_TIMER123_CONTROL_MODE | | 160 | u32 tmode = EP93XX_TIMER123_CONTROL_MODE | |
145 | EP93XX_TIMER123_CONTROL_CLKSEL; | 161 | EP93XX_TIMER123_CONTROL_CLKSEL; |
146 | 162 | ||
163 | arch_gettimeoffset = ep93xx_gettimeoffset; | ||
164 | |||
147 | /* Enable periodic HZ timer. */ | 165 | /* Enable periodic HZ timer. */ |
148 | __raw_writel(tmode, EP93XX_TIMER1_CONTROL); | 166 | __raw_writel(tmode, EP93XX_TIMER1_CONTROL); |
149 | __raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD); | 167 | __raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD); |
@@ -157,21 +175,6 @@ static void __init ep93xx_timer_init(void) | |||
157 | setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq); | 175 | setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq); |
158 | } | 176 | } |
159 | 177 | ||
160 | static unsigned long ep93xx_gettimeoffset(void) | ||
161 | { | ||
162 | int offset; | ||
163 | |||
164 | offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time; | ||
165 | |||
166 | /* Calculate (1000000 / 983040) * offset. */ | ||
167 | return offset + (53 * offset / 3072); | ||
168 | } | ||
169 | |||
170 | struct sys_timer ep93xx_timer = { | ||
171 | .init = ep93xx_timer_init, | ||
172 | .offset = ep93xx_gettimeoffset, | ||
173 | }; | ||
174 | |||
175 | 178 | ||
176 | /************************************************************************* | 179 | /************************************************************************* |
177 | * EP93xx IRQ handling | 180 | * EP93xx IRQ handling |
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c index 5abf2cbe5afd..27b14ae92c7e 100644 --- a/arch/arm/mach-ep93xx/edb93xx.c +++ b/arch/arm/mach-ep93xx/edb93xx.c | |||
@@ -275,7 +275,7 @@ MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board") | |||
275 | .atag_offset = 0x100, | 275 | .atag_offset = 0x100, |
276 | .map_io = ep93xx_map_io, | 276 | .map_io = ep93xx_map_io, |
277 | .init_irq = ep93xx_init_irq, | 277 | .init_irq = ep93xx_init_irq, |
278 | .timer = &ep93xx_timer, | 278 | .init_time = ep93xx_timer_init, |
279 | .init_machine = edb93xx_init_machine, | 279 | .init_machine = edb93xx_init_machine, |
280 | .init_late = ep93xx_init_late, | 280 | .init_late = ep93xx_init_late, |
281 | .restart = ep93xx_restart, | 281 | .restart = ep93xx_restart, |
@@ -288,7 +288,7 @@ MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board") | |||
288 | .atag_offset = 0x100, | 288 | .atag_offset = 0x100, |
289 | .map_io = ep93xx_map_io, | 289 | .map_io = ep93xx_map_io, |
290 | .init_irq = ep93xx_init_irq, | 290 | .init_irq = ep93xx_init_irq, |
291 | .timer = &ep93xx_timer, | 291 | .init_time = ep93xx_timer_init, |
292 | .init_machine = edb93xx_init_machine, | 292 | .init_machine = edb93xx_init_machine, |
293 | .init_late = ep93xx_init_late, | 293 | .init_late = ep93xx_init_late, |
294 | .restart = ep93xx_restart, | 294 | .restart = ep93xx_restart, |
@@ -301,7 +301,7 @@ MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board") | |||
301 | .atag_offset = 0x100, | 301 | .atag_offset = 0x100, |
302 | .map_io = ep93xx_map_io, | 302 | .map_io = ep93xx_map_io, |
303 | .init_irq = ep93xx_init_irq, | 303 | .init_irq = ep93xx_init_irq, |
304 | .timer = &ep93xx_timer, | 304 | .init_time = ep93xx_timer_init, |
305 | .init_machine = edb93xx_init_machine, | 305 | .init_machine = edb93xx_init_machine, |
306 | .init_late = ep93xx_init_late, | 306 | .init_late = ep93xx_init_late, |
307 | .restart = ep93xx_restart, | 307 | .restart = ep93xx_restart, |
@@ -314,7 +314,7 @@ MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board") | |||
314 | .atag_offset = 0x100, | 314 | .atag_offset = 0x100, |
315 | .map_io = ep93xx_map_io, | 315 | .map_io = ep93xx_map_io, |
316 | .init_irq = ep93xx_init_irq, | 316 | .init_irq = ep93xx_init_irq, |
317 | .timer = &ep93xx_timer, | 317 | .init_time = ep93xx_timer_init, |
318 | .init_machine = edb93xx_init_machine, | 318 | .init_machine = edb93xx_init_machine, |
319 | .init_late = ep93xx_init_late, | 319 | .init_late = ep93xx_init_late, |
320 | .restart = ep93xx_restart, | 320 | .restart = ep93xx_restart, |
@@ -327,7 +327,7 @@ MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board") | |||
327 | .atag_offset = 0x100, | 327 | .atag_offset = 0x100, |
328 | .map_io = ep93xx_map_io, | 328 | .map_io = ep93xx_map_io, |
329 | .init_irq = ep93xx_init_irq, | 329 | .init_irq = ep93xx_init_irq, |
330 | .timer = &ep93xx_timer, | 330 | .init_time = ep93xx_timer_init, |
331 | .init_machine = edb93xx_init_machine, | 331 | .init_machine = edb93xx_init_machine, |
332 | .init_late = ep93xx_init_late, | 332 | .init_late = ep93xx_init_late, |
333 | .restart = ep93xx_restart, | 333 | .restart = ep93xx_restart, |
@@ -340,7 +340,7 @@ MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board") | |||
340 | .atag_offset = 0x100, | 340 | .atag_offset = 0x100, |
341 | .map_io = ep93xx_map_io, | 341 | .map_io = ep93xx_map_io, |
342 | .init_irq = ep93xx_init_irq, | 342 | .init_irq = ep93xx_init_irq, |
343 | .timer = &ep93xx_timer, | 343 | .init_time = ep93xx_timer_init, |
344 | .init_machine = edb93xx_init_machine, | 344 | .init_machine = edb93xx_init_machine, |
345 | .init_late = ep93xx_init_late, | 345 | .init_late = ep93xx_init_late, |
346 | .restart = ep93xx_restart, | 346 | .restart = ep93xx_restart, |
@@ -353,7 +353,7 @@ MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board") | |||
353 | .atag_offset = 0x100, | 353 | .atag_offset = 0x100, |
354 | .map_io = ep93xx_map_io, | 354 | .map_io = ep93xx_map_io, |
355 | .init_irq = ep93xx_init_irq, | 355 | .init_irq = ep93xx_init_irq, |
356 | .timer = &ep93xx_timer, | 356 | .init_time = ep93xx_timer_init, |
357 | .init_machine = edb93xx_init_machine, | 357 | .init_machine = edb93xx_init_machine, |
358 | .init_late = ep93xx_init_late, | 358 | .init_late = ep93xx_init_late, |
359 | .restart = ep93xx_restart, | 359 | .restart = ep93xx_restart, |
@@ -366,7 +366,7 @@ MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board") | |||
366 | .atag_offset = 0x100, | 366 | .atag_offset = 0x100, |
367 | .map_io = ep93xx_map_io, | 367 | .map_io = ep93xx_map_io, |
368 | .init_irq = ep93xx_init_irq, | 368 | .init_irq = ep93xx_init_irq, |
369 | .timer = &ep93xx_timer, | 369 | .init_time = ep93xx_timer_init, |
370 | .init_machine = edb93xx_init_machine, | 370 | .init_machine = edb93xx_init_machine, |
371 | .init_late = ep93xx_init_late, | 371 | .init_late = ep93xx_init_late, |
372 | .restart = ep93xx_restart, | 372 | .restart = ep93xx_restart, |
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c index 2a7375be6fff..0cca5b183309 100644 --- a/arch/arm/mach-ep93xx/gesbc9312.c +++ b/arch/arm/mach-ep93xx/gesbc9312.c | |||
@@ -38,7 +38,7 @@ MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx") | |||
38 | .atag_offset = 0x100, | 38 | .atag_offset = 0x100, |
39 | .map_io = ep93xx_map_io, | 39 | .map_io = ep93xx_map_io, |
40 | .init_irq = ep93xx_init_irq, | 40 | .init_irq = ep93xx_init_irq, |
41 | .timer = &ep93xx_timer, | 41 | .init_time = ep93xx_timer_init, |
42 | .init_machine = gesbc9312_init_machine, | 42 | .init_machine = gesbc9312_init_machine, |
43 | .init_late = ep93xx_init_late, | 43 | .init_late = ep93xx_init_late, |
44 | .restart = ep93xx_restart, | 44 | .restart = ep93xx_restart, |
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index 33a5122c6dc8..a14e1b37beff 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h | |||
@@ -53,7 +53,7 @@ int ep93xx_ide_acquire_gpio(struct platform_device *pdev); | |||
53 | void ep93xx_ide_release_gpio(struct platform_device *pdev); | 53 | void ep93xx_ide_release_gpio(struct platform_device *pdev); |
54 | 54 | ||
55 | void ep93xx_init_devices(void); | 55 | void ep93xx_init_devices(void); |
56 | extern struct sys_timer ep93xx_timer; | 56 | extern void ep93xx_timer_init(void); |
57 | 57 | ||
58 | void ep93xx_restart(char, const char *); | 58 | void ep93xx_restart(char, const char *); |
59 | void ep93xx_init_late(void); | 59 | void ep93xx_init_late(void); |
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c index 723c0d36a609..373583c29825 100644 --- a/arch/arm/mach-ep93xx/micro9.c +++ b/arch/arm/mach-ep93xx/micro9.c | |||
@@ -81,7 +81,7 @@ MACHINE_START(MICRO9, "Contec Micro9-High") | |||
81 | .atag_offset = 0x100, | 81 | .atag_offset = 0x100, |
82 | .map_io = ep93xx_map_io, | 82 | .map_io = ep93xx_map_io, |
83 | .init_irq = ep93xx_init_irq, | 83 | .init_irq = ep93xx_init_irq, |
84 | .timer = &ep93xx_timer, | 84 | .init_time = ep93xx_timer_init, |
85 | .init_machine = micro9_init_machine, | 85 | .init_machine = micro9_init_machine, |
86 | .init_late = ep93xx_init_late, | 86 | .init_late = ep93xx_init_late, |
87 | .restart = ep93xx_restart, | 87 | .restart = ep93xx_restart, |
@@ -94,7 +94,7 @@ MACHINE_START(MICRO9M, "Contec Micro9-Mid") | |||
94 | .atag_offset = 0x100, | 94 | .atag_offset = 0x100, |
95 | .map_io = ep93xx_map_io, | 95 | .map_io = ep93xx_map_io, |
96 | .init_irq = ep93xx_init_irq, | 96 | .init_irq = ep93xx_init_irq, |
97 | .timer = &ep93xx_timer, | 97 | .init_time = ep93xx_timer_init, |
98 | .init_machine = micro9_init_machine, | 98 | .init_machine = micro9_init_machine, |
99 | .init_late = ep93xx_init_late, | 99 | .init_late = ep93xx_init_late, |
100 | .restart = ep93xx_restart, | 100 | .restart = ep93xx_restart, |
@@ -107,7 +107,7 @@ MACHINE_START(MICRO9L, "Contec Micro9-Lite") | |||
107 | .atag_offset = 0x100, | 107 | .atag_offset = 0x100, |
108 | .map_io = ep93xx_map_io, | 108 | .map_io = ep93xx_map_io, |
109 | .init_irq = ep93xx_init_irq, | 109 | .init_irq = ep93xx_init_irq, |
110 | .timer = &ep93xx_timer, | 110 | .init_time = ep93xx_timer_init, |
111 | .init_machine = micro9_init_machine, | 111 | .init_machine = micro9_init_machine, |
112 | .init_late = ep93xx_init_late, | 112 | .init_late = ep93xx_init_late, |
113 | .restart = ep93xx_restart, | 113 | .restart = ep93xx_restart, |
@@ -120,7 +120,7 @@ MACHINE_START(MICRO9S, "Contec Micro9-Slim") | |||
120 | .atag_offset = 0x100, | 120 | .atag_offset = 0x100, |
121 | .map_io = ep93xx_map_io, | 121 | .map_io = ep93xx_map_io, |
122 | .init_irq = ep93xx_init_irq, | 122 | .init_irq = ep93xx_init_irq, |
123 | .timer = &ep93xx_timer, | 123 | .init_time = ep93xx_timer_init, |
124 | .init_machine = micro9_init_machine, | 124 | .init_machine = micro9_init_machine, |
125 | .init_late = ep93xx_init_late, | 125 | .init_late = ep93xx_init_late, |
126 | .restart = ep93xx_restart, | 126 | .restart = ep93xx_restart, |
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c index 651a7db05120..36f22c1a31fe 100644 --- a/arch/arm/mach-ep93xx/simone.c +++ b/arch/arm/mach-ep93xx/simone.c | |||
@@ -82,7 +82,7 @@ MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board") | |||
82 | .atag_offset = 0x100, | 82 | .atag_offset = 0x100, |
83 | .map_io = ep93xx_map_io, | 83 | .map_io = ep93xx_map_io, |
84 | .init_irq = ep93xx_init_irq, | 84 | .init_irq = ep93xx_init_irq, |
85 | .timer = &ep93xx_timer, | 85 | .init_time = ep93xx_timer_init, |
86 | .init_machine = simone_init_machine, | 86 | .init_machine = simone_init_machine, |
87 | .init_late = ep93xx_init_late, | 87 | .init_late = ep93xx_init_late, |
88 | .restart = ep93xx_restart, | 88 | .restart = ep93xx_restart, |
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c index b4389d3820cc..aa86f86638dd 100644 --- a/arch/arm/mach-ep93xx/snappercl15.c +++ b/arch/arm/mach-ep93xx/snappercl15.c | |||
@@ -175,7 +175,7 @@ MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15") | |||
175 | .atag_offset = 0x100, | 175 | .atag_offset = 0x100, |
176 | .map_io = ep93xx_map_io, | 176 | .map_io = ep93xx_map_io, |
177 | .init_irq = ep93xx_init_irq, | 177 | .init_irq = ep93xx_init_irq, |
178 | .timer = &ep93xx_timer, | 178 | .init_time = ep93xx_timer_init, |
179 | .init_machine = snappercl15_init_machine, | 179 | .init_machine = snappercl15_init_machine, |
180 | .init_late = ep93xx_init_late, | 180 | .init_late = ep93xx_init_late, |
181 | .restart = ep93xx_restart, | 181 | .restart = ep93xx_restart, |
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index 1eeee09f421f..61f4b5dc4d7d 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c | |||
@@ -245,7 +245,7 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC") | |||
245 | .atag_offset = 0x100, | 245 | .atag_offset = 0x100, |
246 | .map_io = ts72xx_map_io, | 246 | .map_io = ts72xx_map_io, |
247 | .init_irq = ep93xx_init_irq, | 247 | .init_irq = ep93xx_init_irq, |
248 | .timer = &ep93xx_timer, | 248 | .init_time = ep93xx_timer_init, |
249 | .init_machine = ts72xx_init_machine, | 249 | .init_machine = ts72xx_init_machine, |
250 | .init_late = ep93xx_init_late, | 250 | .init_late = ep93xx_init_late, |
251 | .restart = ep93xx_restart, | 251 | .restart = ep93xx_restart, |
diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c index 723d048176db..605956fd07a2 100644 --- a/arch/arm/mach-ep93xx/vision_ep9307.c +++ b/arch/arm/mach-ep93xx/vision_ep9307.c | |||
@@ -363,7 +363,7 @@ MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307") | |||
363 | .atag_offset = 0x100, | 363 | .atag_offset = 0x100, |
364 | .map_io = vision_map_io, | 364 | .map_io = vision_map_io, |
365 | .init_irq = ep93xx_init_irq, | 365 | .init_irq = ep93xx_init_irq, |
366 | .timer = &ep93xx_timer, | 366 | .init_time = ep93xx_timer_init, |
367 | .init_machine = vision_init_machine, | 367 | .init_machine = vision_init_machine, |
368 | .init_late = ep93xx_init_late, | 368 | .init_late = ep93xx_init_late, |
369 | .restart = ep93xx_restart, | 369 | .restart = ep93xx_restart, |
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index e103c290bc9e..85afb031b676 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig | |||
@@ -414,7 +414,7 @@ config MACH_EXYNOS4_DT | |||
414 | select CPU_EXYNOS4210 | 414 | select CPU_EXYNOS4210 |
415 | select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD | 415 | select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD |
416 | select PINCTRL | 416 | select PINCTRL |
417 | select PINCTRL_EXYNOS4 | 417 | select PINCTRL_EXYNOS |
418 | select USE_OF | 418 | select USE_OF |
419 | help | 419 | help |
420 | Machine support for Samsung Exynos4 machine with device tree enabled. | 420 | Machine support for Samsung Exynos4 machine with device tree enabled. |
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 04744f9c120f..12f2f1117e99 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H | 12 | #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H |
13 | #define __ARCH_ARM_MACH_EXYNOS_COMMON_H | 13 | #define __ARCH_ARM_MACH_EXYNOS_COMMON_H |
14 | 14 | ||
15 | extern struct sys_timer exynos4_timer; | 15 | extern void exynos4_timer_init(void); |
16 | 16 | ||
17 | struct map_desc; | 17 | struct map_desc; |
18 | void exynos_init_io(struct map_desc *mach_desc, int size); | 18 | void exynos_init_io(struct map_desc *mach_desc, int size); |
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c b/arch/arm/mach-exynos/mach-armlex4210.c index a11a36fc7bf5..685f29173afa 100644 --- a/arch/arm/mach-exynos/mach-armlex4210.c +++ b/arch/arm/mach-exynos/mach-armlex4210.c | |||
@@ -202,6 +202,6 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210") | |||
202 | .map_io = armlex4210_map_io, | 202 | .map_io = armlex4210_map_io, |
203 | .init_machine = armlex4210_machine_init, | 203 | .init_machine = armlex4210_machine_init, |
204 | .init_late = exynos_init_late, | 204 | .init_late = exynos_init_late, |
205 | .timer = &exynos4_timer, | 205 | .init_time = exynos4_timer_init, |
206 | .restart = exynos4_restart, | 206 | .restart = exynos4_restart, |
207 | MACHINE_END | 207 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index 34c45b6c8b2c..112d10e53d20 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c | |||
@@ -108,7 +108,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") | |||
108 | .map_io = exynos4_dt_map_io, | 108 | .map_io = exynos4_dt_map_io, |
109 | .init_machine = exynos4_dt_machine_init, | 109 | .init_machine = exynos4_dt_machine_init, |
110 | .init_late = exynos_init_late, | 110 | .init_late = exynos_init_late, |
111 | .timer = &exynos4_timer, | 111 | .init_time = exynos4_timer_init, |
112 | .dt_compat = exynos4_dt_compat, | 112 | .dt_compat = exynos4_dt_compat, |
113 | .restart = exynos4_restart, | 113 | .restart = exynos4_restart, |
114 | MACHINE_END | 114 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index 3a3bee463c46..0deeecffa3ae 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c | |||
@@ -180,7 +180,7 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") | |||
180 | .map_io = exynos5_dt_map_io, | 180 | .map_io = exynos5_dt_map_io, |
181 | .init_machine = exynos5_dt_machine_init, | 181 | .init_machine = exynos5_dt_machine_init, |
182 | .init_late = exynos_init_late, | 182 | .init_late = exynos_init_late, |
183 | .timer = &exynos4_timer, | 183 | .init_time = exynos4_timer_init, |
184 | .dt_compat = exynos5_dt_compat, | 184 | .dt_compat = exynos5_dt_compat, |
185 | .restart = exynos5_restart, | 185 | .restart = exynos5_restart, |
186 | .reserve = exynos5_reserve, | 186 | .reserve = exynos5_reserve, |
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c index 55f8183e1d6f..b8b3fbf0bae7 100644 --- a/arch/arm/mach-exynos/mach-nuri.c +++ b/arch/arm/mach-exynos/mach-nuri.c | |||
@@ -1380,7 +1380,7 @@ MACHINE_START(NURI, "NURI") | |||
1380 | .map_io = nuri_map_io, | 1380 | .map_io = nuri_map_io, |
1381 | .init_machine = nuri_machine_init, | 1381 | .init_machine = nuri_machine_init, |
1382 | .init_late = exynos_init_late, | 1382 | .init_late = exynos_init_late, |
1383 | .timer = &exynos4_timer, | 1383 | .init_time = exynos4_timer_init, |
1384 | .reserve = &nuri_reserve, | 1384 | .reserve = &nuri_reserve, |
1385 | .restart = exynos4_restart, | 1385 | .restart = exynos4_restart, |
1386 | MACHINE_END | 1386 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c index 45cda369923e..579d2d171daa 100644 --- a/arch/arm/mach-exynos/mach-origen.c +++ b/arch/arm/mach-exynos/mach-origen.c | |||
@@ -815,7 +815,7 @@ MACHINE_START(ORIGEN, "ORIGEN") | |||
815 | .map_io = origen_map_io, | 815 | .map_io = origen_map_io, |
816 | .init_machine = origen_machine_init, | 816 | .init_machine = origen_machine_init, |
817 | .init_late = exynos_init_late, | 817 | .init_late = exynos_init_late, |
818 | .timer = &exynos4_timer, | 818 | .init_time = exynos4_timer_init, |
819 | .reserve = &origen_reserve, | 819 | .reserve = &origen_reserve, |
820 | .restart = exynos4_restart, | 820 | .restart = exynos4_restart, |
821 | MACHINE_END | 821 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c index d5dbd51b26e3..fe6149624b84 100644 --- a/arch/arm/mach-exynos/mach-smdk4x12.c +++ b/arch/arm/mach-exynos/mach-smdk4x12.c | |||
@@ -376,7 +376,7 @@ MACHINE_START(SMDK4212, "SMDK4212") | |||
376 | .init_irq = exynos4_init_irq, | 376 | .init_irq = exynos4_init_irq, |
377 | .map_io = smdk4x12_map_io, | 377 | .map_io = smdk4x12_map_io, |
378 | .init_machine = smdk4x12_machine_init, | 378 | .init_machine = smdk4x12_machine_init, |
379 | .timer = &exynos4_timer, | 379 | .init_time = exynos4_timer_init, |
380 | .restart = exynos4_restart, | 380 | .restart = exynos4_restart, |
381 | .reserve = &smdk4x12_reserve, | 381 | .reserve = &smdk4x12_reserve, |
382 | MACHINE_END | 382 | MACHINE_END |
@@ -390,7 +390,7 @@ MACHINE_START(SMDK4412, "SMDK4412") | |||
390 | .map_io = smdk4x12_map_io, | 390 | .map_io = smdk4x12_map_io, |
391 | .init_machine = smdk4x12_machine_init, | 391 | .init_machine = smdk4x12_machine_init, |
392 | .init_late = exynos_init_late, | 392 | .init_late = exynos_init_late, |
393 | .timer = &exynos4_timer, | 393 | .init_time = exynos4_timer_init, |
394 | .restart = exynos4_restart, | 394 | .restart = exynos4_restart, |
395 | .reserve = &smdk4x12_reserve, | 395 | .reserve = &smdk4x12_reserve, |
396 | MACHINE_END | 396 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c index b095964f2989..d71672922b19 100644 --- a/arch/arm/mach-exynos/mach-smdkv310.c +++ b/arch/arm/mach-exynos/mach-smdkv310.c | |||
@@ -423,7 +423,7 @@ MACHINE_START(SMDKV310, "SMDKV310") | |||
423 | .init_irq = exynos4_init_irq, | 423 | .init_irq = exynos4_init_irq, |
424 | .map_io = smdkv310_map_io, | 424 | .map_io = smdkv310_map_io, |
425 | .init_machine = smdkv310_machine_init, | 425 | .init_machine = smdkv310_machine_init, |
426 | .timer = &exynos4_timer, | 426 | .init_time = exynos4_timer_init, |
427 | .reserve = &smdkv310_reserve, | 427 | .reserve = &smdkv310_reserve, |
428 | .restart = exynos4_restart, | 428 | .restart = exynos4_restart, |
429 | MACHINE_END | 429 | MACHINE_END |
@@ -436,7 +436,7 @@ MACHINE_START(SMDKC210, "SMDKC210") | |||
436 | .map_io = smdkv310_map_io, | 436 | .map_io = smdkv310_map_io, |
437 | .init_machine = smdkv310_machine_init, | 437 | .init_machine = smdkv310_machine_init, |
438 | .init_late = exynos_init_late, | 438 | .init_late = exynos_init_late, |
439 | .timer = &exynos4_timer, | 439 | .init_time = exynos4_timer_init, |
440 | .reserve = &smdkv310_reserve, | 440 | .reserve = &smdkv310_reserve, |
441 | .restart = exynos4_restart, | 441 | .restart = exynos4_restart, |
442 | MACHINE_END | 442 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c index be3777587283..c9d33a43103e 100644 --- a/arch/arm/mach-exynos/mach-universal_c210.c +++ b/arch/arm/mach-exynos/mach-universal_c210.c | |||
@@ -1152,7 +1152,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") | |||
1152 | .map_io = universal_map_io, | 1152 | .map_io = universal_map_io, |
1153 | .init_machine = universal_machine_init, | 1153 | .init_machine = universal_machine_init, |
1154 | .init_late = exynos_init_late, | 1154 | .init_late = exynos_init_late, |
1155 | .timer = &s5p_timer, | 1155 | .init_time = s5p_timer_init, |
1156 | .reserve = &universal_reserve, | 1156 | .reserve = &universal_reserve, |
1157 | .restart = exynos4_restart, | 1157 | .restart = exynos4_restart, |
1158 | MACHINE_END | 1158 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c index baefe9b0be14..c9d6650f9b5d 100644 --- a/arch/arm/mach-exynos/mct.c +++ b/arch/arm/mach-exynos/mct.c | |||
@@ -254,13 +254,9 @@ static struct irqaction mct_comp_event_irq = { | |||
254 | 254 | ||
255 | static void exynos4_clockevent_init(void) | 255 | static void exynos4_clockevent_init(void) |
256 | { | 256 | { |
257 | clockevents_calc_mult_shift(&mct_comp_device, clk_rate, 5); | ||
258 | mct_comp_device.max_delta_ns = | ||
259 | clockevent_delta2ns(0xffffffff, &mct_comp_device); | ||
260 | mct_comp_device.min_delta_ns = | ||
261 | clockevent_delta2ns(0xf, &mct_comp_device); | ||
262 | mct_comp_device.cpumask = cpumask_of(0); | 257 | mct_comp_device.cpumask = cpumask_of(0); |
263 | clockevents_register_device(&mct_comp_device); | 258 | clockevents_config_and_register(&mct_comp_device, clk_rate, |
259 | 0xf, 0xffffffff); | ||
264 | 260 | ||
265 | if (soc_is_exynos5250()) | 261 | if (soc_is_exynos5250()) |
266 | setup_irq(EXYNOS5_IRQ_MCT_G0, &mct_comp_event_irq); | 262 | setup_irq(EXYNOS5_IRQ_MCT_G0, &mct_comp_event_irq); |
@@ -403,14 +399,8 @@ static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt) | |||
403 | evt->set_mode = exynos4_tick_set_mode; | 399 | evt->set_mode = exynos4_tick_set_mode; |
404 | evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; | 400 | evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; |
405 | evt->rating = 450; | 401 | evt->rating = 450; |
406 | 402 | clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1), | |
407 | clockevents_calc_mult_shift(evt, clk_rate / (TICK_BASE_CNT + 1), 5); | 403 | 0xf, 0x7fffffff); |
408 | evt->max_delta_ns = | ||
409 | clockevent_delta2ns(0x7fffffff, evt); | ||
410 | evt->min_delta_ns = | ||
411 | clockevent_delta2ns(0xf, evt); | ||
412 | |||
413 | clockevents_register_device(evt); | ||
414 | 404 | ||
415 | exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); | 405 | exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); |
416 | 406 | ||
@@ -477,7 +467,7 @@ static void __init exynos4_timer_resources(void) | |||
477 | #endif /* CONFIG_LOCAL_TIMERS */ | 467 | #endif /* CONFIG_LOCAL_TIMERS */ |
478 | } | 468 | } |
479 | 469 | ||
480 | static void __init exynos_timer_init(void) | 470 | void __init exynos4_timer_init(void) |
481 | { | 471 | { |
482 | if (soc_is_exynos5440()) { | 472 | if (soc_is_exynos5440()) { |
483 | arch_timer_of_register(); | 473 | arch_timer_of_register(); |
@@ -493,7 +483,3 @@ static void __init exynos_timer_init(void) | |||
493 | exynos4_clocksource_init(); | 483 | exynos4_clocksource_init(); |
494 | exynos4_clockevent_init(); | 484 | exynos4_clockevent_init(); |
495 | } | 485 | } |
496 | |||
497 | struct sys_timer exynos4_timer = { | ||
498 | .init = exynos_timer_init, | ||
499 | }; | ||
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c index 25b453601acc..6987a09ec219 100644 --- a/arch/arm/mach-footbridge/cats-hw.c +++ b/arch/arm/mach-footbridge/cats-hw.c | |||
@@ -90,6 +90,6 @@ MACHINE_START(CATS, "Chalice-CATS") | |||
90 | .fixup = fixup_cats, | 90 | .fixup = fixup_cats, |
91 | .map_io = footbridge_map_io, | 91 | .map_io = footbridge_map_io, |
92 | .init_irq = footbridge_init_irq, | 92 | .init_irq = footbridge_init_irq, |
93 | .timer = &isa_timer, | 93 | .init_time = isa_timer_init, |
94 | .restart = footbridge_restart, | 94 | .restart = footbridge_restart, |
95 | MACHINE_END | 95 | MACHINE_END |
diff --git a/arch/arm/mach-footbridge/common.h b/arch/arm/mach-footbridge/common.h index c9767b892cb2..a846e50a07b8 100644 --- a/arch/arm/mach-footbridge/common.h +++ b/arch/arm/mach-footbridge/common.h | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | extern struct sys_timer footbridge_timer; | 2 | extern void footbridge_timer_init(void); |
3 | extern struct sys_timer isa_timer; | 3 | extern void isa_timer_init(void); |
4 | 4 | ||
5 | extern void isa_rtc_init(void); | 5 | extern void isa_rtc_init(void); |
6 | 6 | ||
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c index 3b54196447c7..9ee78f7b4990 100644 --- a/arch/arm/mach-footbridge/dc21285-timer.c +++ b/arch/arm/mach-footbridge/dc21285-timer.c | |||
@@ -93,7 +93,7 @@ static struct irqaction footbridge_timer_irq = { | |||
93 | /* | 93 | /* |
94 | * Set up timer interrupt. | 94 | * Set up timer interrupt. |
95 | */ | 95 | */ |
96 | static void __init footbridge_timer_init(void) | 96 | void __init footbridge_timer_init(void) |
97 | { | 97 | { |
98 | struct clock_event_device *ce = &ckevt_dc21285; | 98 | struct clock_event_device *ce = &ckevt_dc21285; |
99 | 99 | ||
@@ -101,14 +101,6 @@ static void __init footbridge_timer_init(void) | |||
101 | 101 | ||
102 | setup_irq(ce->irq, &footbridge_timer_irq); | 102 | setup_irq(ce->irq, &footbridge_timer_irq); |
103 | 103 | ||
104 | clockevents_calc_mult_shift(ce, mem_fclk_21285, 5); | ||
105 | ce->max_delta_ns = clockevent_delta2ns(0xffffff, ce); | ||
106 | ce->min_delta_ns = clockevent_delta2ns(0x000004, ce); | ||
107 | ce->cpumask = cpumask_of(smp_processor_id()); | 104 | ce->cpumask = cpumask_of(smp_processor_id()); |
108 | 105 | clockevents_config_and_register(ce, mem_fclk_21285, 0x4, 0xffffff); | |
109 | clockevents_register_device(ce); | ||
110 | } | 106 | } |
111 | |||
112 | struct sys_timer footbridge_timer = { | ||
113 | .init = footbridge_timer_init, | ||
114 | }; | ||
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c index b09551ef89ca..b08243500e2e 100644 --- a/arch/arm/mach-footbridge/ebsa285.c +++ b/arch/arm/mach-footbridge/ebsa285.c | |||
@@ -101,7 +101,7 @@ MACHINE_START(EBSA285, "EBSA285") | |||
101 | .video_end = 0x000bffff, | 101 | .video_end = 0x000bffff, |
102 | .map_io = footbridge_map_io, | 102 | .map_io = footbridge_map_io, |
103 | .init_irq = footbridge_init_irq, | 103 | .init_irq = footbridge_init_irq, |
104 | .timer = &footbridge_timer, | 104 | .init_time = footbridge_timer_init, |
105 | .restart = footbridge_restart, | 105 | .restart = footbridge_restart, |
106 | MACHINE_END | 106 | MACHINE_END |
107 | 107 | ||
diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c index c40bb415f4b5..d9301dd56354 100644 --- a/arch/arm/mach-footbridge/isa-timer.c +++ b/arch/arm/mach-footbridge/isa-timer.c | |||
@@ -31,14 +31,10 @@ static struct irqaction pit_timer_irq = { | |||
31 | .dev_id = &i8253_clockevent, | 31 | .dev_id = &i8253_clockevent, |
32 | }; | 32 | }; |
33 | 33 | ||
34 | static void __init isa_timer_init(void) | 34 | void __init isa_timer_init(void) |
35 | { | 35 | { |
36 | clocksource_i8253_init(); | 36 | clocksource_i8253_init(); |
37 | 37 | ||
38 | setup_irq(i8253_clockevent.irq, &pit_timer_irq); | 38 | setup_irq(i8253_clockevent.irq, &pit_timer_irq); |
39 | clockevent_i8253_init(false); | 39 | clockevent_i8253_init(false); |
40 | } | 40 | } |
41 | |||
42 | struct sys_timer isa_timer = { | ||
43 | .init = isa_timer_init, | ||
44 | }; | ||
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c index d2d14339c6c4..90ea23fdce4c 100644 --- a/arch/arm/mach-footbridge/netwinder-hw.c +++ b/arch/arm/mach-footbridge/netwinder-hw.c | |||
@@ -766,6 +766,6 @@ MACHINE_START(NETWINDER, "Rebel-NetWinder") | |||
766 | .fixup = fixup_netwinder, | 766 | .fixup = fixup_netwinder, |
767 | .map_io = footbridge_map_io, | 767 | .map_io = footbridge_map_io, |
768 | .init_irq = footbridge_init_irq, | 768 | .init_irq = footbridge_init_irq, |
769 | .timer = &isa_timer, | 769 | .init_time = isa_timer_init, |
770 | .restart = netwinder_restart, | 770 | .restart = netwinder_restart, |
771 | MACHINE_END | 771 | MACHINE_END |
diff --git a/arch/arm/mach-footbridge/personal.c b/arch/arm/mach-footbridge/personal.c index e1e9990fa957..7bdeabdcd4d8 100644 --- a/arch/arm/mach-footbridge/personal.c +++ b/arch/arm/mach-footbridge/personal.c | |||
@@ -18,7 +18,7 @@ MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer") | |||
18 | .atag_offset = 0x100, | 18 | .atag_offset = 0x100, |
19 | .map_io = footbridge_map_io, | 19 | .map_io = footbridge_map_io, |
20 | .init_irq = footbridge_init_irq, | 20 | .init_irq = footbridge_init_irq, |
21 | .timer = &footbridge_timer, | 21 | .init_time = footbridge_timer_init, |
22 | .restart = footbridge_restart, | 22 | .restart = footbridge_restart, |
23 | MACHINE_END | 23 | MACHINE_END |
24 | 24 | ||
diff --git a/arch/arm/mach-gemini/board-nas4220b.c b/arch/arm/mach-gemini/board-nas4220b.c index 5927d3c253aa..08bd650c42f3 100644 --- a/arch/arm/mach-gemini/board-nas4220b.c +++ b/arch/arm/mach-gemini/board-nas4220b.c | |||
@@ -31,10 +31,6 @@ | |||
31 | 31 | ||
32 | #include "common.h" | 32 | #include "common.h" |
33 | 33 | ||
34 | static struct sys_timer ib4220b_timer = { | ||
35 | .init = gemini_timer_init, | ||
36 | }; | ||
37 | |||
38 | static struct gpio_led ib4220b_leds[] = { | 34 | static struct gpio_led ib4220b_leds[] = { |
39 | { | 35 | { |
40 | .name = "nas4220b:orange:hdd", | 36 | .name = "nas4220b:orange:hdd", |
@@ -105,6 +101,6 @@ MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B") | |||
105 | .atag_offset = 0x100, | 101 | .atag_offset = 0x100, |
106 | .map_io = gemini_map_io, | 102 | .map_io = gemini_map_io, |
107 | .init_irq = gemini_init_irq, | 103 | .init_irq = gemini_init_irq, |
108 | .timer = &ib4220b_timer, | 104 | .init_time = gemini_timer_init, |
109 | .init_machine = ib4220b_init, | 105 | .init_machine = ib4220b_init, |
110 | MACHINE_END | 106 | MACHINE_END |
diff --git a/arch/arm/mach-gemini/board-rut1xx.c b/arch/arm/mach-gemini/board-rut1xx.c index cd7437a1cea0..fa0a36337f4d 100644 --- a/arch/arm/mach-gemini/board-rut1xx.c +++ b/arch/arm/mach-gemini/board-rut1xx.c | |||
@@ -71,10 +71,6 @@ static struct platform_device rut1xx_leds = { | |||
71 | }, | 71 | }, |
72 | }; | 72 | }; |
73 | 73 | ||
74 | static struct sys_timer rut1xx_timer = { | ||
75 | .init = gemini_timer_init, | ||
76 | }; | ||
77 | |||
78 | static void __init rut1xx_init(void) | 74 | static void __init rut1xx_init(void) |
79 | { | 75 | { |
80 | gemini_gpio_init(); | 76 | gemini_gpio_init(); |
@@ -89,6 +85,6 @@ MACHINE_START(RUT100, "Teltonika RUT100") | |||
89 | .atag_offset = 0x100, | 85 | .atag_offset = 0x100, |
90 | .map_io = gemini_map_io, | 86 | .map_io = gemini_map_io, |
91 | .init_irq = gemini_init_irq, | 87 | .init_irq = gemini_init_irq, |
92 | .timer = &rut1xx_timer, | 88 | .init_time = gemini_timer_init, |
93 | .init_machine = rut1xx_init, | 89 | .init_machine = rut1xx_init, |
94 | MACHINE_END | 90 | MACHINE_END |
diff --git a/arch/arm/mach-gemini/board-wbd111.c b/arch/arm/mach-gemini/board-wbd111.c index a367880368f1..3321cd6cc1f3 100644 --- a/arch/arm/mach-gemini/board-wbd111.c +++ b/arch/arm/mach-gemini/board-wbd111.c | |||
@@ -80,10 +80,6 @@ static struct platform_device wbd111_leds_device = { | |||
80 | }, | 80 | }, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static struct sys_timer wbd111_timer = { | ||
84 | .init = gemini_timer_init, | ||
85 | }; | ||
86 | |||
87 | static struct mtd_partition wbd111_partitions[] = { | 83 | static struct mtd_partition wbd111_partitions[] = { |
88 | { | 84 | { |
89 | .name = "RedBoot", | 85 | .name = "RedBoot", |
@@ -132,6 +128,6 @@ MACHINE_START(WBD111, "Wiliboard WBD-111") | |||
132 | .atag_offset = 0x100, | 128 | .atag_offset = 0x100, |
133 | .map_io = gemini_map_io, | 129 | .map_io = gemini_map_io, |
134 | .init_irq = gemini_init_irq, | 130 | .init_irq = gemini_init_irq, |
135 | .timer = &wbd111_timer, | 131 | .init_time = gemini_timer_init, |
136 | .init_machine = wbd111_init, | 132 | .init_machine = wbd111_init, |
137 | MACHINE_END | 133 | MACHINE_END |
diff --git a/arch/arm/mach-gemini/board-wbd222.c b/arch/arm/mach-gemini/board-wbd222.c index f382811c1319..fe33c825fdaf 100644 --- a/arch/arm/mach-gemini/board-wbd222.c +++ b/arch/arm/mach-gemini/board-wbd222.c | |||
@@ -80,10 +80,6 @@ static struct platform_device wbd222_leds_device = { | |||
80 | }, | 80 | }, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static struct sys_timer wbd222_timer = { | ||
84 | .init = gemini_timer_init, | ||
85 | }; | ||
86 | |||
87 | static struct mtd_partition wbd222_partitions[] = { | 83 | static struct mtd_partition wbd222_partitions[] = { |
88 | { | 84 | { |
89 | .name = "RedBoot", | 85 | .name = "RedBoot", |
@@ -132,6 +128,6 @@ MACHINE_START(WBD222, "Wiliboard WBD-222") | |||
132 | .atag_offset = 0x100, | 128 | .atag_offset = 0x100, |
133 | .map_io = gemini_map_io, | 129 | .map_io = gemini_map_io, |
134 | .init_irq = gemini_init_irq, | 130 | .init_irq = gemini_init_irq, |
135 | .timer = &wbd222_timer, | 131 | .init_time = gemini_timer_init, |
136 | .init_machine = wbd222_init, | 132 | .init_machine = wbd222_init, |
137 | MACHINE_END | 133 | MACHINE_END |
diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c index aa1331e86bcf..17ef91fa3d56 100644 --- a/arch/arm/mach-h720x/common.c +++ b/arch/arm/mach-h720x/common.c | |||
@@ -42,12 +42,12 @@ void __init arch_dma_init(dma_t *dma) | |||
42 | } | 42 | } |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * Return usecs since last timer reload | 45 | * Return nsecs since last timer reload |
46 | * (timercount * (usecs perjiffie)) / (ticks per jiffie) | 46 | * (timercount * (usecs perjiffie)) / (ticks per jiffie) |
47 | */ | 47 | */ |
48 | unsigned long h720x_gettimeoffset(void) | 48 | u32 h720x_gettimeoffset(void) |
49 | { | 49 | { |
50 | return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH; | 50 | return ((CPU_REG(TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH) * 1000; |
51 | } | 51 | } |
52 | 52 | ||
53 | /* | 53 | /* |
diff --git a/arch/arm/mach-h720x/common.h b/arch/arm/mach-h720x/common.h index 2489537d33dd..7e738410ca93 100644 --- a/arch/arm/mach-h720x/common.h +++ b/arch/arm/mach-h720x/common.h | |||
@@ -13,18 +13,18 @@ | |||
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
16 | extern unsigned long h720x_gettimeoffset(void); | 16 | extern u32 h720x_gettimeoffset(void); |
17 | extern void __init h720x_init_irq(void); | 17 | extern void __init h720x_init_irq(void); |
18 | extern void __init h720x_map_io(void); | 18 | extern void __init h720x_map_io(void); |
19 | extern void h720x_restart(char, const char *); | 19 | extern void h720x_restart(char, const char *); |
20 | 20 | ||
21 | #ifdef CONFIG_ARCH_H7202 | 21 | #ifdef CONFIG_ARCH_H7202 |
22 | extern struct sys_timer h7202_timer; | 22 | extern void h7202_timer_init(void); |
23 | extern void __init init_hw_h7202(void); | 23 | extern void __init init_hw_h7202(void); |
24 | extern void __init h7202_init_irq(void); | 24 | extern void __init h7202_init_irq(void); |
25 | extern void __init h7202_init_time(void); | 25 | extern void __init h7202_init_time(void); |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #ifdef CONFIG_ARCH_H7201 | 28 | #ifdef CONFIG_ARCH_H7201 |
29 | extern struct sys_timer h7201_timer; | 29 | extern void h7201_timer_init(void); |
30 | #endif | 30 | #endif |
diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c index 24df2a349a98..13c741215387 100644 --- a/arch/arm/mach-h720x/cpu-h7201.c +++ b/arch/arm/mach-h720x/cpu-h7201.c | |||
@@ -44,8 +44,10 @@ static struct irqaction h7201_timer_irq = { | |||
44 | /* | 44 | /* |
45 | * Setup TIMER0 as system timer | 45 | * Setup TIMER0 as system timer |
46 | */ | 46 | */ |
47 | void __init h7201_init_time(void) | 47 | void __init h7201_timer_init(void) |
48 | { | 48 | { |
49 | arch_gettimeoffset = h720x_gettimeoffset; | ||
50 | |||
49 | CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; | 51 | CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; |
50 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; | 52 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; |
51 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; | 53 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; |
@@ -53,8 +55,3 @@ void __init h7201_init_time(void) | |||
53 | 55 | ||
54 | setup_irq(IRQ_TIMER0, &h7201_timer_irq); | 56 | setup_irq(IRQ_TIMER0, &h7201_timer_irq); |
55 | } | 57 | } |
56 | |||
57 | struct sys_timer h7201_timer = { | ||
58 | .init = h7201_init_time, | ||
59 | .offset = h720x_gettimeoffset, | ||
60 | }; | ||
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c index c37d570b852d..e2ae7e898f9d 100644 --- a/arch/arm/mach-h720x/cpu-h7202.c +++ b/arch/arm/mach-h720x/cpu-h7202.c | |||
@@ -178,8 +178,10 @@ static struct irqaction h7202_timer_irq = { | |||
178 | /* | 178 | /* |
179 | * Setup TIMER0 as system timer | 179 | * Setup TIMER0 as system timer |
180 | */ | 180 | */ |
181 | void __init h7202_init_time(void) | 181 | void __init h7202_timer_init(void) |
182 | { | 182 | { |
183 | arch_gettimeoffset = h720x_gettimeoffset; | ||
184 | |||
183 | CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; | 185 | CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; |
184 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; | 186 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; |
185 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; | 187 | CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; |
@@ -188,11 +190,6 @@ void __init h7202_init_time(void) | |||
188 | setup_irq(IRQ_TIMER0, &h7202_timer_irq); | 190 | setup_irq(IRQ_TIMER0, &h7202_timer_irq); |
189 | } | 191 | } |
190 | 192 | ||
191 | struct sys_timer h7202_timer = { | ||
192 | .init = h7202_init_time, | ||
193 | .offset = h720x_gettimeoffset, | ||
194 | }; | ||
195 | |||
196 | void __init h7202_init_irq (void) | 193 | void __init h7202_init_irq (void) |
197 | { | 194 | { |
198 | int irq; | 195 | int irq; |
diff --git a/arch/arm/mach-h720x/h7201-eval.c b/arch/arm/mach-h720x/h7201-eval.c index 5fdb20c855e2..4fdeb686c0a9 100644 --- a/arch/arm/mach-h720x/h7201-eval.c +++ b/arch/arm/mach-h720x/h7201-eval.c | |||
@@ -32,7 +32,7 @@ MACHINE_START(H7201, "Hynix GMS30C7201") | |||
32 | .atag_offset = 0x1000, | 32 | .atag_offset = 0x1000, |
33 | .map_io = h720x_map_io, | 33 | .map_io = h720x_map_io, |
34 | .init_irq = h720x_init_irq, | 34 | .init_irq = h720x_init_irq, |
35 | .timer = &h7201_timer, | 35 | .init_time = h7201_timer_init, |
36 | .dma_zone_size = SZ_256M, | 36 | .dma_zone_size = SZ_256M, |
37 | .restart = h720x_restart, | 37 | .restart = h720x_restart, |
38 | MACHINE_END | 38 | MACHINE_END |
diff --git a/arch/arm/mach-h720x/h7202-eval.c b/arch/arm/mach-h720x/h7202-eval.c index 169673036c59..f68e967a2062 100644 --- a/arch/arm/mach-h720x/h7202-eval.c +++ b/arch/arm/mach-h720x/h7202-eval.c | |||
@@ -74,7 +74,7 @@ MACHINE_START(H7202, "Hynix HMS30C7202") | |||
74 | .atag_offset = 0x100, | 74 | .atag_offset = 0x100, |
75 | .map_io = h720x_map_io, | 75 | .map_io = h720x_map_io, |
76 | .init_irq = h7202_init_irq, | 76 | .init_irq = h7202_init_irq, |
77 | .timer = &h7202_timer, | 77 | .init_time = h7202_timer_init, |
78 | .init_machine = init_eval_h7202, | 78 | .init_machine = init_eval_h7202, |
79 | .dma_zone_size = SZ_256M, | 79 | .dma_zone_size = SZ_256M, |
80 | .restart = h720x_restart, | 80 | .restart = h720x_restart, |
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index f9191eacd0fc..fd630bccbd31 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c | |||
@@ -123,10 +123,6 @@ static void __init highbank_timer_init(void) | |||
123 | arch_timer_sched_clock_init(); | 123 | arch_timer_sched_clock_init(); |
124 | } | 124 | } |
125 | 125 | ||
126 | static struct sys_timer highbank_timer = { | ||
127 | .init = highbank_timer_init, | ||
128 | }; | ||
129 | |||
130 | static void highbank_power_off(void) | 126 | static void highbank_power_off(void) |
131 | { | 127 | { |
132 | highbank_set_pwr_shutdown(); | 128 | highbank_set_pwr_shutdown(); |
@@ -203,7 +199,7 @@ DT_MACHINE_START(HIGHBANK, "Highbank") | |||
203 | .smp = smp_ops(highbank_smp_ops), | 199 | .smp = smp_ops(highbank_smp_ops), |
204 | .map_io = debug_ll_io_init, | 200 | .map_io = debug_ll_io_init, |
205 | .init_irq = highbank_init_irq, | 201 | .init_irq = highbank_init_irq, |
206 | .timer = &highbank_timer, | 202 | .init_time = highbank_timer_init, |
207 | .init_machine = highbank_init, | 203 | .init_machine = highbank_init, |
208 | .dt_compat = highbank_match, | 204 | .dt_compat = highbank_match, |
209 | .restart = highbank_restart, | 205 | .restart = highbank_restart, |
diff --git a/arch/arm/mach-imx/epit.c b/arch/arm/mach-imx/epit.c index 04a5961beeac..e02de188ae83 100644 --- a/arch/arm/mach-imx/epit.c +++ b/arch/arm/mach-imx/epit.c | |||
@@ -178,7 +178,6 @@ static struct irqaction epit_timer_irq = { | |||
178 | static struct clock_event_device clockevent_epit = { | 178 | static struct clock_event_device clockevent_epit = { |
179 | .name = "epit", | 179 | .name = "epit", |
180 | .features = CLOCK_EVT_FEAT_ONESHOT, | 180 | .features = CLOCK_EVT_FEAT_ONESHOT, |
181 | .shift = 32, | ||
182 | .set_mode = epit_set_mode, | 181 | .set_mode = epit_set_mode, |
183 | .set_next_event = epit_set_next_event, | 182 | .set_next_event = epit_set_next_event, |
184 | .rating = 200, | 183 | .rating = 200, |
@@ -186,18 +185,10 @@ static struct clock_event_device clockevent_epit = { | |||
186 | 185 | ||
187 | static int __init epit_clockevent_init(struct clk *timer_clk) | 186 | static int __init epit_clockevent_init(struct clk *timer_clk) |
188 | { | 187 | { |
189 | unsigned int c = clk_get_rate(timer_clk); | ||
190 | |||
191 | clockevent_epit.mult = div_sc(c, NSEC_PER_SEC, | ||
192 | clockevent_epit.shift); | ||
193 | clockevent_epit.max_delta_ns = | ||
194 | clockevent_delta2ns(0xfffffffe, &clockevent_epit); | ||
195 | clockevent_epit.min_delta_ns = | ||
196 | clockevent_delta2ns(0x800, &clockevent_epit); | ||
197 | |||
198 | clockevent_epit.cpumask = cpumask_of(0); | 188 | clockevent_epit.cpumask = cpumask_of(0); |
199 | 189 | clockevents_config_and_register(&clockevent_epit, | |
200 | clockevents_register_device(&clockevent_epit); | 190 | clk_get_rate(timer_clk), |
191 | 0x800, 0xfffffffe); | ||
201 | 192 | ||
202 | return 0; | 193 | return 0; |
203 | } | 194 | } |
diff --git a/arch/arm/mach-imx/imx25-dt.c b/arch/arm/mach-imx/imx25-dt.c index e17dfbc42192..03b65e5ea541 100644 --- a/arch/arm/mach-imx/imx25-dt.c +++ b/arch/arm/mach-imx/imx25-dt.c | |||
@@ -22,15 +22,6 @@ static void __init imx25_dt_init(void) | |||
22 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 22 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
23 | } | 23 | } |
24 | 24 | ||
25 | static void __init imx25_timer_init(void) | ||
26 | { | ||
27 | mx25_clocks_init_dt(); | ||
28 | } | ||
29 | |||
30 | static struct sys_timer imx25_timer = { | ||
31 | .init = imx25_timer_init, | ||
32 | }; | ||
33 | |||
34 | static const char * const imx25_dt_board_compat[] __initconst = { | 25 | static const char * const imx25_dt_board_compat[] __initconst = { |
35 | "fsl,imx25", | 26 | "fsl,imx25", |
36 | NULL | 27 | NULL |
@@ -41,7 +32,7 @@ DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)") | |||
41 | .init_early = imx25_init_early, | 32 | .init_early = imx25_init_early, |
42 | .init_irq = mx25_init_irq, | 33 | .init_irq = mx25_init_irq, |
43 | .handle_irq = imx25_handle_irq, | 34 | .handle_irq = imx25_handle_irq, |
44 | .timer = &imx25_timer, | 35 | .init_time = imx25_timer_init, |
45 | .init_machine = imx25_dt_init, | 36 | .init_machine = imx25_dt_init, |
46 | .dt_compat = imx25_dt_board_compat, | 37 | .dt_compat = imx25_dt_board_compat, |
47 | .restart = mxc_restart, | 38 | .restart = mxc_restart, |
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c index ebfae96543c4..c915a490a11c 100644 --- a/arch/arm/mach-imx/imx27-dt.c +++ b/arch/arm/mach-imx/imx27-dt.c | |||
@@ -39,26 +39,22 @@ static void __init imx27_dt_init(void) | |||
39 | imx27_auxdata_lookup, NULL); | 39 | imx27_auxdata_lookup, NULL); |
40 | } | 40 | } |
41 | 41 | ||
42 | static void __init imx27_timer_init(void) | ||
43 | { | ||
44 | mx27_clocks_init_dt(); | ||
45 | } | ||
46 | |||
47 | static struct sys_timer imx27_timer = { | ||
48 | .init = imx27_timer_init, | ||
49 | }; | ||
50 | |||
51 | static const char * const imx27_dt_board_compat[] __initconst = { | 42 | static const char * const imx27_dt_board_compat[] __initconst = { |
52 | "fsl,imx27", | 43 | "fsl,imx27", |
53 | NULL | 44 | NULL |
54 | }; | 45 | }; |
55 | 46 | ||
47 | static void __init imx27_timer_init(void) | ||
48 | { | ||
49 | mx27_clocks_init_dt(); | ||
50 | } | ||
51 | |||
56 | DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") | 52 | DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") |
57 | .map_io = mx27_map_io, | 53 | .map_io = mx27_map_io, |
58 | .init_early = imx27_init_early, | 54 | .init_early = imx27_init_early, |
59 | .init_irq = mx27_init_irq, | 55 | .init_irq = mx27_init_irq, |
60 | .handle_irq = imx27_handle_irq, | 56 | .handle_irq = imx27_handle_irq, |
61 | .timer = &imx27_timer, | 57 | .init_time = imx27_timer_init, |
62 | .init_machine = imx27_dt_init, | 58 | .init_machine = imx27_dt_init, |
63 | .dt_compat = imx27_dt_board_compat, | 59 | .dt_compat = imx27_dt_board_compat, |
64 | .restart = mxc_restart, | 60 | .restart = mxc_restart, |
diff --git a/arch/arm/mach-imx/imx31-dt.c b/arch/arm/mach-imx/imx31-dt.c index af476de2570e..f9a690960097 100644 --- a/arch/arm/mach-imx/imx31-dt.c +++ b/arch/arm/mach-imx/imx31-dt.c | |||
@@ -38,15 +38,6 @@ static void __init imx31_dt_init(void) | |||
38 | imx31_auxdata_lookup, NULL); | 38 | imx31_auxdata_lookup, NULL); |
39 | } | 39 | } |
40 | 40 | ||
41 | static void __init imx31_timer_init(void) | ||
42 | { | ||
43 | mx31_clocks_init_dt(); | ||
44 | } | ||
45 | |||
46 | static struct sys_timer imx31_timer = { | ||
47 | .init = imx31_timer_init, | ||
48 | }; | ||
49 | |||
50 | static const char *imx31_dt_board_compat[] __initdata = { | 41 | static const char *imx31_dt_board_compat[] __initdata = { |
51 | "fsl,imx31", | 42 | "fsl,imx31", |
52 | NULL | 43 | NULL |
@@ -57,7 +48,7 @@ DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)") | |||
57 | .init_early = imx31_init_early, | 48 | .init_early = imx31_init_early, |
58 | .init_irq = mx31_init_irq, | 49 | .init_irq = mx31_init_irq, |
59 | .handle_irq = imx31_handle_irq, | 50 | .handle_irq = imx31_handle_irq, |
60 | .timer = &imx31_timer, | 51 | .init_time = mx31_clocks_init_dt, |
61 | .init_machine = imx31_dt_init, | 52 | .init_machine = imx31_dt_init, |
62 | .dt_compat = imx31_dt_board_compat, | 53 | .dt_compat = imx31_dt_board_compat, |
63 | .restart = mxc_restart, | 54 | .restart = mxc_restart, |
diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c index 5ffa40c673f8..e2926a8863f8 100644 --- a/arch/arm/mach-imx/imx51-dt.c +++ b/arch/arm/mach-imx/imx51-dt.c | |||
@@ -24,26 +24,22 @@ static void __init imx51_dt_init(void) | |||
24 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 24 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
25 | } | 25 | } |
26 | 26 | ||
27 | static void __init imx51_timer_init(void) | ||
28 | { | ||
29 | mx51_clocks_init_dt(); | ||
30 | } | ||
31 | |||
32 | static struct sys_timer imx51_timer = { | ||
33 | .init = imx51_timer_init, | ||
34 | }; | ||
35 | |||
36 | static const char *imx51_dt_board_compat[] __initdata = { | 27 | static const char *imx51_dt_board_compat[] __initdata = { |
37 | "fsl,imx51", | 28 | "fsl,imx51", |
38 | NULL | 29 | NULL |
39 | }; | 30 | }; |
40 | 31 | ||
32 | static void __init imx51_timer_init(void) | ||
33 | { | ||
34 | mx51_clocks_init_dt(); | ||
35 | } | ||
36 | |||
41 | DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)") | 37 | DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)") |
42 | .map_io = mx51_map_io, | 38 | .map_io = mx51_map_io, |
43 | .init_early = imx51_init_early, | 39 | .init_early = imx51_init_early, |
44 | .init_irq = mx51_init_irq, | 40 | .init_irq = mx51_init_irq, |
45 | .handle_irq = imx51_handle_irq, | 41 | .handle_irq = imx51_handle_irq, |
46 | .timer = &imx51_timer, | 42 | .init_time = imx51_timer_init, |
47 | .init_machine = imx51_dt_init, | 43 | .init_machine = imx51_dt_init, |
48 | .init_late = imx51_init_late, | 44 | .init_late = imx51_init_late, |
49 | .dt_compat = imx51_dt_board_compat, | 45 | .dt_compat = imx51_dt_board_compat, |
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c index 5c9bd2c66e6d..067580b2969b 100644 --- a/arch/arm/mach-imx/mach-apf9328.c +++ b/arch/arm/mach-imx/mach-apf9328.c | |||
@@ -137,17 +137,13 @@ static void __init apf9328_timer_init(void) | |||
137 | mx1_clocks_init(32768); | 137 | mx1_clocks_init(32768); |
138 | } | 138 | } |
139 | 139 | ||
140 | static struct sys_timer apf9328_timer = { | ||
141 | .init = apf9328_timer_init, | ||
142 | }; | ||
143 | |||
144 | MACHINE_START(APF9328, "Armadeus APF9328") | 140 | MACHINE_START(APF9328, "Armadeus APF9328") |
145 | /* Maintainer: Gwenhael Goavec-Merou, ARMadeus Systems */ | 141 | /* Maintainer: Gwenhael Goavec-Merou, ARMadeus Systems */ |
146 | .map_io = mx1_map_io, | 142 | .map_io = mx1_map_io, |
147 | .init_early = imx1_init_early, | 143 | .init_early = imx1_init_early, |
148 | .init_irq = mx1_init_irq, | 144 | .init_irq = mx1_init_irq, |
149 | .handle_irq = imx1_handle_irq, | 145 | .handle_irq = imx1_handle_irq, |
150 | .timer = &apf9328_timer, | 146 | .init_time = apf9328_timer_init, |
151 | .init_machine = apf9328_init, | 147 | .init_machine = apf9328_init, |
152 | .restart = mxc_restart, | 148 | .restart = mxc_restart, |
153 | MACHINE_END | 149 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c index 59bd6b06a6b5..368a6e3f5926 100644 --- a/arch/arm/mach-imx/mach-armadillo5x0.c +++ b/arch/arm/mach-imx/mach-armadillo5x0.c | |||
@@ -557,10 +557,6 @@ static void __init armadillo5x0_timer_init(void) | |||
557 | mx31_clocks_init(26000000); | 557 | mx31_clocks_init(26000000); |
558 | } | 558 | } |
559 | 559 | ||
560 | static struct sys_timer armadillo5x0_timer = { | ||
561 | .init = armadillo5x0_timer_init, | ||
562 | }; | ||
563 | |||
564 | MACHINE_START(ARMADILLO5X0, "Armadillo-500") | 560 | MACHINE_START(ARMADILLO5X0, "Armadillo-500") |
565 | /* Maintainer: Alberto Panizzo */ | 561 | /* Maintainer: Alberto Panizzo */ |
566 | .atag_offset = 0x100, | 562 | .atag_offset = 0x100, |
@@ -568,7 +564,7 @@ MACHINE_START(ARMADILLO5X0, "Armadillo-500") | |||
568 | .init_early = imx31_init_early, | 564 | .init_early = imx31_init_early, |
569 | .init_irq = mx31_init_irq, | 565 | .init_irq = mx31_init_irq, |
570 | .handle_irq = imx31_handle_irq, | 566 | .handle_irq = imx31_handle_irq, |
571 | .timer = &armadillo5x0_timer, | 567 | .init_time = armadillo5x0_timer_init, |
572 | .init_machine = armadillo5x0_init, | 568 | .init_machine = armadillo5x0_init, |
573 | .restart = mxc_restart, | 569 | .restart = mxc_restart, |
574 | MACHINE_END | 570 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-bug.c b/arch/arm/mach-imx/mach-bug.c index 3a39d5aec07a..2d00476f7d2c 100644 --- a/arch/arm/mach-imx/mach-bug.c +++ b/arch/arm/mach-imx/mach-bug.c | |||
@@ -53,16 +53,12 @@ static void __init bug_timer_init(void) | |||
53 | mx31_clocks_init(26000000); | 53 | mx31_clocks_init(26000000); |
54 | } | 54 | } |
55 | 55 | ||
56 | static struct sys_timer bug_timer = { | ||
57 | .init = bug_timer_init, | ||
58 | }; | ||
59 | |||
60 | MACHINE_START(BUG, "BugLabs BUGBase") | 56 | MACHINE_START(BUG, "BugLabs BUGBase") |
61 | .map_io = mx31_map_io, | 57 | .map_io = mx31_map_io, |
62 | .init_early = imx31_init_early, | 58 | .init_early = imx31_init_early, |
63 | .init_irq = mx31_init_irq, | 59 | .init_irq = mx31_init_irq, |
64 | .handle_irq = imx31_handle_irq, | 60 | .handle_irq = imx31_handle_irq, |
65 | .timer = &bug_timer, | 61 | .init_time = bug_timer_init, |
66 | .init_machine = bug_board_init, | 62 | .init_machine = bug_board_init, |
67 | .restart = mxc_restart, | 63 | .restart = mxc_restart, |
68 | MACHINE_END | 64 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c index 12a370646b45..146559311bd2 100644 --- a/arch/arm/mach-imx/mach-cpuimx27.c +++ b/arch/arm/mach-imx/mach-cpuimx27.c | |||
@@ -309,17 +309,13 @@ static void __init eukrea_cpuimx27_timer_init(void) | |||
309 | mx27_clocks_init(26000000); | 309 | mx27_clocks_init(26000000); |
310 | } | 310 | } |
311 | 311 | ||
312 | static struct sys_timer eukrea_cpuimx27_timer = { | ||
313 | .init = eukrea_cpuimx27_timer_init, | ||
314 | }; | ||
315 | |||
316 | MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27") | 312 | MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27") |
317 | .atag_offset = 0x100, | 313 | .atag_offset = 0x100, |
318 | .map_io = mx27_map_io, | 314 | .map_io = mx27_map_io, |
319 | .init_early = imx27_init_early, | 315 | .init_early = imx27_init_early, |
320 | .init_irq = mx27_init_irq, | 316 | .init_irq = mx27_init_irq, |
321 | .handle_irq = imx27_handle_irq, | 317 | .handle_irq = imx27_handle_irq, |
322 | .timer = &eukrea_cpuimx27_timer, | 318 | .init_time = eukrea_cpuimx27_timer_init, |
323 | .init_machine = eukrea_cpuimx27_init, | 319 | .init_machine = eukrea_cpuimx27_init, |
324 | .restart = mxc_restart, | 320 | .restart = mxc_restart, |
325 | MACHINE_END | 321 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c index 5a31bf8c8f4c..771362d1fbee 100644 --- a/arch/arm/mach-imx/mach-cpuimx35.c +++ b/arch/arm/mach-imx/mach-cpuimx35.c | |||
@@ -193,10 +193,6 @@ static void __init eukrea_cpuimx35_timer_init(void) | |||
193 | mx35_clocks_init(); | 193 | mx35_clocks_init(); |
194 | } | 194 | } |
195 | 195 | ||
196 | static struct sys_timer eukrea_cpuimx35_timer = { | ||
197 | .init = eukrea_cpuimx35_timer_init, | ||
198 | }; | ||
199 | |||
200 | MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35") | 196 | MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35") |
201 | /* Maintainer: Eukrea Electromatique */ | 197 | /* Maintainer: Eukrea Electromatique */ |
202 | .atag_offset = 0x100, | 198 | .atag_offset = 0x100, |
@@ -204,7 +200,7 @@ MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35") | |||
204 | .init_early = imx35_init_early, | 200 | .init_early = imx35_init_early, |
205 | .init_irq = mx35_init_irq, | 201 | .init_irq = mx35_init_irq, |
206 | .handle_irq = imx35_handle_irq, | 202 | .handle_irq = imx35_handle_irq, |
207 | .timer = &eukrea_cpuimx35_timer, | 203 | .init_time = eukrea_cpuimx35_timer_init, |
208 | .init_machine = eukrea_cpuimx35_init, | 204 | .init_machine = eukrea_cpuimx35_init, |
209 | .restart = mxc_restart, | 205 | .restart = mxc_restart, |
210 | MACHINE_END | 206 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c index b727de029c8f..9b7393234f6f 100644 --- a/arch/arm/mach-imx/mach-cpuimx51sd.c +++ b/arch/arm/mach-imx/mach-cpuimx51sd.c | |||
@@ -355,10 +355,6 @@ static void __init eukrea_cpuimx51sd_timer_init(void) | |||
355 | mx51_clocks_init(32768, 24000000, 22579200, 0); | 355 | mx51_clocks_init(32768, 24000000, 22579200, 0); |
356 | } | 356 | } |
357 | 357 | ||
358 | static struct sys_timer mxc_timer = { | ||
359 | .init = eukrea_cpuimx51sd_timer_init, | ||
360 | }; | ||
361 | |||
362 | MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD") | 358 | MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD") |
363 | /* Maintainer: Eric Bénard <eric@eukrea.com> */ | 359 | /* Maintainer: Eric Bénard <eric@eukrea.com> */ |
364 | .atag_offset = 0x100, | 360 | .atag_offset = 0x100, |
@@ -366,7 +362,7 @@ MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD") | |||
366 | .init_early = imx51_init_early, | 362 | .init_early = imx51_init_early, |
367 | .init_irq = mx51_init_irq, | 363 | .init_irq = mx51_init_irq, |
368 | .handle_irq = imx51_handle_irq, | 364 | .handle_irq = imx51_handle_irq, |
369 | .timer = &mxc_timer, | 365 | .init_time = eukrea_cpuimx51sd_timer_init, |
370 | .init_machine = eukrea_cpuimx51sd_init, | 366 | .init_machine = eukrea_cpuimx51sd_init, |
371 | .init_late = imx51_init_late, | 367 | .init_late = imx51_init_late, |
372 | .restart = mxc_restart, | 368 | .restart = mxc_restart, |
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c index 75027a5ad8b7..4bf454424249 100644 --- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c +++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c | |||
@@ -159,10 +159,6 @@ static void __init eukrea_cpuimx25_timer_init(void) | |||
159 | mx25_clocks_init(); | 159 | mx25_clocks_init(); |
160 | } | 160 | } |
161 | 161 | ||
162 | static struct sys_timer eukrea_cpuimx25_timer = { | ||
163 | .init = eukrea_cpuimx25_timer_init, | ||
164 | }; | ||
165 | |||
166 | MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25") | 162 | MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25") |
167 | /* Maintainer: Eukrea Electromatique */ | 163 | /* Maintainer: Eukrea Electromatique */ |
168 | .atag_offset = 0x100, | 164 | .atag_offset = 0x100, |
@@ -170,7 +166,7 @@ MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25") | |||
170 | .init_early = imx25_init_early, | 166 | .init_early = imx25_init_early, |
171 | .init_irq = mx25_init_irq, | 167 | .init_irq = mx25_init_irq, |
172 | .handle_irq = imx25_handle_irq, | 168 | .handle_irq = imx25_handle_irq, |
173 | .timer = &eukrea_cpuimx25_timer, | 169 | .init_time = eukrea_cpuimx25_timer_init, |
174 | .init_machine = eukrea_cpuimx25_init, | 170 | .init_machine = eukrea_cpuimx25_init, |
175 | .restart = mxc_restart, | 171 | .restart = mxc_restart, |
176 | MACHINE_END | 172 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index 318bd8df7fcc..29ac8ee651d2 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c | |||
@@ -598,10 +598,6 @@ static void __init visstrim_m10_timer_init(void) | |||
598 | mx27_clocks_init((unsigned long)25000000); | 598 | mx27_clocks_init((unsigned long)25000000); |
599 | } | 599 | } |
600 | 600 | ||
601 | static struct sys_timer visstrim_m10_timer = { | ||
602 | .init = visstrim_m10_timer_init, | ||
603 | }; | ||
604 | |||
605 | MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10") | 601 | MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10") |
606 | .atag_offset = 0x100, | 602 | .atag_offset = 0x100, |
607 | .reserve = visstrim_reserve, | 603 | .reserve = visstrim_reserve, |
@@ -609,7 +605,7 @@ MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10") | |||
609 | .init_early = imx27_init_early, | 605 | .init_early = imx27_init_early, |
610 | .init_irq = mx27_init_irq, | 606 | .init_irq = mx27_init_irq, |
611 | .handle_irq = imx27_handle_irq, | 607 | .handle_irq = imx27_handle_irq, |
612 | .timer = &visstrim_m10_timer, | 608 | .init_time = visstrim_m10_timer_init, |
613 | .init_machine = visstrim_m10_board_init, | 609 | .init_machine = visstrim_m10_board_init, |
614 | .restart = mxc_restart, | 610 | .restart = mxc_restart, |
615 | MACHINE_END | 611 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-imx27ipcam.c b/arch/arm/mach-imx/mach-imx27ipcam.c index 53a860112938..1a851aea6832 100644 --- a/arch/arm/mach-imx/mach-imx27ipcam.c +++ b/arch/arm/mach-imx/mach-imx27ipcam.c | |||
@@ -65,10 +65,6 @@ static void __init mx27ipcam_timer_init(void) | |||
65 | mx27_clocks_init(25000000); | 65 | mx27_clocks_init(25000000); |
66 | } | 66 | } |
67 | 67 | ||
68 | static struct sys_timer mx27ipcam_timer = { | ||
69 | .init = mx27ipcam_timer_init, | ||
70 | }; | ||
71 | |||
72 | MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM") | 68 | MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM") |
73 | /* maintainer: Freescale Semiconductor, Inc. */ | 69 | /* maintainer: Freescale Semiconductor, Inc. */ |
74 | .atag_offset = 0x100, | 70 | .atag_offset = 0x100, |
@@ -76,7 +72,7 @@ MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM") | |||
76 | .init_early = imx27_init_early, | 72 | .init_early = imx27_init_early, |
77 | .init_irq = mx27_init_irq, | 73 | .init_irq = mx27_init_irq, |
78 | .handle_irq = imx27_handle_irq, | 74 | .handle_irq = imx27_handle_irq, |
79 | .timer = &mx27ipcam_timer, | 75 | .init_time = mx27ipcam_timer_init, |
80 | .init_machine = mx27ipcam_init, | 76 | .init_machine = mx27ipcam_init, |
81 | .restart = mxc_restart, | 77 | .restart = mxc_restart, |
82 | MACHINE_END | 78 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c index fc8dce931378..3da2e3e44ce9 100644 --- a/arch/arm/mach-imx/mach-imx27lite.c +++ b/arch/arm/mach-imx/mach-imx27lite.c | |||
@@ -72,17 +72,13 @@ static void __init mx27lite_timer_init(void) | |||
72 | mx27_clocks_init(26000000); | 72 | mx27_clocks_init(26000000); |
73 | } | 73 | } |
74 | 74 | ||
75 | static struct sys_timer mx27lite_timer = { | ||
76 | .init = mx27lite_timer_init, | ||
77 | }; | ||
78 | |||
79 | MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE") | 75 | MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE") |
80 | .atag_offset = 0x100, | 76 | .atag_offset = 0x100, |
81 | .map_io = mx27_map_io, | 77 | .map_io = mx27_map_io, |
82 | .init_early = imx27_init_early, | 78 | .init_early = imx27_init_early, |
83 | .init_irq = mx27_init_irq, | 79 | .init_irq = mx27_init_irq, |
84 | .handle_irq = imx27_handle_irq, | 80 | .handle_irq = imx27_handle_irq, |
85 | .timer = &mx27lite_timer, | 81 | .init_time = mx27lite_timer_init, |
86 | .init_machine = mx27lite_init, | 82 | .init_machine = mx27lite_init, |
87 | .restart = mxc_restart, | 83 | .restart = mxc_restart, |
88 | MACHINE_END | 84 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c index 860284dea0e7..f579c616feed 100644 --- a/arch/arm/mach-imx/mach-imx53.c +++ b/arch/arm/mach-imx/mach-imx53.c | |||
@@ -44,26 +44,22 @@ static void __init imx53_dt_init(void) | |||
44 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 44 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
45 | } | 45 | } |
46 | 46 | ||
47 | static void __init imx53_timer_init(void) | ||
48 | { | ||
49 | mx53_clocks_init_dt(); | ||
50 | } | ||
51 | |||
52 | static struct sys_timer imx53_timer = { | ||
53 | .init = imx53_timer_init, | ||
54 | }; | ||
55 | |||
56 | static const char *imx53_dt_board_compat[] __initdata = { | 47 | static const char *imx53_dt_board_compat[] __initdata = { |
57 | "fsl,imx53", | 48 | "fsl,imx53", |
58 | NULL | 49 | NULL |
59 | }; | 50 | }; |
60 | 51 | ||
52 | static void __init imx53_timer_init(void) | ||
53 | { | ||
54 | mx53_clocks_init_dt(); | ||
55 | } | ||
56 | |||
61 | DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)") | 57 | DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)") |
62 | .map_io = mx53_map_io, | 58 | .map_io = mx53_map_io, |
63 | .init_early = imx53_init_early, | 59 | .init_early = imx53_init_early, |
64 | .init_irq = mx53_init_irq, | 60 | .init_irq = mx53_init_irq, |
65 | .handle_irq = imx53_handle_irq, | 61 | .handle_irq = imx53_handle_irq, |
66 | .timer = &imx53_timer, | 62 | .init_time = imx53_timer_init, |
67 | .init_machine = imx53_dt_init, | 63 | .init_machine = imx53_dt_init, |
68 | .init_late = imx53_init_late, | 64 | .init_late = imx53_init_late, |
69 | .dt_compat = imx53_dt_board_compat, | 65 | .dt_compat = imx53_dt_board_compat, |
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 724bfeb8f88b..8d3d06e0e8a1 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -236,10 +236,6 @@ static void __init imx6q_timer_init(void) | |||
236 | imx_print_silicon_rev("i.MX6Q", imx6q_revision()); | 236 | imx_print_silicon_rev("i.MX6Q", imx6q_revision()); |
237 | } | 237 | } |
238 | 238 | ||
239 | static struct sys_timer imx6q_timer = { | ||
240 | .init = imx6q_timer_init, | ||
241 | }; | ||
242 | |||
243 | static const char *imx6q_dt_compat[] __initdata = { | 239 | static const char *imx6q_dt_compat[] __initdata = { |
244 | "fsl,imx6q", | 240 | "fsl,imx6q", |
245 | NULL, | 241 | NULL, |
@@ -249,7 +245,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)") | |||
249 | .smp = smp_ops(imx_smp_ops), | 245 | .smp = smp_ops(imx_smp_ops), |
250 | .map_io = imx6q_map_io, | 246 | .map_io = imx6q_map_io, |
251 | .init_irq = imx6q_init_irq, | 247 | .init_irq = imx6q_init_irq, |
252 | .timer = &imx6q_timer, | 248 | .init_time = imx6q_timer_init, |
253 | .init_machine = imx6q_init_machine, | 249 | .init_machine = imx6q_init_machine, |
254 | .init_late = imx6q_init_late, | 250 | .init_late = imx6q_init_late, |
255 | .dt_compat = imx6q_dt_compat, | 251 | .dt_compat = imx6q_dt_compat, |
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c index 2e536ea53444..c7bc41d6b468 100644 --- a/arch/arm/mach-imx/mach-kzm_arm11_01.c +++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c | |||
@@ -284,17 +284,13 @@ static void __init kzm_timer_init(void) | |||
284 | mx31_clocks_init(26000000); | 284 | mx31_clocks_init(26000000); |
285 | } | 285 | } |
286 | 286 | ||
287 | static struct sys_timer kzm_timer = { | ||
288 | .init = kzm_timer_init, | ||
289 | }; | ||
290 | |||
291 | MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01") | 287 | MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01") |
292 | .atag_offset = 0x100, | 288 | .atag_offset = 0x100, |
293 | .map_io = kzm_map_io, | 289 | .map_io = kzm_map_io, |
294 | .init_early = imx31_init_early, | 290 | .init_early = imx31_init_early, |
295 | .init_irq = mx31_init_irq, | 291 | .init_irq = mx31_init_irq, |
296 | .handle_irq = imx31_handle_irq, | 292 | .handle_irq = imx31_handle_irq, |
297 | .timer = &kzm_timer, | 293 | .init_time = kzm_timer_init, |
298 | .init_machine = kzm_board_init, | 294 | .init_machine = kzm_board_init, |
299 | .restart = mxc_restart, | 295 | .restart = mxc_restart, |
300 | MACHINE_END | 296 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c index 06b483783e68..9f883e4d6fc9 100644 --- a/arch/arm/mach-imx/mach-mx1ads.c +++ b/arch/arm/mach-imx/mach-mx1ads.c | |||
@@ -132,10 +132,6 @@ static void __init mx1ads_timer_init(void) | |||
132 | mx1_clocks_init(32000); | 132 | mx1_clocks_init(32000); |
133 | } | 133 | } |
134 | 134 | ||
135 | static struct sys_timer mx1ads_timer = { | ||
136 | .init = mx1ads_timer_init, | ||
137 | }; | ||
138 | |||
139 | MACHINE_START(MX1ADS, "Freescale MX1ADS") | 135 | MACHINE_START(MX1ADS, "Freescale MX1ADS") |
140 | /* Maintainer: Sascha Hauer, Pengutronix */ | 136 | /* Maintainer: Sascha Hauer, Pengutronix */ |
141 | .atag_offset = 0x100, | 137 | .atag_offset = 0x100, |
@@ -143,7 +139,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS") | |||
143 | .init_early = imx1_init_early, | 139 | .init_early = imx1_init_early, |
144 | .init_irq = mx1_init_irq, | 140 | .init_irq = mx1_init_irq, |
145 | .handle_irq = imx1_handle_irq, | 141 | .handle_irq = imx1_handle_irq, |
146 | .timer = &mx1ads_timer, | 142 | .init_time = mx1ads_timer_init, |
147 | .init_machine = mx1ads_init, | 143 | .init_machine = mx1ads_init, |
148 | .restart = mxc_restart, | 144 | .restart = mxc_restart, |
149 | MACHINE_END | 145 | MACHINE_END |
@@ -154,7 +150,7 @@ MACHINE_START(MXLADS, "Freescale MXLADS") | |||
154 | .init_early = imx1_init_early, | 150 | .init_early = imx1_init_early, |
155 | .init_irq = mx1_init_irq, | 151 | .init_irq = mx1_init_irq, |
156 | .handle_irq = imx1_handle_irq, | 152 | .handle_irq = imx1_handle_irq, |
157 | .timer = &mx1ads_timer, | 153 | .init_time = mx1ads_timer_init, |
158 | .init_machine = mx1ads_init, | 154 | .init_machine = mx1ads_init, |
159 | .restart = mxc_restart, | 155 | .restart = mxc_restart, |
160 | MACHINE_END | 156 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c index 6adb3136bb08..a06aa4dc37fc 100644 --- a/arch/arm/mach-imx/mach-mx21ads.c +++ b/arch/arm/mach-imx/mach-mx21ads.c | |||
@@ -318,10 +318,6 @@ static void __init mx21ads_timer_init(void) | |||
318 | mx21_clocks_init(32768, 26000000); | 318 | mx21_clocks_init(32768, 26000000); |
319 | } | 319 | } |
320 | 320 | ||
321 | static struct sys_timer mx21ads_timer = { | ||
322 | .init = mx21ads_timer_init, | ||
323 | }; | ||
324 | |||
325 | MACHINE_START(MX21ADS, "Freescale i.MX21ADS") | 321 | MACHINE_START(MX21ADS, "Freescale i.MX21ADS") |
326 | /* maintainer: Freescale Semiconductor, Inc. */ | 322 | /* maintainer: Freescale Semiconductor, Inc. */ |
327 | .atag_offset = 0x100, | 323 | .atag_offset = 0x100, |
@@ -329,7 +325,7 @@ MACHINE_START(MX21ADS, "Freescale i.MX21ADS") | |||
329 | .init_early = imx21_init_early, | 325 | .init_early = imx21_init_early, |
330 | .init_irq = mx21_init_irq, | 326 | .init_irq = mx21_init_irq, |
331 | .handle_irq = imx21_handle_irq, | 327 | .handle_irq = imx21_handle_irq, |
332 | .timer = &mx21ads_timer, | 328 | .init_time = mx21ads_timer_init, |
333 | .init_machine = mx21ads_board_init, | 329 | .init_machine = mx21ads_board_init, |
334 | .restart = mxc_restart, | 330 | .restart = mxc_restart, |
335 | MACHINE_END | 331 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c index b1b03aa55bb8..8bcda688a006 100644 --- a/arch/arm/mach-imx/mach-mx25_3ds.c +++ b/arch/arm/mach-imx/mach-mx25_3ds.c | |||
@@ -257,10 +257,6 @@ static void __init mx25pdk_timer_init(void) | |||
257 | mx25_clocks_init(); | 257 | mx25_clocks_init(); |
258 | } | 258 | } |
259 | 259 | ||
260 | static struct sys_timer mx25pdk_timer = { | ||
261 | .init = mx25pdk_timer_init, | ||
262 | }; | ||
263 | |||
264 | MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)") | 260 | MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)") |
265 | /* Maintainer: Freescale Semiconductor, Inc. */ | 261 | /* Maintainer: Freescale Semiconductor, Inc. */ |
266 | .atag_offset = 0x100, | 262 | .atag_offset = 0x100, |
@@ -268,7 +264,7 @@ MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)") | |||
268 | .init_early = imx25_init_early, | 264 | .init_early = imx25_init_early, |
269 | .init_irq = mx25_init_irq, | 265 | .init_irq = mx25_init_irq, |
270 | .handle_irq = imx25_handle_irq, | 266 | .handle_irq = imx25_handle_irq, |
271 | .timer = &mx25pdk_timer, | 267 | .init_time = mx25pdk_timer_init, |
272 | .init_machine = mx25pdk_init, | 268 | .init_machine = mx25pdk_init, |
273 | .restart = mxc_restart, | 269 | .restart = mxc_restart, |
274 | MACHINE_END | 270 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index d0e547fa925f..25b3e4c9bc0a 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -538,10 +538,6 @@ static void __init mx27pdk_timer_init(void) | |||
538 | mx27_clocks_init(26000000); | 538 | mx27_clocks_init(26000000); |
539 | } | 539 | } |
540 | 540 | ||
541 | static struct sys_timer mx27pdk_timer = { | ||
542 | .init = mx27pdk_timer_init, | ||
543 | }; | ||
544 | |||
545 | MACHINE_START(MX27_3DS, "Freescale MX27PDK") | 541 | MACHINE_START(MX27_3DS, "Freescale MX27PDK") |
546 | /* maintainer: Freescale Semiconductor, Inc. */ | 542 | /* maintainer: Freescale Semiconductor, Inc. */ |
547 | .atag_offset = 0x100, | 543 | .atag_offset = 0x100, |
@@ -549,7 +545,7 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK") | |||
549 | .init_early = imx27_init_early, | 545 | .init_early = imx27_init_early, |
550 | .init_irq = mx27_init_irq, | 546 | .init_irq = mx27_init_irq, |
551 | .handle_irq = imx27_handle_irq, | 547 | .handle_irq = imx27_handle_irq, |
552 | .timer = &mx27pdk_timer, | 548 | .init_time = mx27pdk_timer_init, |
553 | .init_machine = mx27pdk_init, | 549 | .init_machine = mx27pdk_init, |
554 | .restart = mxc_restart, | 550 | .restart = mxc_restart, |
555 | MACHINE_END | 551 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c index 3d036f57f0e6..9821b824dcaf 100644 --- a/arch/arm/mach-imx/mach-mx27ads.c +++ b/arch/arm/mach-imx/mach-mx27ads.c | |||
@@ -323,10 +323,6 @@ static void __init mx27ads_timer_init(void) | |||
323 | mx27_clocks_init(fref); | 323 | mx27_clocks_init(fref); |
324 | } | 324 | } |
325 | 325 | ||
326 | static struct sys_timer mx27ads_timer = { | ||
327 | .init = mx27ads_timer_init, | ||
328 | }; | ||
329 | |||
330 | static struct map_desc mx27ads_io_desc[] __initdata = { | 326 | static struct map_desc mx27ads_io_desc[] __initdata = { |
331 | { | 327 | { |
332 | .virtual = PBC_BASE_ADDRESS, | 328 | .virtual = PBC_BASE_ADDRESS, |
@@ -349,7 +345,7 @@ MACHINE_START(MX27ADS, "Freescale i.MX27ADS") | |||
349 | .init_early = imx27_init_early, | 345 | .init_early = imx27_init_early, |
350 | .init_irq = mx27_init_irq, | 346 | .init_irq = mx27_init_irq, |
351 | .handle_irq = imx27_handle_irq, | 347 | .handle_irq = imx27_handle_irq, |
352 | .timer = &mx27ads_timer, | 348 | .init_time = mx27ads_timer_init, |
353 | .init_machine = mx27ads_board_init, | 349 | .init_machine = mx27ads_board_init, |
354 | .restart = mxc_restart, | 350 | .restart = mxc_restart, |
355 | MACHINE_END | 351 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c index bc301befdd06..1ed916175d41 100644 --- a/arch/arm/mach-imx/mach-mx31_3ds.c +++ b/arch/arm/mach-imx/mach-mx31_3ds.c | |||
@@ -762,10 +762,6 @@ static void __init mx31_3ds_timer_init(void) | |||
762 | mx31_clocks_init(26000000); | 762 | mx31_clocks_init(26000000); |
763 | } | 763 | } |
764 | 764 | ||
765 | static struct sys_timer mx31_3ds_timer = { | ||
766 | .init = mx31_3ds_timer_init, | ||
767 | }; | ||
768 | |||
769 | static void __init mx31_3ds_reserve(void) | 765 | static void __init mx31_3ds_reserve(void) |
770 | { | 766 | { |
771 | /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */ | 767 | /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */ |
@@ -780,7 +776,7 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)") | |||
780 | .init_early = imx31_init_early, | 776 | .init_early = imx31_init_early, |
781 | .init_irq = mx31_init_irq, | 777 | .init_irq = mx31_init_irq, |
782 | .handle_irq = imx31_handle_irq, | 778 | .handle_irq = imx31_handle_irq, |
783 | .timer = &mx31_3ds_timer, | 779 | .init_time = mx31_3ds_timer_init, |
784 | .init_machine = mx31_3ds_init, | 780 | .init_machine = mx31_3ds_init, |
785 | .reserve = mx31_3ds_reserve, | 781 | .reserve = mx31_3ds_reserve, |
786 | .restart = mxc_restart, | 782 | .restart = mxc_restart, |
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c index 8b56f8883f32..daf8889125cc 100644 --- a/arch/arm/mach-imx/mach-mx31ads.c +++ b/arch/arm/mach-imx/mach-mx31ads.c | |||
@@ -576,10 +576,6 @@ static void __init mx31ads_timer_init(void) | |||
576 | mx31_clocks_init(26000000); | 576 | mx31_clocks_init(26000000); |
577 | } | 577 | } |
578 | 578 | ||
579 | static struct sys_timer mx31ads_timer = { | ||
580 | .init = mx31ads_timer_init, | ||
581 | }; | ||
582 | |||
583 | MACHINE_START(MX31ADS, "Freescale MX31ADS") | 579 | MACHINE_START(MX31ADS, "Freescale MX31ADS") |
584 | /* Maintainer: Freescale Semiconductor, Inc. */ | 580 | /* Maintainer: Freescale Semiconductor, Inc. */ |
585 | .atag_offset = 0x100, | 581 | .atag_offset = 0x100, |
@@ -587,7 +583,7 @@ MACHINE_START(MX31ADS, "Freescale MX31ADS") | |||
587 | .init_early = imx31_init_early, | 583 | .init_early = imx31_init_early, |
588 | .init_irq = mx31ads_init_irq, | 584 | .init_irq = mx31ads_init_irq, |
589 | .handle_irq = imx31_handle_irq, | 585 | .handle_irq = imx31_handle_irq, |
590 | .timer = &mx31ads_timer, | 586 | .init_time = mx31ads_timer_init, |
591 | .init_machine = mx31ads_init, | 587 | .init_machine = mx31ads_init, |
592 | .restart = mxc_restart, | 588 | .restart = mxc_restart, |
593 | MACHINE_END | 589 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c index 08b9965c8b36..832b1e2f964e 100644 --- a/arch/arm/mach-imx/mach-mx31lilly.c +++ b/arch/arm/mach-imx/mach-mx31lilly.c | |||
@@ -303,17 +303,13 @@ static void __init mx31lilly_timer_init(void) | |||
303 | mx31_clocks_init(26000000); | 303 | mx31_clocks_init(26000000); |
304 | } | 304 | } |
305 | 305 | ||
306 | static struct sys_timer mx31lilly_timer = { | ||
307 | .init = mx31lilly_timer_init, | ||
308 | }; | ||
309 | |||
310 | MACHINE_START(LILLY1131, "INCO startec LILLY-1131") | 306 | MACHINE_START(LILLY1131, "INCO startec LILLY-1131") |
311 | .atag_offset = 0x100, | 307 | .atag_offset = 0x100, |
312 | .map_io = mx31_map_io, | 308 | .map_io = mx31_map_io, |
313 | .init_early = imx31_init_early, | 309 | .init_early = imx31_init_early, |
314 | .init_irq = mx31_init_irq, | 310 | .init_irq = mx31_init_irq, |
315 | .handle_irq = imx31_handle_irq, | 311 | .handle_irq = imx31_handle_irq, |
316 | .timer = &mx31lilly_timer, | 312 | .init_time = mx31lilly_timer_init, |
317 | .init_machine = mx31lilly_board_init, | 313 | .init_machine = mx31lilly_board_init, |
318 | .restart = mxc_restart, | 314 | .restart = mxc_restart, |
319 | MACHINE_END | 315 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c index bdcd92e59518..bea07299b61a 100644 --- a/arch/arm/mach-imx/mach-mx31lite.c +++ b/arch/arm/mach-imx/mach-mx31lite.c | |||
@@ -285,10 +285,6 @@ static void __init mx31lite_timer_init(void) | |||
285 | mx31_clocks_init(26000000); | 285 | mx31_clocks_init(26000000); |
286 | } | 286 | } |
287 | 287 | ||
288 | static struct sys_timer mx31lite_timer = { | ||
289 | .init = mx31lite_timer_init, | ||
290 | }; | ||
291 | |||
292 | MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM") | 288 | MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM") |
293 | /* Maintainer: Freescale Semiconductor, Inc. */ | 289 | /* Maintainer: Freescale Semiconductor, Inc. */ |
294 | .atag_offset = 0x100, | 290 | .atag_offset = 0x100, |
@@ -296,7 +292,7 @@ MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM") | |||
296 | .init_early = imx31_init_early, | 292 | .init_early = imx31_init_early, |
297 | .init_irq = mx31_init_irq, | 293 | .init_irq = mx31_init_irq, |
298 | .handle_irq = imx31_handle_irq, | 294 | .handle_irq = imx31_handle_irq, |
299 | .timer = &mx31lite_timer, | 295 | .init_time = mx31lite_timer_init, |
300 | .init_machine = mx31lite_init, | 296 | .init_machine = mx31lite_init, |
301 | .restart = mxc_restart, | 297 | .restart = mxc_restart, |
302 | MACHINE_END | 298 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c index 2517cfa9f26b..dae4cd7be040 100644 --- a/arch/arm/mach-imx/mach-mx31moboard.c +++ b/arch/arm/mach-imx/mach-mx31moboard.c | |||
@@ -596,10 +596,6 @@ static void __init mx31moboard_timer_init(void) | |||
596 | mx31_clocks_init(26000000); | 596 | mx31_clocks_init(26000000); |
597 | } | 597 | } |
598 | 598 | ||
599 | static struct sys_timer mx31moboard_timer = { | ||
600 | .init = mx31moboard_timer_init, | ||
601 | }; | ||
602 | |||
603 | static void __init mx31moboard_reserve(void) | 599 | static void __init mx31moboard_reserve(void) |
604 | { | 600 | { |
605 | /* reserve 4 MiB for mx3-camera */ | 601 | /* reserve 4 MiB for mx3-camera */ |
@@ -615,7 +611,7 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard") | |||
615 | .init_early = imx31_init_early, | 611 | .init_early = imx31_init_early, |
616 | .init_irq = mx31_init_irq, | 612 | .init_irq = mx31_init_irq, |
617 | .handle_irq = imx31_handle_irq, | 613 | .handle_irq = imx31_handle_irq, |
618 | .timer = &mx31moboard_timer, | 614 | .init_time = mx31moboard_timer_init, |
619 | .init_machine = mx31moboard_init, | 615 | .init_machine = mx31moboard_init, |
620 | .restart = mxc_restart, | 616 | .restart = mxc_restart, |
621 | MACHINE_END | 617 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c index 5277da45d60c..a42f4f07051f 100644 --- a/arch/arm/mach-imx/mach-mx35_3ds.c +++ b/arch/arm/mach-imx/mach-mx35_3ds.c | |||
@@ -602,10 +602,6 @@ static void __init mx35pdk_timer_init(void) | |||
602 | mx35_clocks_init(); | 602 | mx35_clocks_init(); |
603 | } | 603 | } |
604 | 604 | ||
605 | static struct sys_timer mx35pdk_timer = { | ||
606 | .init = mx35pdk_timer_init, | ||
607 | }; | ||
608 | |||
609 | static void __init mx35_3ds_reserve(void) | 605 | static void __init mx35_3ds_reserve(void) |
610 | { | 606 | { |
611 | /* reserve MX35_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */ | 607 | /* reserve MX35_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */ |
@@ -620,7 +616,7 @@ MACHINE_START(MX35_3DS, "Freescale MX35PDK") | |||
620 | .init_early = imx35_init_early, | 616 | .init_early = imx35_init_early, |
621 | .init_irq = mx35_init_irq, | 617 | .init_irq = mx35_init_irq, |
622 | .handle_irq = imx35_handle_irq, | 618 | .handle_irq = imx35_handle_irq, |
623 | .timer = &mx35pdk_timer, | 619 | .init_time = mx35pdk_timer_init, |
624 | .init_machine = mx35_3ds_init, | 620 | .init_machine = mx35_3ds_init, |
625 | .reserve = mx35_3ds_reserve, | 621 | .reserve = mx35_3ds_reserve, |
626 | .restart = mxc_restart, | 622 | .restart = mxc_restart, |
diff --git a/arch/arm/mach-imx/mach-mx50_rdp.c b/arch/arm/mach-imx/mach-mx50_rdp.c index 0c1f88a80bdc..8937902bda5f 100644 --- a/arch/arm/mach-imx/mach-mx50_rdp.c +++ b/arch/arm/mach-imx/mach-mx50_rdp.c | |||
@@ -210,16 +210,12 @@ static void __init mx50_rdp_timer_init(void) | |||
210 | mx50_clocks_init(32768, 24000000, 22579200); | 210 | mx50_clocks_init(32768, 24000000, 22579200); |
211 | } | 211 | } |
212 | 212 | ||
213 | static struct sys_timer mx50_rdp_timer = { | ||
214 | .init = mx50_rdp_timer_init, | ||
215 | }; | ||
216 | |||
217 | MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform") | 213 | MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform") |
218 | .map_io = mx50_map_io, | 214 | .map_io = mx50_map_io, |
219 | .init_early = imx50_init_early, | 215 | .init_early = imx50_init_early, |
220 | .init_irq = mx50_init_irq, | 216 | .init_irq = mx50_init_irq, |
221 | .handle_irq = imx50_handle_irq, | 217 | .handle_irq = imx50_handle_irq, |
222 | .timer = &mx50_rdp_timer, | 218 | .init_time = mx50_rdp_timer_init, |
223 | .init_machine = mx50_rdp_board_init, | 219 | .init_machine = mx50_rdp_board_init, |
224 | .restart = mxc_restart, | 220 | .restart = mxc_restart, |
225 | MACHINE_END | 221 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c index abc25bd1107b..2d2365111532 100644 --- a/arch/arm/mach-imx/mach-mx51_3ds.c +++ b/arch/arm/mach-imx/mach-mx51_3ds.c | |||
@@ -160,10 +160,6 @@ static void __init mx51_3ds_timer_init(void) | |||
160 | mx51_clocks_init(32768, 24000000, 22579200, 0); | 160 | mx51_clocks_init(32768, 24000000, 22579200, 0); |
161 | } | 161 | } |
162 | 162 | ||
163 | static struct sys_timer mx51_3ds_timer = { | ||
164 | .init = mx51_3ds_timer_init, | ||
165 | }; | ||
166 | |||
167 | MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board") | 163 | MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board") |
168 | /* Maintainer: Freescale Semiconductor, Inc. */ | 164 | /* Maintainer: Freescale Semiconductor, Inc. */ |
169 | .atag_offset = 0x100, | 165 | .atag_offset = 0x100, |
@@ -171,7 +167,7 @@ MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board") | |||
171 | .init_early = imx51_init_early, | 167 | .init_early = imx51_init_early, |
172 | .init_irq = mx51_init_irq, | 168 | .init_irq = mx51_init_irq, |
173 | .handle_irq = imx51_handle_irq, | 169 | .handle_irq = imx51_handle_irq, |
174 | .timer = &mx51_3ds_timer, | 170 | .init_time = mx51_3ds_timer_init, |
175 | .init_machine = mx51_3ds_init, | 171 | .init_machine = mx51_3ds_init, |
176 | .init_late = imx51_init_late, | 172 | .init_late = imx51_init_late, |
177 | .restart = mxc_restart, | 173 | .restart = mxc_restart, |
diff --git a/arch/arm/mach-imx/mach-mx51_babbage.c b/arch/arm/mach-imx/mach-mx51_babbage.c index d9a84ca2199a..6c4d7feb4520 100644 --- a/arch/arm/mach-imx/mach-mx51_babbage.c +++ b/arch/arm/mach-imx/mach-mx51_babbage.c | |||
@@ -418,10 +418,6 @@ static void __init mx51_babbage_timer_init(void) | |||
418 | mx51_clocks_init(32768, 24000000, 22579200, 0); | 418 | mx51_clocks_init(32768, 24000000, 22579200, 0); |
419 | } | 419 | } |
420 | 420 | ||
421 | static struct sys_timer mx51_babbage_timer = { | ||
422 | .init = mx51_babbage_timer_init, | ||
423 | }; | ||
424 | |||
425 | MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board") | 421 | MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board") |
426 | /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */ | 422 | /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */ |
427 | .atag_offset = 0x100, | 423 | .atag_offset = 0x100, |
@@ -429,7 +425,7 @@ MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board") | |||
429 | .init_early = imx51_init_early, | 425 | .init_early = imx51_init_early, |
430 | .init_irq = mx51_init_irq, | 426 | .init_irq = mx51_init_irq, |
431 | .handle_irq = imx51_handle_irq, | 427 | .handle_irq = imx51_handle_irq, |
432 | .timer = &mx51_babbage_timer, | 428 | .init_time = mx51_babbage_timer_init, |
433 | .init_machine = mx51_babbage_init, | 429 | .init_machine = mx51_babbage_init, |
434 | .init_late = imx51_init_late, | 430 | .init_late = imx51_init_late, |
435 | .restart = mxc_restart, | 431 | .restart = mxc_restart, |
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c index f4a8c7e108e1..a27faaba98ec 100644 --- a/arch/arm/mach-imx/mach-mxt_td60.c +++ b/arch/arm/mach-imx/mach-mxt_td60.c | |||
@@ -261,10 +261,6 @@ static void __init mxt_td60_timer_init(void) | |||
261 | mx27_clocks_init(26000000); | 261 | mx27_clocks_init(26000000); |
262 | } | 262 | } |
263 | 263 | ||
264 | static struct sys_timer mxt_td60_timer = { | ||
265 | .init = mxt_td60_timer_init, | ||
266 | }; | ||
267 | |||
268 | MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60") | 264 | MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60") |
269 | /* maintainer: Maxtrack Industrial */ | 265 | /* maintainer: Maxtrack Industrial */ |
270 | .atag_offset = 0x100, | 266 | .atag_offset = 0x100, |
@@ -272,7 +268,7 @@ MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60") | |||
272 | .init_early = imx27_init_early, | 268 | .init_early = imx27_init_early, |
273 | .init_irq = mx27_init_irq, | 269 | .init_irq = mx27_init_irq, |
274 | .handle_irq = imx27_handle_irq, | 270 | .handle_irq = imx27_handle_irq, |
275 | .timer = &mxt_td60_timer, | 271 | .init_time = mxt_td60_timer_init, |
276 | .init_machine = mxt_td60_board_init, | 272 | .init_machine = mxt_td60_board_init, |
277 | .restart = mxc_restart, | 273 | .restart = mxc_restart, |
278 | MACHINE_END | 274 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index eee369fa94a2..b8b15bb1ffdf 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c | |||
@@ -416,10 +416,6 @@ static void __init pca100_timer_init(void) | |||
416 | mx27_clocks_init(26000000); | 416 | mx27_clocks_init(26000000); |
417 | } | 417 | } |
418 | 418 | ||
419 | static struct sys_timer pca100_timer = { | ||
420 | .init = pca100_timer_init, | ||
421 | }; | ||
422 | |||
423 | MACHINE_START(PCA100, "phyCARD-i.MX27") | 419 | MACHINE_START(PCA100, "phyCARD-i.MX27") |
424 | .atag_offset = 0x100, | 420 | .atag_offset = 0x100, |
425 | .map_io = mx27_map_io, | 421 | .map_io = mx27_map_io, |
@@ -427,6 +423,6 @@ MACHINE_START(PCA100, "phyCARD-i.MX27") | |||
427 | .init_irq = mx27_init_irq, | 423 | .init_irq = mx27_init_irq, |
428 | .handle_irq = imx27_handle_irq, | 424 | .handle_irq = imx27_handle_irq, |
429 | .init_machine = pca100_init, | 425 | .init_machine = pca100_init, |
430 | .timer = &pca100_timer, | 426 | .init_time = pca100_timer_init, |
431 | .restart = mxc_restart, | 427 | .restart = mxc_restart, |
432 | MACHINE_END | 428 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c index 547fef133f65..bc0261e99d39 100644 --- a/arch/arm/mach-imx/mach-pcm037.c +++ b/arch/arm/mach-imx/mach-pcm037.c | |||
@@ -685,10 +685,6 @@ static void __init pcm037_timer_init(void) | |||
685 | mx31_clocks_init(26000000); | 685 | mx31_clocks_init(26000000); |
686 | } | 686 | } |
687 | 687 | ||
688 | static struct sys_timer pcm037_timer = { | ||
689 | .init = pcm037_timer_init, | ||
690 | }; | ||
691 | |||
692 | static void __init pcm037_reserve(void) | 688 | static void __init pcm037_reserve(void) |
693 | { | 689 | { |
694 | /* reserve 4 MiB for mx3-camera */ | 690 | /* reserve 4 MiB for mx3-camera */ |
@@ -709,7 +705,7 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037") | |||
709 | .init_early = imx31_init_early, | 705 | .init_early = imx31_init_early, |
710 | .init_irq = mx31_init_irq, | 706 | .init_irq = mx31_init_irq, |
711 | .handle_irq = imx31_handle_irq, | 707 | .handle_irq = imx31_handle_irq, |
712 | .timer = &pcm037_timer, | 708 | .init_time = pcm037_timer_init, |
713 | .init_machine = pcm037_init, | 709 | .init_machine = pcm037_init, |
714 | .init_late = pcm037_init_late, | 710 | .init_late = pcm037_init_late, |
715 | .restart = mxc_restart, | 711 | .restart = mxc_restart, |
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c index 4aa0d0798605..e805ac273e9c 100644 --- a/arch/arm/mach-imx/mach-pcm038.c +++ b/arch/arm/mach-imx/mach-pcm038.c | |||
@@ -346,17 +346,13 @@ static void __init pcm038_timer_init(void) | |||
346 | mx27_clocks_init(26000000); | 346 | mx27_clocks_init(26000000); |
347 | } | 347 | } |
348 | 348 | ||
349 | static struct sys_timer pcm038_timer = { | ||
350 | .init = pcm038_timer_init, | ||
351 | }; | ||
352 | |||
353 | MACHINE_START(PCM038, "phyCORE-i.MX27") | 349 | MACHINE_START(PCM038, "phyCORE-i.MX27") |
354 | .atag_offset = 0x100, | 350 | .atag_offset = 0x100, |
355 | .map_io = mx27_map_io, | 351 | .map_io = mx27_map_io, |
356 | .init_early = imx27_init_early, | 352 | .init_early = imx27_init_early, |
357 | .init_irq = mx27_init_irq, | 353 | .init_irq = mx27_init_irq, |
358 | .handle_irq = imx27_handle_irq, | 354 | .handle_irq = imx27_handle_irq, |
359 | .timer = &pcm038_timer, | 355 | .init_time = pcm038_timer_init, |
360 | .init_machine = pcm038_init, | 356 | .init_machine = pcm038_init, |
361 | .restart = mxc_restart, | 357 | .restart = mxc_restart, |
362 | MACHINE_END | 358 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c index 92445440221e..8ed533f0f8ca 100644 --- a/arch/arm/mach-imx/mach-pcm043.c +++ b/arch/arm/mach-imx/mach-pcm043.c | |||
@@ -394,10 +394,6 @@ static void __init pcm043_timer_init(void) | |||
394 | mx35_clocks_init(); | 394 | mx35_clocks_init(); |
395 | } | 395 | } |
396 | 396 | ||
397 | static struct sys_timer pcm043_timer = { | ||
398 | .init = pcm043_timer_init, | ||
399 | }; | ||
400 | |||
401 | MACHINE_START(PCM043, "Phytec Phycore pcm043") | 397 | MACHINE_START(PCM043, "Phytec Phycore pcm043") |
402 | /* Maintainer: Pengutronix */ | 398 | /* Maintainer: Pengutronix */ |
403 | .atag_offset = 0x100, | 399 | .atag_offset = 0x100, |
@@ -405,7 +401,7 @@ MACHINE_START(PCM043, "Phytec Phycore pcm043") | |||
405 | .init_early = imx35_init_early, | 401 | .init_early = imx35_init_early, |
406 | .init_irq = mx35_init_irq, | 402 | .init_irq = mx35_init_irq, |
407 | .handle_irq = imx35_handle_irq, | 403 | .handle_irq = imx35_handle_irq, |
408 | .timer = &pcm043_timer, | 404 | .init_time = pcm043_timer_init, |
409 | .init_machine = pcm043_init, | 405 | .init_machine = pcm043_init, |
410 | .restart = mxc_restart, | 406 | .restart = mxc_restart, |
411 | MACHINE_END | 407 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c index 96d9a91f8a3b..22af27ed457e 100644 --- a/arch/arm/mach-imx/mach-qong.c +++ b/arch/arm/mach-imx/mach-qong.c | |||
@@ -260,10 +260,6 @@ static void __init qong_timer_init(void) | |||
260 | mx31_clocks_init(26000000); | 260 | mx31_clocks_init(26000000); |
261 | } | 261 | } |
262 | 262 | ||
263 | static struct sys_timer qong_timer = { | ||
264 | .init = qong_timer_init, | ||
265 | }; | ||
266 | |||
267 | MACHINE_START(QONG, "Dave/DENX QongEVB-LITE") | 263 | MACHINE_START(QONG, "Dave/DENX QongEVB-LITE") |
268 | /* Maintainer: DENX Software Engineering GmbH */ | 264 | /* Maintainer: DENX Software Engineering GmbH */ |
269 | .atag_offset = 0x100, | 265 | .atag_offset = 0x100, |
@@ -271,7 +267,7 @@ MACHINE_START(QONG, "Dave/DENX QongEVB-LITE") | |||
271 | .init_early = imx31_init_early, | 267 | .init_early = imx31_init_early, |
272 | .init_irq = mx31_init_irq, | 268 | .init_irq = mx31_init_irq, |
273 | .handle_irq = imx31_handle_irq, | 269 | .handle_irq = imx31_handle_irq, |
274 | .timer = &qong_timer, | 270 | .init_time = qong_timer_init, |
275 | .init_machine = qong_init, | 271 | .init_machine = qong_init, |
276 | .restart = mxc_restart, | 272 | .restart = mxc_restart, |
277 | MACHINE_END | 273 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c index fc970409dbaf..b0fa10dd79fe 100644 --- a/arch/arm/mach-imx/mach-scb9328.c +++ b/arch/arm/mach-imx/mach-scb9328.c | |||
@@ -131,10 +131,6 @@ static void __init scb9328_timer_init(void) | |||
131 | mx1_clocks_init(32000); | 131 | mx1_clocks_init(32000); |
132 | } | 132 | } |
133 | 133 | ||
134 | static struct sys_timer scb9328_timer = { | ||
135 | .init = scb9328_timer_init, | ||
136 | }; | ||
137 | |||
138 | MACHINE_START(SCB9328, "Synertronixx scb9328") | 134 | MACHINE_START(SCB9328, "Synertronixx scb9328") |
139 | /* Sascha Hauer */ | 135 | /* Sascha Hauer */ |
140 | .atag_offset = 100, | 136 | .atag_offset = 100, |
@@ -142,7 +138,7 @@ MACHINE_START(SCB9328, "Synertronixx scb9328") | |||
142 | .init_early = imx1_init_early, | 138 | .init_early = imx1_init_early, |
143 | .init_irq = mx1_init_irq, | 139 | .init_irq = mx1_init_irq, |
144 | .handle_irq = imx1_handle_irq, | 140 | .handle_irq = imx1_handle_irq, |
145 | .timer = &scb9328_timer, | 141 | .init_time = scb9328_timer_init, |
146 | .init_machine = scb9328_init, | 142 | .init_machine = scb9328_init, |
147 | .restart = mxc_restart, | 143 | .restart = mxc_restart, |
148 | MACHINE_END | 144 | MACHINE_END |
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c index 3aecf91e4289..0910761e8280 100644 --- a/arch/arm/mach-imx/mach-vpr200.c +++ b/arch/arm/mach-imx/mach-vpr200.c | |||
@@ -305,17 +305,13 @@ static void __init vpr200_timer_init(void) | |||
305 | mx35_clocks_init(); | 305 | mx35_clocks_init(); |
306 | } | 306 | } |
307 | 307 | ||
308 | static struct sys_timer vpr200_timer = { | ||
309 | .init = vpr200_timer_init, | ||
310 | }; | ||
311 | |||
312 | MACHINE_START(VPR200, "VPR200") | 308 | MACHINE_START(VPR200, "VPR200") |
313 | /* Maintainer: Creative Product Design */ | 309 | /* Maintainer: Creative Product Design */ |
314 | .map_io = mx35_map_io, | 310 | .map_io = mx35_map_io, |
315 | .init_early = imx35_init_early, | 311 | .init_early = imx35_init_early, |
316 | .init_irq = mx35_init_irq, | 312 | .init_irq = mx35_init_irq, |
317 | .handle_irq = imx35_handle_irq, | 313 | .handle_irq = imx35_handle_irq, |
318 | .timer = &vpr200_timer, | 314 | .init_time = vpr200_timer_init, |
319 | .init_machine = vpr200_board_init, | 315 | .init_machine = vpr200_board_init, |
320 | .restart = mxc_restart, | 316 | .restart = mxc_restart, |
321 | MACHINE_END | 317 | MACHINE_END |
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index f017302f6d09..62769df36db1 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c | |||
@@ -256,7 +256,6 @@ static struct irqaction mxc_timer_irq = { | |||
256 | static struct clock_event_device clockevent_mxc = { | 256 | static struct clock_event_device clockevent_mxc = { |
257 | .name = "mxc_timer1", | 257 | .name = "mxc_timer1", |
258 | .features = CLOCK_EVT_FEAT_ONESHOT, | 258 | .features = CLOCK_EVT_FEAT_ONESHOT, |
259 | .shift = 32, | ||
260 | .set_mode = mxc_set_mode, | 259 | .set_mode = mxc_set_mode, |
261 | .set_next_event = mx1_2_set_next_event, | 260 | .set_next_event = mx1_2_set_next_event, |
262 | .rating = 200, | 261 | .rating = 200, |
@@ -264,21 +263,13 @@ static struct clock_event_device clockevent_mxc = { | |||
264 | 263 | ||
265 | static int __init mxc_clockevent_init(struct clk *timer_clk) | 264 | static int __init mxc_clockevent_init(struct clk *timer_clk) |
266 | { | 265 | { |
267 | unsigned int c = clk_get_rate(timer_clk); | ||
268 | |||
269 | if (timer_is_v2()) | 266 | if (timer_is_v2()) |
270 | clockevent_mxc.set_next_event = v2_set_next_event; | 267 | clockevent_mxc.set_next_event = v2_set_next_event; |
271 | 268 | ||
272 | clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC, | ||
273 | clockevent_mxc.shift); | ||
274 | clockevent_mxc.max_delta_ns = | ||
275 | clockevent_delta2ns(0xfffffffe, &clockevent_mxc); | ||
276 | clockevent_mxc.min_delta_ns = | ||
277 | clockevent_delta2ns(0xff, &clockevent_mxc); | ||
278 | |||
279 | clockevent_mxc.cpumask = cpumask_of(0); | 269 | clockevent_mxc.cpumask = cpumask_of(0); |
280 | 270 | clockevents_config_and_register(&clockevent_mxc, | |
281 | clockevents_register_device(&clockevent_mxc); | 271 | clk_get_rate(timer_clk), |
272 | 0xff, 0xfffffffe); | ||
282 | 273 | ||
283 | return 0; | 274 | return 0; |
284 | } | 275 | } |
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 11e2a4145807..78f1b3814f77 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -425,7 +425,7 @@ void __init ap_init_early(void) | |||
425 | 425 | ||
426 | #ifdef CONFIG_OF | 426 | #ifdef CONFIG_OF |
427 | 427 | ||
428 | static void __init ap_init_timer_of(void) | 428 | static void __init ap_of_timer_init(void) |
429 | { | 429 | { |
430 | struct device_node *node; | 430 | struct device_node *node; |
431 | const char *path; | 431 | const char *path; |
@@ -464,10 +464,6 @@ static void __init ap_init_timer_of(void) | |||
464 | integrator_clockevent_init(rate, base, irq); | 464 | integrator_clockevent_init(rate, base, irq); |
465 | } | 465 | } |
466 | 466 | ||
467 | static struct sys_timer ap_of_timer = { | ||
468 | .init = ap_init_timer_of, | ||
469 | }; | ||
470 | |||
471 | static const struct of_device_id fpga_irq_of_match[] __initconst = { | 467 | static const struct of_device_id fpga_irq_of_match[] __initconst = { |
472 | { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, | 468 | { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, |
473 | { /* Sentinel */ } | 469 | { /* Sentinel */ } |
@@ -586,7 +582,7 @@ DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)") | |||
586 | .init_early = ap_init_early, | 582 | .init_early = ap_init_early, |
587 | .init_irq = ap_init_irq_of, | 583 | .init_irq = ap_init_irq_of, |
588 | .handle_irq = fpga_handle_irq, | 584 | .handle_irq = fpga_handle_irq, |
589 | .timer = &ap_of_timer, | 585 | .init_time = ap_of_timer_init, |
590 | .init_machine = ap_init_of, | 586 | .init_machine = ap_init_of, |
591 | .restart = integrator_restart, | 587 | .restart = integrator_restart, |
592 | .dt_compat = ap_dt_board_compat, | 588 | .dt_compat = ap_dt_board_compat, |
@@ -638,7 +634,7 @@ static struct platform_device cfi_flash_device = { | |||
638 | .resource = &cfi_flash_resource, | 634 | .resource = &cfi_flash_resource, |
639 | }; | 635 | }; |
640 | 636 | ||
641 | static void __init ap_init_timer(void) | 637 | static void __init ap_timer_init(void) |
642 | { | 638 | { |
643 | struct clk *clk; | 639 | struct clk *clk; |
644 | unsigned long rate; | 640 | unsigned long rate; |
@@ -657,10 +653,6 @@ static void __init ap_init_timer(void) | |||
657 | IRQ_TIMERINT1); | 653 | IRQ_TIMERINT1); |
658 | } | 654 | } |
659 | 655 | ||
660 | static struct sys_timer ap_timer = { | ||
661 | .init = ap_init_timer, | ||
662 | }; | ||
663 | |||
664 | #define INTEGRATOR_SC_VALID_INT 0x003fffff | 656 | #define INTEGRATOR_SC_VALID_INT 0x003fffff |
665 | 657 | ||
666 | static void __init ap_init_irq(void) | 658 | static void __init ap_init_irq(void) |
@@ -716,7 +708,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator") | |||
716 | .init_early = ap_init_early, | 708 | .init_early = ap_init_early, |
717 | .init_irq = ap_init_irq, | 709 | .init_irq = ap_init_irq, |
718 | .handle_irq = fpga_handle_irq, | 710 | .handle_irq = fpga_handle_irq, |
719 | .timer = &ap_timer, | 711 | .init_time = ap_timer_init, |
720 | .init_machine = ap_init, | 712 | .init_machine = ap_init, |
721 | .restart = integrator_restart, | 713 | .restart = integrator_restart, |
722 | MACHINE_END | 714 | MACHINE_END |
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 7322838c0447..4cef9a0ebbb9 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
@@ -251,7 +251,7 @@ static void __init intcp_init_early(void) | |||
251 | 251 | ||
252 | #ifdef CONFIG_OF | 252 | #ifdef CONFIG_OF |
253 | 253 | ||
254 | static void __init intcp_timer_init_of(void) | 254 | static void __init cp_of_timer_init(void) |
255 | { | 255 | { |
256 | struct device_node *node; | 256 | struct device_node *node; |
257 | const char *path; | 257 | const char *path; |
@@ -283,10 +283,6 @@ static void __init intcp_timer_init_of(void) | |||
283 | sp804_clockevents_init(base, irq, node->name); | 283 | sp804_clockevents_init(base, irq, node->name); |
284 | } | 284 | } |
285 | 285 | ||
286 | static struct sys_timer cp_of_timer = { | ||
287 | .init = intcp_timer_init_of, | ||
288 | }; | ||
289 | |||
290 | static const struct of_device_id fpga_irq_of_match[] __initconst = { | 286 | static const struct of_device_id fpga_irq_of_match[] __initconst = { |
291 | { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, | 287 | { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, |
292 | { /* Sentinel */ } | 288 | { /* Sentinel */ } |
@@ -390,7 +386,7 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)") | |||
390 | .init_early = intcp_init_early, | 386 | .init_early = intcp_init_early, |
391 | .init_irq = intcp_init_irq_of, | 387 | .init_irq = intcp_init_irq_of, |
392 | .handle_irq = fpga_handle_irq, | 388 | .handle_irq = fpga_handle_irq, |
393 | .timer = &cp_of_timer, | 389 | .init_time = cp_of_timer_init, |
394 | .init_machine = intcp_init_of, | 390 | .init_machine = intcp_init_of, |
395 | .restart = integrator_restart, | 391 | .restart = integrator_restart, |
396 | .dt_compat = intcp_dt_board_compat, | 392 | .dt_compat = intcp_dt_board_compat, |
@@ -512,7 +508,7 @@ static void __init intcp_init_irq(void) | |||
512 | #define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE) | 508 | #define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE) |
513 | #define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE) | 509 | #define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE) |
514 | 510 | ||
515 | static void __init intcp_timer_init(void) | 511 | static void __init cp_timer_init(void) |
516 | { | 512 | { |
517 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); | 513 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); |
518 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); | 514 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); |
@@ -522,10 +518,6 @@ static void __init intcp_timer_init(void) | |||
522 | sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1"); | 518 | sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1"); |
523 | } | 519 | } |
524 | 520 | ||
525 | static struct sys_timer cp_timer = { | ||
526 | .init = intcp_timer_init, | ||
527 | }; | ||
528 | |||
529 | #define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 } | 521 | #define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 } |
530 | #define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT } | 522 | #define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT } |
531 | 523 | ||
@@ -565,7 +557,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") | |||
565 | .init_early = intcp_init_early, | 557 | .init_early = intcp_init_early, |
566 | .init_irq = intcp_init_irq, | 558 | .init_irq = intcp_init_irq, |
567 | .handle_irq = fpga_handle_irq, | 559 | .handle_irq = fpga_handle_irq, |
568 | .timer = &cp_timer, | 560 | .init_time = cp_timer_init, |
569 | .init_machine = intcp_init, | 561 | .init_machine = intcp_init, |
570 | .restart = integrator_restart, | 562 | .restart = integrator_restart, |
571 | MACHINE_END | 563 | MACHINE_END |
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c index e3f3e7daa79e..02a8228ac2d3 100644 --- a/arch/arm/mach-iop13xx/iq81340mc.c +++ b/arch/arm/mach-iop13xx/iq81340mc.c | |||
@@ -84,17 +84,13 @@ static void __init iq81340mc_timer_init(void) | |||
84 | iop_init_time(bus_freq); | 84 | iop_init_time(bus_freq); |
85 | } | 85 | } |
86 | 86 | ||
87 | static struct sys_timer iq81340mc_timer = { | ||
88 | .init = iq81340mc_timer_init, | ||
89 | }; | ||
90 | |||
91 | MACHINE_START(IQ81340MC, "Intel IQ81340MC") | 87 | MACHINE_START(IQ81340MC, "Intel IQ81340MC") |
92 | /* Maintainer: Dan Williams <dan.j.williams@intel.com> */ | 88 | /* Maintainer: Dan Williams <dan.j.williams@intel.com> */ |
93 | .atag_offset = 0x100, | 89 | .atag_offset = 0x100, |
94 | .init_early = iop13xx_init_early, | 90 | .init_early = iop13xx_init_early, |
95 | .map_io = iop13xx_map_io, | 91 | .map_io = iop13xx_map_io, |
96 | .init_irq = iop13xx_init_irq, | 92 | .init_irq = iop13xx_init_irq, |
97 | .timer = &iq81340mc_timer, | 93 | .init_time = iq81340mc_timer_init, |
98 | .init_machine = iq81340mc_init, | 94 | .init_machine = iq81340mc_init, |
99 | .restart = iop13xx_restart, | 95 | .restart = iop13xx_restart, |
100 | MACHINE_END | 96 | MACHINE_END |
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c index e94744111634..1b80f10722b3 100644 --- a/arch/arm/mach-iop13xx/iq81340sc.c +++ b/arch/arm/mach-iop13xx/iq81340sc.c | |||
@@ -86,17 +86,13 @@ static void __init iq81340sc_timer_init(void) | |||
86 | iop_init_time(bus_freq); | 86 | iop_init_time(bus_freq); |
87 | } | 87 | } |
88 | 88 | ||
89 | static struct sys_timer iq81340sc_timer = { | ||
90 | .init = iq81340sc_timer_init, | ||
91 | }; | ||
92 | |||
93 | MACHINE_START(IQ81340SC, "Intel IQ81340SC") | 89 | MACHINE_START(IQ81340SC, "Intel IQ81340SC") |
94 | /* Maintainer: Dan Williams <dan.j.williams@intel.com> */ | 90 | /* Maintainer: Dan Williams <dan.j.williams@intel.com> */ |
95 | .atag_offset = 0x100, | 91 | .atag_offset = 0x100, |
96 | .init_early = iop13xx_init_early, | 92 | .init_early = iop13xx_init_early, |
97 | .map_io = iop13xx_map_io, | 93 | .map_io = iop13xx_map_io, |
98 | .init_irq = iop13xx_init_irq, | 94 | .init_irq = iop13xx_init_irq, |
99 | .timer = &iq81340sc_timer, | 95 | .init_time = iq81340sc_timer_init, |
100 | .init_machine = iq81340sc_init, | 96 | .init_machine = iq81340sc_init, |
101 | .restart = iop13xx_restart, | 97 | .restart = iop13xx_restart, |
102 | MACHINE_END | 98 | MACHINE_END |
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c index 9f369f09c29d..31fbb6c61b25 100644 --- a/arch/arm/mach-iop32x/em7210.c +++ b/arch/arm/mach-iop32x/em7210.c | |||
@@ -40,10 +40,6 @@ static void __init em7210_timer_init(void) | |||
40 | iop_init_time(200000000); | 40 | iop_init_time(200000000); |
41 | } | 41 | } |
42 | 42 | ||
43 | static struct sys_timer em7210_timer = { | ||
44 | .init = em7210_timer_init, | ||
45 | }; | ||
46 | |||
47 | /* | 43 | /* |
48 | * EM7210 RTC | 44 | * EM7210 RTC |
49 | */ | 45 | */ |
@@ -205,7 +201,7 @@ MACHINE_START(EM7210, "Lanner EM7210") | |||
205 | .atag_offset = 0x100, | 201 | .atag_offset = 0x100, |
206 | .map_io = em7210_map_io, | 202 | .map_io = em7210_map_io, |
207 | .init_irq = iop32x_init_irq, | 203 | .init_irq = iop32x_init_irq, |
208 | .timer = &em7210_timer, | 204 | .init_time = em7210_timer_init, |
209 | .init_machine = em7210_init_machine, | 205 | .init_machine = em7210_init_machine, |
210 | .restart = iop3xx_restart, | 206 | .restart = iop3xx_restart, |
211 | MACHINE_END | 207 | MACHINE_END |
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c index 02e20c3912ba..ac304705fe68 100644 --- a/arch/arm/mach-iop32x/glantank.c +++ b/arch/arm/mach-iop32x/glantank.c | |||
@@ -44,10 +44,6 @@ static void __init glantank_timer_init(void) | |||
44 | iop_init_time(200000000); | 44 | iop_init_time(200000000); |
45 | } | 45 | } |
46 | 46 | ||
47 | static struct sys_timer glantank_timer = { | ||
48 | .init = glantank_timer_init, | ||
49 | }; | ||
50 | |||
51 | 47 | ||
52 | /* | 48 | /* |
53 | * GLAN Tank I/O. | 49 | * GLAN Tank I/O. |
@@ -209,7 +205,7 @@ MACHINE_START(GLANTANK, "GLAN Tank") | |||
209 | .atag_offset = 0x100, | 205 | .atag_offset = 0x100, |
210 | .map_io = glantank_map_io, | 206 | .map_io = glantank_map_io, |
211 | .init_irq = iop32x_init_irq, | 207 | .init_irq = iop32x_init_irq, |
212 | .timer = &glantank_timer, | 208 | .init_time = glantank_timer_init, |
213 | .init_machine = glantank_init_machine, | 209 | .init_machine = glantank_init_machine, |
214 | .restart = iop3xx_restart, | 210 | .restart = iop3xx_restart, |
215 | MACHINE_END | 211 | MACHINE_END |
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c index ddd1c7ecfe57..f2cd2966212d 100644 --- a/arch/arm/mach-iop32x/iq31244.c +++ b/arch/arm/mach-iop32x/iq31244.c | |||
@@ -75,10 +75,6 @@ static void __init iq31244_timer_init(void) | |||
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | static struct sys_timer iq31244_timer = { | ||
79 | .init = iq31244_timer_init, | ||
80 | }; | ||
81 | |||
82 | 78 | ||
83 | /* | 79 | /* |
84 | * IQ31244 I/O. | 80 | * IQ31244 I/O. |
@@ -314,7 +310,7 @@ MACHINE_START(IQ31244, "Intel IQ31244") | |||
314 | .atag_offset = 0x100, | 310 | .atag_offset = 0x100, |
315 | .map_io = iq31244_map_io, | 311 | .map_io = iq31244_map_io, |
316 | .init_irq = iop32x_init_irq, | 312 | .init_irq = iop32x_init_irq, |
317 | .timer = &iq31244_timer, | 313 | .init_time = iq31244_timer_init, |
318 | .init_machine = iq31244_init_machine, | 314 | .init_machine = iq31244_init_machine, |
319 | .restart = iop3xx_restart, | 315 | .restart = iop3xx_restart, |
320 | MACHINE_END | 316 | MACHINE_END |
@@ -329,7 +325,7 @@ MACHINE_START(EP80219, "Intel EP80219") | |||
329 | .atag_offset = 0x100, | 325 | .atag_offset = 0x100, |
330 | .map_io = iq31244_map_io, | 326 | .map_io = iq31244_map_io, |
331 | .init_irq = iop32x_init_irq, | 327 | .init_irq = iop32x_init_irq, |
332 | .timer = &iq31244_timer, | 328 | .init_time = iq31244_timer_init, |
333 | .init_machine = iq31244_init_machine, | 329 | .init_machine = iq31244_init_machine, |
334 | .restart = iop3xx_restart, | 330 | .restart = iop3xx_restart, |
335 | MACHINE_END | 331 | MACHINE_END |
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c index bf155e6a3b45..015435de90dd 100644 --- a/arch/arm/mach-iop32x/iq80321.c +++ b/arch/arm/mach-iop32x/iq80321.c | |||
@@ -43,10 +43,6 @@ static void __init iq80321_timer_init(void) | |||
43 | iop_init_time(200000000); | 43 | iop_init_time(200000000); |
44 | } | 44 | } |
45 | 45 | ||
46 | static struct sys_timer iq80321_timer = { | ||
47 | .init = iq80321_timer_init, | ||
48 | }; | ||
49 | |||
50 | 46 | ||
51 | /* | 47 | /* |
52 | * IQ80321 I/O. | 48 | * IQ80321 I/O. |
@@ -188,7 +184,7 @@ MACHINE_START(IQ80321, "Intel IQ80321") | |||
188 | .atag_offset = 0x100, | 184 | .atag_offset = 0x100, |
189 | .map_io = iq80321_map_io, | 185 | .map_io = iq80321_map_io, |
190 | .init_irq = iop32x_init_irq, | 186 | .init_irq = iop32x_init_irq, |
191 | .timer = &iq80321_timer, | 187 | .init_time = iq80321_timer_init, |
192 | .init_machine = iq80321_init_machine, | 188 | .init_machine = iq80321_init_machine, |
193 | .restart = iop3xx_restart, | 189 | .restart = iop3xx_restart, |
194 | MACHINE_END | 190 | MACHINE_END |
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c index 5a7ae91e8849..ea0984a7449e 100644 --- a/arch/arm/mach-iop32x/n2100.c +++ b/arch/arm/mach-iop32x/n2100.c | |||
@@ -50,10 +50,6 @@ static void __init n2100_timer_init(void) | |||
50 | iop_init_time(198000000); | 50 | iop_init_time(198000000); |
51 | } | 51 | } |
52 | 52 | ||
53 | static struct sys_timer n2100_timer = { | ||
54 | .init = n2100_timer_init, | ||
55 | }; | ||
56 | |||
57 | 53 | ||
58 | /* | 54 | /* |
59 | * N2100 I/O. | 55 | * N2100 I/O. |
@@ -337,7 +333,7 @@ MACHINE_START(N2100, "Thecus N2100") | |||
337 | .atag_offset = 0x100, | 333 | .atag_offset = 0x100, |
338 | .map_io = n2100_map_io, | 334 | .map_io = n2100_map_io, |
339 | .init_irq = iop32x_init_irq, | 335 | .init_irq = iop32x_init_irq, |
340 | .timer = &n2100_timer, | 336 | .init_time = n2100_timer_init, |
341 | .init_machine = n2100_init_machine, | 337 | .init_machine = n2100_init_machine, |
342 | .restart = n2100_restart, | 338 | .restart = n2100_restart, |
343 | MACHINE_END | 339 | MACHINE_END |
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c index e74a7debe793..c43304a10fa7 100644 --- a/arch/arm/mach-iop33x/iq80331.c +++ b/arch/arm/mach-iop33x/iq80331.c | |||
@@ -45,10 +45,6 @@ static void __init iq80331_timer_init(void) | |||
45 | iop_init_time(266000000); | 45 | iop_init_time(266000000); |
46 | } | 46 | } |
47 | 47 | ||
48 | static struct sys_timer iq80331_timer = { | ||
49 | .init = iq80331_timer_init, | ||
50 | }; | ||
51 | |||
52 | 48 | ||
53 | /* | 49 | /* |
54 | * IQ80331 PCI. | 50 | * IQ80331 PCI. |
@@ -143,7 +139,7 @@ MACHINE_START(IQ80331, "Intel IQ80331") | |||
143 | .atag_offset = 0x100, | 139 | .atag_offset = 0x100, |
144 | .map_io = iop3xx_map_io, | 140 | .map_io = iop3xx_map_io, |
145 | .init_irq = iop33x_init_irq, | 141 | .init_irq = iop33x_init_irq, |
146 | .timer = &iq80331_timer, | 142 | .init_time = iq80331_timer_init, |
147 | .init_machine = iq80331_init_machine, | 143 | .init_machine = iq80331_init_machine, |
148 | .restart = iop3xx_restart, | 144 | .restart = iop3xx_restart, |
149 | MACHINE_END | 145 | MACHINE_END |
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c index e2f5beece6e8..8192987e78e5 100644 --- a/arch/arm/mach-iop33x/iq80332.c +++ b/arch/arm/mach-iop33x/iq80332.c | |||
@@ -45,10 +45,6 @@ static void __init iq80332_timer_init(void) | |||
45 | iop_init_time(266000000); | 45 | iop_init_time(266000000); |
46 | } | 46 | } |
47 | 47 | ||
48 | static struct sys_timer iq80332_timer = { | ||
49 | .init = iq80332_timer_init, | ||
50 | }; | ||
51 | |||
52 | 48 | ||
53 | /* | 49 | /* |
54 | * IQ80332 PCI. | 50 | * IQ80332 PCI. |
@@ -143,7 +139,7 @@ MACHINE_START(IQ80332, "Intel IQ80332") | |||
143 | .atag_offset = 0x100, | 139 | .atag_offset = 0x100, |
144 | .map_io = iop3xx_map_io, | 140 | .map_io = iop3xx_map_io, |
145 | .init_irq = iop33x_init_irq, | 141 | .init_irq = iop33x_init_irq, |
146 | .timer = &iq80332_timer, | 142 | .init_time = iq80332_timer_init, |
147 | .init_machine = iq80332_init_machine, | 143 | .init_machine = iq80332_init_machine, |
148 | .restart = iop3xx_restart, | 144 | .restart = iop3xx_restart, |
149 | MACHINE_END | 145 | MACHINE_END |
diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c index 90e42e9982cb..6beec150c060 100644 --- a/arch/arm/mach-ixp4xx/avila-setup.c +++ b/arch/arm/mach-ixp4xx/avila-setup.c | |||
@@ -167,7 +167,7 @@ MACHINE_START(AVILA, "Gateworks Avila Network Platform") | |||
167 | .map_io = ixp4xx_map_io, | 167 | .map_io = ixp4xx_map_io, |
168 | .init_early = ixp4xx_init_early, | 168 | .init_early = ixp4xx_init_early, |
169 | .init_irq = ixp4xx_init_irq, | 169 | .init_irq = ixp4xx_init_irq, |
170 | .timer = &ixp4xx_timer, | 170 | .init_time = ixp4xx_timer_init, |
171 | .atag_offset = 0x100, | 171 | .atag_offset = 0x100, |
172 | .init_machine = avila_init, | 172 | .init_machine = avila_init, |
173 | #if defined(CONFIG_PCI) | 173 | #if defined(CONFIG_PCI) |
@@ -187,7 +187,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc Loft board") | |||
187 | .map_io = ixp4xx_map_io, | 187 | .map_io = ixp4xx_map_io, |
188 | .init_early = ixp4xx_init_early, | 188 | .init_early = ixp4xx_init_early, |
189 | .init_irq = ixp4xx_init_irq, | 189 | .init_irq = ixp4xx_init_irq, |
190 | .timer = &ixp4xx_timer, | 190 | .init_time = ixp4xx_timer_init, |
191 | .atag_offset = 0x100, | 191 | .atag_offset = 0x100, |
192 | .init_machine = avila_init, | 192 | .init_machine = avila_init, |
193 | #if defined(CONFIG_PCI) | 193 | #if defined(CONFIG_PCI) |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 8c0c0e2d0727..1dbeb7c99d58 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -307,10 +307,6 @@ void __init ixp4xx_timer_init(void) | |||
307 | ixp4xx_clockevent_init(); | 307 | ixp4xx_clockevent_init(); |
308 | } | 308 | } |
309 | 309 | ||
310 | struct sys_timer ixp4xx_timer = { | ||
311 | .init = ixp4xx_timer_init, | ||
312 | }; | ||
313 | |||
314 | static struct pxa2xx_udc_mach_info ixp4xx_udc_info; | 310 | static struct pxa2xx_udc_mach_info ixp4xx_udc_info; |
315 | 311 | ||
316 | void __init ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info) | 312 | void __init ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info) |
@@ -523,22 +519,15 @@ static struct clock_event_device clockevent_ixp4xx = { | |||
523 | .name = "ixp4xx timer1", | 519 | .name = "ixp4xx timer1", |
524 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 520 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
525 | .rating = 200, | 521 | .rating = 200, |
526 | .shift = 24, | ||
527 | .set_mode = ixp4xx_set_mode, | 522 | .set_mode = ixp4xx_set_mode, |
528 | .set_next_event = ixp4xx_set_next_event, | 523 | .set_next_event = ixp4xx_set_next_event, |
529 | }; | 524 | }; |
530 | 525 | ||
531 | static void __init ixp4xx_clockevent_init(void) | 526 | static void __init ixp4xx_clockevent_init(void) |
532 | { | 527 | { |
533 | clockevent_ixp4xx.mult = div_sc(IXP4XX_TIMER_FREQ, NSEC_PER_SEC, | ||
534 | clockevent_ixp4xx.shift); | ||
535 | clockevent_ixp4xx.max_delta_ns = | ||
536 | clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx); | ||
537 | clockevent_ixp4xx.min_delta_ns = | ||
538 | clockevent_delta2ns(0xf, &clockevent_ixp4xx); | ||
539 | clockevent_ixp4xx.cpumask = cpumask_of(0); | 528 | clockevent_ixp4xx.cpumask = cpumask_of(0); |
540 | 529 | clockevents_config_and_register(&clockevent_ixp4xx, IXP4XX_TIMER_FREQ, | |
541 | clockevents_register_device(&clockevent_ixp4xx); | 530 | 0xf, 0xfffffffe); |
542 | } | 531 | } |
543 | 532 | ||
544 | void ixp4xx_restart(char mode, const char *cmd) | 533 | void ixp4xx_restart(char mode, const char *cmd) |
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c index 1b83110028d6..820cae8608fc 100644 --- a/arch/arm/mach-ixp4xx/coyote-setup.c +++ b/arch/arm/mach-ixp4xx/coyote-setup.c | |||
@@ -112,7 +112,7 @@ MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote") | |||
112 | .map_io = ixp4xx_map_io, | 112 | .map_io = ixp4xx_map_io, |
113 | .init_early = ixp4xx_init_early, | 113 | .init_early = ixp4xx_init_early, |
114 | .init_irq = ixp4xx_init_irq, | 114 | .init_irq = ixp4xx_init_irq, |
115 | .timer = &ixp4xx_timer, | 115 | .init_time = ixp4xx_timer_init, |
116 | .atag_offset = 0x100, | 116 | .atag_offset = 0x100, |
117 | .init_machine = coyote_init, | 117 | .init_machine = coyote_init, |
118 | #if defined(CONFIG_PCI) | 118 | #if defined(CONFIG_PCI) |
@@ -132,7 +132,7 @@ MACHINE_START(IXDPG425, "Intel IXDPG425") | |||
132 | .map_io = ixp4xx_map_io, | 132 | .map_io = ixp4xx_map_io, |
133 | .init_early = ixp4xx_init_early, | 133 | .init_early = ixp4xx_init_early, |
134 | .init_irq = ixp4xx_init_irq, | 134 | .init_irq = ixp4xx_init_irq, |
135 | .timer = &ixp4xx_timer, | 135 | .init_time = ixp4xx_timer_init, |
136 | .atag_offset = 0x100, | 136 | .atag_offset = 0x100, |
137 | .init_machine = coyote_init, | 137 | .init_machine = coyote_init, |
138 | .restart = ixp4xx_restart, | 138 | .restart = ixp4xx_restart, |
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c index 97a0af8f1955..5d413f8c5700 100644 --- a/arch/arm/mach-ixp4xx/dsmg600-setup.c +++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c | |||
@@ -226,10 +226,6 @@ static void __init dsmg600_timer_init(void) | |||
226 | ixp4xx_timer_init(); | 226 | ixp4xx_timer_init(); |
227 | } | 227 | } |
228 | 228 | ||
229 | static struct sys_timer dsmg600_timer = { | ||
230 | .init = dsmg600_timer_init, | ||
231 | }; | ||
232 | |||
233 | static void __init dsmg600_init(void) | 229 | static void __init dsmg600_init(void) |
234 | { | 230 | { |
235 | ixp4xx_sys_init(); | 231 | ixp4xx_sys_init(); |
@@ -282,7 +278,7 @@ MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") | |||
282 | .map_io = ixp4xx_map_io, | 278 | .map_io = ixp4xx_map_io, |
283 | .init_early = ixp4xx_init_early, | 279 | .init_early = ixp4xx_init_early, |
284 | .init_irq = ixp4xx_init_irq, | 280 | .init_irq = ixp4xx_init_irq, |
285 | .timer = &dsmg600_timer, | 281 | .init_time = dsmg600_timer_init, |
286 | .init_machine = dsmg600_init, | 282 | .init_machine = dsmg600_init, |
287 | #if defined(CONFIG_PCI) | 283 | #if defined(CONFIG_PCI) |
288 | .dma_zone_size = SZ_64M, | 284 | .dma_zone_size = SZ_64M, |
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c index 9175a25a7511..429966b756ed 100644 --- a/arch/arm/mach-ixp4xx/fsg-setup.c +++ b/arch/arm/mach-ixp4xx/fsg-setup.c | |||
@@ -272,7 +272,7 @@ MACHINE_START(FSG, "Freecom FSG-3") | |||
272 | .map_io = ixp4xx_map_io, | 272 | .map_io = ixp4xx_map_io, |
273 | .init_early = ixp4xx_init_early, | 273 | .init_early = ixp4xx_init_early, |
274 | .init_irq = ixp4xx_init_irq, | 274 | .init_irq = ixp4xx_init_irq, |
275 | .timer = &ixp4xx_timer, | 275 | .init_time = ixp4xx_timer_init, |
276 | .atag_offset = 0x100, | 276 | .atag_offset = 0x100, |
277 | .init_machine = fsg_init, | 277 | .init_machine = fsg_init, |
278 | #if defined(CONFIG_PCI) | 278 | #if defined(CONFIG_PCI) |
diff --git a/arch/arm/mach-ixp4xx/gateway7001-setup.c b/arch/arm/mach-ixp4xx/gateway7001-setup.c index 033c71758953..3d24b3fcee87 100644 --- a/arch/arm/mach-ixp4xx/gateway7001-setup.c +++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c | |||
@@ -99,7 +99,7 @@ MACHINE_START(GATEWAY7001, "Gateway 7001 AP") | |||
99 | .map_io = ixp4xx_map_io, | 99 | .map_io = ixp4xx_map_io, |
100 | .init_early = ixp4xx_init_early, | 100 | .init_early = ixp4xx_init_early, |
101 | .init_irq = ixp4xx_init_irq, | 101 | .init_irq = ixp4xx_init_irq, |
102 | .timer = &ixp4xx_timer, | 102 | .init_time = ixp4xx_timer_init, |
103 | .atag_offset = 0x100, | 103 | .atag_offset = 0x100, |
104 | .init_machine = gateway7001_init, | 104 | .init_machine = gateway7001_init, |
105 | #if defined(CONFIG_PCI) | 105 | #if defined(CONFIG_PCI) |
diff --git a/arch/arm/mach-ixp4xx/goramo_mlr.c b/arch/arm/mach-ixp4xx/goramo_mlr.c index 53b8348dfcc2..e54ff491c105 100644 --- a/arch/arm/mach-ixp4xx/goramo_mlr.c +++ b/arch/arm/mach-ixp4xx/goramo_mlr.c | |||
@@ -498,7 +498,7 @@ MACHINE_START(GORAMO_MLR, "MultiLink") | |||
498 | .map_io = ixp4xx_map_io, | 498 | .map_io = ixp4xx_map_io, |
499 | .init_early = ixp4xx_init_early, | 499 | .init_early = ixp4xx_init_early, |
500 | .init_irq = ixp4xx_init_irq, | 500 | .init_irq = ixp4xx_init_irq, |
501 | .timer = &ixp4xx_timer, | 501 | .init_time = ixp4xx_timer_init, |
502 | .atag_offset = 0x100, | 502 | .atag_offset = 0x100, |
503 | .init_machine = gmlr_init, | 503 | .init_machine = gmlr_init, |
504 | #if defined(CONFIG_PCI) | 504 | #if defined(CONFIG_PCI) |
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c index 18ebc6be7969..16a12994fb53 100644 --- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c +++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c | |||
@@ -167,7 +167,7 @@ MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)") | |||
167 | .map_io = ixp4xx_map_io, | 167 | .map_io = ixp4xx_map_io, |
168 | .init_early = ixp4xx_init_early, | 168 | .init_early = ixp4xx_init_early, |
169 | .init_irq = ixp4xx_init_irq, | 169 | .init_irq = ixp4xx_init_irq, |
170 | .timer = &ixp4xx_timer, | 170 | .init_time = ixp4xx_timer_init, |
171 | .atag_offset = 0x100, | 171 | .atag_offset = 0x100, |
172 | .init_machine = gtwx5715_init, | 172 | .init_machine = gtwx5715_init, |
173 | #if defined(CONFIG_PCI) | 173 | #if defined(CONFIG_PCI) |
diff --git a/arch/arm/mach-ixp4xx/include/mach/platform.h b/arch/arm/mach-ixp4xx/include/mach/platform.h index 5bce94aacca9..db5afb69c123 100644 --- a/arch/arm/mach-ixp4xx/include/mach/platform.h +++ b/arch/arm/mach-ixp4xx/include/mach/platform.h | |||
@@ -89,8 +89,6 @@ struct ixp4xx_pata_data { | |||
89 | void __iomem *cs1; | 89 | void __iomem *cs1; |
90 | }; | 90 | }; |
91 | 91 | ||
92 | struct sys_timer; | ||
93 | |||
94 | #define IXP4XX_ETH_NPEA 0x00 | 92 | #define IXP4XX_ETH_NPEA 0x00 |
95 | #define IXP4XX_ETH_NPEB 0x10 | 93 | #define IXP4XX_ETH_NPEB 0x10 |
96 | #define IXP4XX_ETH_NPEC 0x20 | 94 | #define IXP4XX_ETH_NPEC 0x20 |
@@ -125,7 +123,6 @@ extern void ixp4xx_init_early(void); | |||
125 | extern void ixp4xx_init_irq(void); | 123 | extern void ixp4xx_init_irq(void); |
126 | extern void ixp4xx_sys_init(void); | 124 | extern void ixp4xx_sys_init(void); |
127 | extern void ixp4xx_timer_init(void); | 125 | extern void ixp4xx_timer_init(void); |
128 | extern struct sys_timer ixp4xx_timer; | ||
129 | extern void ixp4xx_restart(char, const char *); | 126 | extern void ixp4xx_restart(char, const char *); |
130 | extern void ixp4xx_pci_preinit(void); | 127 | extern void ixp4xx_pci_preinit(void); |
131 | struct pci_sys_data; | 128 | struct pci_sys_data; |
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c index 108a9d3f382d..22d688b7d513 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c | |||
@@ -252,7 +252,7 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") | |||
252 | .map_io = ixp4xx_map_io, | 252 | .map_io = ixp4xx_map_io, |
253 | .init_early = ixp4xx_init_early, | 253 | .init_early = ixp4xx_init_early, |
254 | .init_irq = ixp4xx_init_irq, | 254 | .init_irq = ixp4xx_init_irq, |
255 | .timer = &ixp4xx_timer, | 255 | .init_time = ixp4xx_timer_init, |
256 | .atag_offset = 0x100, | 256 | .atag_offset = 0x100, |
257 | .init_machine = ixdp425_init, | 257 | .init_machine = ixdp425_init, |
258 | #if defined(CONFIG_PCI) | 258 | #if defined(CONFIG_PCI) |
@@ -268,7 +268,7 @@ MACHINE_START(IXDP465, "Intel IXDP465 Development Platform") | |||
268 | .map_io = ixp4xx_map_io, | 268 | .map_io = ixp4xx_map_io, |
269 | .init_early = ixp4xx_init_early, | 269 | .init_early = ixp4xx_init_early, |
270 | .init_irq = ixp4xx_init_irq, | 270 | .init_irq = ixp4xx_init_irq, |
271 | .timer = &ixp4xx_timer, | 271 | .init_time = ixp4xx_timer_init, |
272 | .atag_offset = 0x100, | 272 | .atag_offset = 0x100, |
273 | .init_machine = ixdp425_init, | 273 | .init_machine = ixdp425_init, |
274 | #if defined(CONFIG_PCI) | 274 | #if defined(CONFIG_PCI) |
@@ -283,7 +283,7 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") | |||
283 | .map_io = ixp4xx_map_io, | 283 | .map_io = ixp4xx_map_io, |
284 | .init_early = ixp4xx_init_early, | 284 | .init_early = ixp4xx_init_early, |
285 | .init_irq = ixp4xx_init_irq, | 285 | .init_irq = ixp4xx_init_irq, |
286 | .timer = &ixp4xx_timer, | 286 | .init_time = ixp4xx_timer_init, |
287 | .atag_offset = 0x100, | 287 | .atag_offset = 0x100, |
288 | .init_machine = ixdp425_init, | 288 | .init_machine = ixdp425_init, |
289 | #if defined(CONFIG_PCI) | 289 | #if defined(CONFIG_PCI) |
@@ -298,7 +298,7 @@ MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform") | |||
298 | .map_io = ixp4xx_map_io, | 298 | .map_io = ixp4xx_map_io, |
299 | .init_early = ixp4xx_init_early, | 299 | .init_early = ixp4xx_init_early, |
300 | .init_irq = ixp4xx_init_irq, | 300 | .init_irq = ixp4xx_init_irq, |
301 | .timer = &ixp4xx_timer, | 301 | .init_time = ixp4xx_timer_init, |
302 | .atag_offset = 0x100, | 302 | .atag_offset = 0x100, |
303 | .init_machine = ixdp425_init, | 303 | .init_machine = ixdp425_init, |
304 | #if defined(CONFIG_PCI) | 304 | #if defined(CONFIG_PCI) |
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c index 33cb0955b6bf..ed667ce9f576 100644 --- a/arch/arm/mach-ixp4xx/nas100d-setup.c +++ b/arch/arm/mach-ixp4xx/nas100d-setup.c | |||
@@ -317,7 +317,7 @@ MACHINE_START(NAS100D, "Iomega NAS 100d") | |||
317 | .map_io = ixp4xx_map_io, | 317 | .map_io = ixp4xx_map_io, |
318 | .init_early = ixp4xx_init_early, | 318 | .init_early = ixp4xx_init_early, |
319 | .init_irq = ixp4xx_init_irq, | 319 | .init_irq = ixp4xx_init_irq, |
320 | .timer = &ixp4xx_timer, | 320 | .init_time = ixp4xx_timer_init, |
321 | .init_machine = nas100d_init, | 321 | .init_machine = nas100d_init, |
322 | #if defined(CONFIG_PCI) | 322 | #if defined(CONFIG_PCI) |
323 | .dma_zone_size = SZ_64M, | 323 | .dma_zone_size = SZ_64M, |
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c index e2903faaebb3..7e55236c26ea 100644 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c | |||
@@ -232,10 +232,6 @@ static void __init nslu2_timer_init(void) | |||
232 | ixp4xx_timer_init(); | 232 | ixp4xx_timer_init(); |
233 | } | 233 | } |
234 | 234 | ||
235 | static struct sys_timer nslu2_timer = { | ||
236 | .init = nslu2_timer_init, | ||
237 | }; | ||
238 | |||
239 | static void __init nslu2_init(void) | 235 | static void __init nslu2_init(void) |
240 | { | 236 | { |
241 | uint8_t __iomem *f; | 237 | uint8_t __iomem *f; |
@@ -303,7 +299,7 @@ MACHINE_START(NSLU2, "Linksys NSLU2") | |||
303 | .map_io = ixp4xx_map_io, | 299 | .map_io = ixp4xx_map_io, |
304 | .init_early = ixp4xx_init_early, | 300 | .init_early = ixp4xx_init_early, |
305 | .init_irq = ixp4xx_init_irq, | 301 | .init_irq = ixp4xx_init_irq, |
306 | .timer = &nslu2_timer, | 302 | .init_time = nslu2_timer_init, |
307 | .init_machine = nslu2_init, | 303 | .init_machine = nslu2_init, |
308 | #if defined(CONFIG_PCI) | 304 | #if defined(CONFIG_PCI) |
309 | .dma_zone_size = SZ_64M, | 305 | .dma_zone_size = SZ_64M, |
diff --git a/arch/arm/mach-ixp4xx/omixp-setup.c b/arch/arm/mach-ixp4xx/omixp-setup.c index 158ddb79821d..46a89f5e8269 100644 --- a/arch/arm/mach-ixp4xx/omixp-setup.c +++ b/arch/arm/mach-ixp4xx/omixp-setup.c | |||
@@ -245,7 +245,7 @@ MACHINE_START(DEVIXP, "Omicron DEVIXP") | |||
245 | .map_io = ixp4xx_map_io, | 245 | .map_io = ixp4xx_map_io, |
246 | .init_early = ixp4xx_init_early, | 246 | .init_early = ixp4xx_init_early, |
247 | .init_irq = ixp4xx_init_irq, | 247 | .init_irq = ixp4xx_init_irq, |
248 | .timer = &ixp4xx_timer, | 248 | .init_time = ixp4xx_timer_init, |
249 | .init_machine = omixp_init, | 249 | .init_machine = omixp_init, |
250 | .restart = ixp4xx_restart, | 250 | .restart = ixp4xx_restart, |
251 | MACHINE_END | 251 | MACHINE_END |
@@ -257,7 +257,7 @@ MACHINE_START(MICCPT, "Omicron MICCPT") | |||
257 | .map_io = ixp4xx_map_io, | 257 | .map_io = ixp4xx_map_io, |
258 | .init_early = ixp4xx_init_early, | 258 | .init_early = ixp4xx_init_early, |
259 | .init_irq = ixp4xx_init_irq, | 259 | .init_irq = ixp4xx_init_irq, |
260 | .timer = &ixp4xx_timer, | 260 | .init_time = ixp4xx_timer_init, |
261 | .init_machine = omixp_init, | 261 | .init_machine = omixp_init, |
262 | #if defined(CONFIG_PCI) | 262 | #if defined(CONFIG_PCI) |
263 | .dma_zone_size = SZ_64M, | 263 | .dma_zone_size = SZ_64M, |
@@ -272,7 +272,7 @@ MACHINE_START(MIC256, "Omicron MIC256") | |||
272 | .map_io = ixp4xx_map_io, | 272 | .map_io = ixp4xx_map_io, |
273 | .init_early = ixp4xx_init_early, | 273 | .init_early = ixp4xx_init_early, |
274 | .init_irq = ixp4xx_init_irq, | 274 | .init_irq = ixp4xx_init_irq, |
275 | .timer = &ixp4xx_timer, | 275 | .init_time = ixp4xx_timer_init, |
276 | .init_machine = omixp_init, | 276 | .init_machine = omixp_init, |
277 | .restart = ixp4xx_restart, | 277 | .restart = ixp4xx_restart, |
278 | MACHINE_END | 278 | MACHINE_END |
diff --git a/arch/arm/mach-ixp4xx/vulcan-setup.c b/arch/arm/mach-ixp4xx/vulcan-setup.c index 2798f435aaf4..d42730a1d4ab 100644 --- a/arch/arm/mach-ixp4xx/vulcan-setup.c +++ b/arch/arm/mach-ixp4xx/vulcan-setup.c | |||
@@ -239,7 +239,7 @@ MACHINE_START(ARCOM_VULCAN, "Arcom/Eurotech Vulcan") | |||
239 | .map_io = ixp4xx_map_io, | 239 | .map_io = ixp4xx_map_io, |
240 | .init_early = ixp4xx_init_early, | 240 | .init_early = ixp4xx_init_early, |
241 | .init_irq = ixp4xx_init_irq, | 241 | .init_irq = ixp4xx_init_irq, |
242 | .timer = &ixp4xx_timer, | 242 | .init_time = ixp4xx_timer_init, |
243 | .atag_offset = 0x100, | 243 | .atag_offset = 0x100, |
244 | .init_machine = vulcan_init, | 244 | .init_machine = vulcan_init, |
245 | #if defined(CONFIG_PCI) | 245 | #if defined(CONFIG_PCI) |
diff --git a/arch/arm/mach-ixp4xx/wg302v2-setup.c b/arch/arm/mach-ixp4xx/wg302v2-setup.c index a785175b115b..8f9ea2f3a9a5 100644 --- a/arch/arm/mach-ixp4xx/wg302v2-setup.c +++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c | |||
@@ -100,7 +100,7 @@ MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2") | |||
100 | .map_io = ixp4xx_map_io, | 100 | .map_io = ixp4xx_map_io, |
101 | .init_early = ixp4xx_init_early, | 101 | .init_early = ixp4xx_init_early, |
102 | .init_irq = ixp4xx_init_irq, | 102 | .init_irq = ixp4xx_init_irq, |
103 | .timer = &ixp4xx_timer, | 103 | .init_time = ixp4xx_timer_init, |
104 | .atag_offset = 0x100, | 104 | .atag_offset = 0x100, |
105 | .init_machine = wg302v2_init, | 105 | .init_machine = wg302v2_init, |
106 | #if defined(CONFIG_PCI) | 106 | #if defined(CONFIG_PCI) |
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index de4fd2bb1e27..d4af5c191c24 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c | |||
@@ -183,7 +183,7 @@ DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") | |||
183 | .map_io = kirkwood_map_io, | 183 | .map_io = kirkwood_map_io, |
184 | .init_early = kirkwood_init_early, | 184 | .init_early = kirkwood_init_early, |
185 | .init_irq = orion_dt_init_irq, | 185 | .init_irq = orion_dt_init_irq, |
186 | .timer = &kirkwood_timer, | 186 | .init_time = kirkwood_timer_init, |
187 | .init_machine = kirkwood_dt_init, | 187 | .init_machine = kirkwood_dt_init, |
188 | .restart = kirkwood_restart, | 188 | .restart = kirkwood_restart, |
189 | .dt_compat = kirkwood_dt_board_compat, | 189 | .dt_compat = kirkwood_dt_board_compat, |
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index bac21a554c91..b5ad4dff6b12 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -530,7 +530,7 @@ static int __init kirkwood_find_tclk(void) | |||
530 | return 166666667; | 530 | return 166666667; |
531 | } | 531 | } |
532 | 532 | ||
533 | static void __init kirkwood_timer_init(void) | 533 | void __init kirkwood_timer_init(void) |
534 | { | 534 | { |
535 | kirkwood_tclk = kirkwood_find_tclk(); | 535 | kirkwood_tclk = kirkwood_find_tclk(); |
536 | 536 | ||
@@ -538,10 +538,6 @@ static void __init kirkwood_timer_init(void) | |||
538 | IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); | 538 | IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); |
539 | } | 539 | } |
540 | 540 | ||
541 | struct sys_timer kirkwood_timer = { | ||
542 | .init = kirkwood_timer_init, | ||
543 | }; | ||
544 | |||
545 | /***************************************************************************** | 541 | /***************************************************************************** |
546 | * Audio | 542 | * Audio |
547 | ****************************************************************************/ | 543 | ****************************************************************************/ |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 5ffa57f08c80..283ab611e8da 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -156,7 +156,7 @@ void kirkwood_xor1_init(void); | |||
156 | void kirkwood_crypto_init(void); | 156 | void kirkwood_crypto_init(void); |
157 | 157 | ||
158 | extern int kirkwood_tclk; | 158 | extern int kirkwood_tclk; |
159 | extern struct sys_timer kirkwood_timer; | 159 | extern void kirkwood_timer_init(void); |
160 | 160 | ||
161 | #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) | 161 | #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) |
162 | 162 | ||
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c index 2c1a453df201..453418063c1e 100644 --- a/arch/arm/mach-kirkwood/d2net_v2-setup.c +++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c | |||
@@ -226,6 +226,6 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2") | |||
226 | .map_io = kirkwood_map_io, | 226 | .map_io = kirkwood_map_io, |
227 | .init_early = kirkwood_init_early, | 227 | .init_early = kirkwood_init_early, |
228 | .init_irq = kirkwood_init_irq, | 228 | .init_irq = kirkwood_init_irq, |
229 | .timer = &kirkwood_timer, | 229 | .init_time = kirkwood_timer_init, |
230 | .restart = kirkwood_restart, | 230 | .restart = kirkwood_restart, |
231 | MACHINE_END | 231 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c index c49b177c1523..5a369fe74754 100644 --- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c +++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c | |||
@@ -103,6 +103,6 @@ MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board") | |||
103 | .map_io = kirkwood_map_io, | 103 | .map_io = kirkwood_map_io, |
104 | .init_early = kirkwood_init_early, | 104 | .init_early = kirkwood_init_early, |
105 | .init_irq = kirkwood_init_irq, | 105 | .init_irq = kirkwood_init_irq, |
106 | .timer = &kirkwood_timer, | 106 | .init_time = kirkwood_timer_init, |
107 | .restart = kirkwood_restart, | 107 | .restart = kirkwood_restart, |
108 | MACHINE_END | 108 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c index 791a98fafa29..77f98f2b0416 100644 --- a/arch/arm/mach-kirkwood/dockstar-setup.c +++ b/arch/arm/mach-kirkwood/dockstar-setup.c | |||
@@ -107,6 +107,6 @@ MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar") | |||
107 | .map_io = kirkwood_map_io, | 107 | .map_io = kirkwood_map_io, |
108 | .init_early = kirkwood_init_early, | 108 | .init_early = kirkwood_init_early, |
109 | .init_irq = kirkwood_init_irq, | 109 | .init_irq = kirkwood_init_irq, |
110 | .timer = &kirkwood_timer, | 110 | .init_time = kirkwood_timer_init, |
111 | .restart = kirkwood_restart, | 111 | .restart = kirkwood_restart, |
112 | MACHINE_END | 112 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c index 7cb55f982243..1c6e736cbbf8 100644 --- a/arch/arm/mach-kirkwood/guruplug-setup.c +++ b/arch/arm/mach-kirkwood/guruplug-setup.c | |||
@@ -126,6 +126,6 @@ MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board") | |||
126 | .map_io = kirkwood_map_io, | 126 | .map_io = kirkwood_map_io, |
127 | .init_early = kirkwood_init_early, | 127 | .init_early = kirkwood_init_early, |
128 | .init_irq = kirkwood_init_irq, | 128 | .init_irq = kirkwood_init_irq, |
129 | .timer = &kirkwood_timer, | 129 | .init_time = kirkwood_timer_init, |
130 | .restart = kirkwood_restart, | 130 | .restart = kirkwood_restart, |
131 | MACHINE_END | 131 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c index 6d8364a97810..ba384b992bef 100644 --- a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c +++ b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c | |||
@@ -167,6 +167,6 @@ MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board") | |||
167 | .map_io = kirkwood_map_io, | 167 | .map_io = kirkwood_map_io, |
168 | .init_early = kirkwood_init_early, | 168 | .init_early = kirkwood_init_early, |
169 | .init_irq = kirkwood_init_irq, | 169 | .init_irq = kirkwood_init_irq, |
170 | .timer = &kirkwood_timer, | 170 | .init_time = kirkwood_timer_init, |
171 | .restart = kirkwood_restart, | 171 | .restart = kirkwood_restart, |
172 | MACHINE_END | 172 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c index 728e86d33f0c..3b706611da8e 100644 --- a/arch/arm/mach-kirkwood/netspace_v2-setup.c +++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c | |||
@@ -263,7 +263,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2") | |||
263 | .map_io = kirkwood_map_io, | 263 | .map_io = kirkwood_map_io, |
264 | .init_early = kirkwood_init_early, | 264 | .init_early = kirkwood_init_early, |
265 | .init_irq = kirkwood_init_irq, | 265 | .init_irq = kirkwood_init_irq, |
266 | .timer = &kirkwood_timer, | 266 | .init_time = kirkwood_timer_init, |
267 | .restart = kirkwood_restart, | 267 | .restart = kirkwood_restart, |
268 | MACHINE_END | 268 | MACHINE_END |
269 | #endif | 269 | #endif |
@@ -275,7 +275,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2") | |||
275 | .map_io = kirkwood_map_io, | 275 | .map_io = kirkwood_map_io, |
276 | .init_early = kirkwood_init_early, | 276 | .init_early = kirkwood_init_early, |
277 | .init_irq = kirkwood_init_irq, | 277 | .init_irq = kirkwood_init_irq, |
278 | .timer = &kirkwood_timer, | 278 | .init_time = kirkwood_timer_init, |
279 | .restart = kirkwood_restart, | 279 | .restart = kirkwood_restart, |
280 | MACHINE_END | 280 | MACHINE_END |
281 | #endif | 281 | #endif |
@@ -287,7 +287,7 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2") | |||
287 | .map_io = kirkwood_map_io, | 287 | .map_io = kirkwood_map_io, |
288 | .init_early = kirkwood_init_early, | 288 | .init_early = kirkwood_init_early, |
289 | .init_irq = kirkwood_init_irq, | 289 | .init_irq = kirkwood_init_irq, |
290 | .timer = &kirkwood_timer, | 290 | .init_time = kirkwood_timer_init, |
291 | .restart = kirkwood_restart, | 291 | .restart = kirkwood_restart, |
292 | MACHINE_END | 292 | MACHINE_END |
293 | #endif | 293 | #endif |
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c index a3b091470b8a..913d032cdb19 100644 --- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c +++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c | |||
@@ -404,7 +404,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2") | |||
404 | .map_io = kirkwood_map_io, | 404 | .map_io = kirkwood_map_io, |
405 | .init_early = kirkwood_init_early, | 405 | .init_early = kirkwood_init_early, |
406 | .init_irq = kirkwood_init_irq, | 406 | .init_irq = kirkwood_init_irq, |
407 | .timer = &kirkwood_timer, | 407 | .init_time = kirkwood_timer_init, |
408 | .restart = kirkwood_restart, | 408 | .restart = kirkwood_restart, |
409 | MACHINE_END | 409 | MACHINE_END |
410 | #endif | 410 | #endif |
@@ -416,7 +416,7 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2") | |||
416 | .map_io = kirkwood_map_io, | 416 | .map_io = kirkwood_map_io, |
417 | .init_early = kirkwood_init_early, | 417 | .init_early = kirkwood_init_early, |
418 | .init_irq = kirkwood_init_irq, | 418 | .init_irq = kirkwood_init_irq, |
419 | .timer = &kirkwood_timer, | 419 | .init_time = kirkwood_timer_init, |
420 | .restart = kirkwood_restart, | 420 | .restart = kirkwood_restart, |
421 | MACHINE_END | 421 | MACHINE_END |
422 | #endif | 422 | #endif |
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c index 7e81e9b586bf..8ddd69fdc937 100644 --- a/arch/arm/mach-kirkwood/openrd-setup.c +++ b/arch/arm/mach-kirkwood/openrd-setup.c | |||
@@ -221,7 +221,7 @@ MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board") | |||
221 | .map_io = kirkwood_map_io, | 221 | .map_io = kirkwood_map_io, |
222 | .init_early = kirkwood_init_early, | 222 | .init_early = kirkwood_init_early, |
223 | .init_irq = kirkwood_init_irq, | 223 | .init_irq = kirkwood_init_irq, |
224 | .timer = &kirkwood_timer, | 224 | .init_time = kirkwood_timer_init, |
225 | .restart = kirkwood_restart, | 225 | .restart = kirkwood_restart, |
226 | MACHINE_END | 226 | MACHINE_END |
227 | #endif | 227 | #endif |
@@ -234,7 +234,7 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board") | |||
234 | .map_io = kirkwood_map_io, | 234 | .map_io = kirkwood_map_io, |
235 | .init_early = kirkwood_init_early, | 235 | .init_early = kirkwood_init_early, |
236 | .init_irq = kirkwood_init_irq, | 236 | .init_irq = kirkwood_init_irq, |
237 | .timer = &kirkwood_timer, | 237 | .init_time = kirkwood_timer_init, |
238 | .restart = kirkwood_restart, | 238 | .restart = kirkwood_restart, |
239 | MACHINE_END | 239 | MACHINE_END |
240 | #endif | 240 | #endif |
@@ -247,7 +247,7 @@ MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board") | |||
247 | .map_io = kirkwood_map_io, | 247 | .map_io = kirkwood_map_io, |
248 | .init_early = kirkwood_init_early, | 248 | .init_early = kirkwood_init_early, |
249 | .init_irq = kirkwood_init_irq, | 249 | .init_irq = kirkwood_init_irq, |
250 | .timer = &kirkwood_timer, | 250 | .init_time = kirkwood_timer_init, |
251 | .restart = kirkwood_restart, | 251 | .restart = kirkwood_restart, |
252 | MACHINE_END | 252 | MACHINE_END |
253 | #endif | 253 | #endif |
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c index 19072c84008f..e4fd3129d36f 100644 --- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c +++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c | |||
@@ -84,6 +84,6 @@ MACHINE_START(RD88F6192_NAS, "Marvell RD-88F6192-NAS Development Board") | |||
84 | .map_io = kirkwood_map_io, | 84 | .map_io = kirkwood_map_io, |
85 | .init_early = kirkwood_init_early, | 85 | .init_early = kirkwood_init_early, |
86 | .init_irq = kirkwood_init_irq, | 86 | .init_irq = kirkwood_init_irq, |
87 | .timer = &kirkwood_timer, | 87 | .init_time = kirkwood_timer_init, |
88 | .restart = kirkwood_restart, | 88 | .restart = kirkwood_restart, |
89 | MACHINE_END | 89 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c index 9717101a7437..c7d93b48926b 100644 --- a/arch/arm/mach-kirkwood/rd88f6281-setup.c +++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c | |||
@@ -120,6 +120,6 @@ MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board") | |||
120 | .map_io = kirkwood_map_io, | 120 | .map_io = kirkwood_map_io, |
121 | .init_early = kirkwood_init_early, | 121 | .init_early = kirkwood_init_early, |
122 | .init_irq = kirkwood_init_irq, | 122 | .init_irq = kirkwood_init_irq, |
123 | .timer = &kirkwood_timer, | 123 | .init_time = kirkwood_timer_init, |
124 | .restart = kirkwood_restart, | 124 | .restart = kirkwood_restart, |
125 | MACHINE_END | 125 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c index 8a175948b28d..55b68fa39f45 100644 --- a/arch/arm/mach-kirkwood/sheevaplug-setup.c +++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c | |||
@@ -143,7 +143,7 @@ MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board") | |||
143 | .map_io = kirkwood_map_io, | 143 | .map_io = kirkwood_map_io, |
144 | .init_early = kirkwood_init_early, | 144 | .init_early = kirkwood_init_early, |
145 | .init_irq = kirkwood_init_irq, | 145 | .init_irq = kirkwood_init_irq, |
146 | .timer = &kirkwood_timer, | 146 | .init_time = kirkwood_timer_init, |
147 | .restart = kirkwood_restart, | 147 | .restart = kirkwood_restart, |
148 | MACHINE_END | 148 | MACHINE_END |
149 | #endif | 149 | #endif |
@@ -155,7 +155,7 @@ MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board") | |||
155 | .map_io = kirkwood_map_io, | 155 | .map_io = kirkwood_map_io, |
156 | .init_early = kirkwood_init_early, | 156 | .init_early = kirkwood_init_early, |
157 | .init_irq = kirkwood_init_irq, | 157 | .init_irq = kirkwood_init_irq, |
158 | .timer = &kirkwood_timer, | 158 | .init_time = kirkwood_timer_init, |
159 | .restart = kirkwood_restart, | 159 | .restart = kirkwood_restart, |
160 | MACHINE_END | 160 | MACHINE_END |
161 | #endif | 161 | #endif |
diff --git a/arch/arm/mach-kirkwood/t5325-setup.c b/arch/arm/mach-kirkwood/t5325-setup.c index f2daf711e72e..8736f8c97518 100644 --- a/arch/arm/mach-kirkwood/t5325-setup.c +++ b/arch/arm/mach-kirkwood/t5325-setup.c | |||
@@ -211,6 +211,6 @@ MACHINE_START(T5325, "HP t5325 Thin Client") | |||
211 | .map_io = kirkwood_map_io, | 211 | .map_io = kirkwood_map_io, |
212 | .init_early = kirkwood_init_early, | 212 | .init_early = kirkwood_init_early, |
213 | .init_irq = kirkwood_init_irq, | 213 | .init_irq = kirkwood_init_irq, |
214 | .timer = &kirkwood_timer, | 214 | .init_time = kirkwood_timer_init, |
215 | .restart = kirkwood_restart, | 215 | .restart = kirkwood_restart, |
216 | MACHINE_END | 216 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c index 73e2b6ca9564..283abff90228 100644 --- a/arch/arm/mach-kirkwood/ts219-setup.c +++ b/arch/arm/mach-kirkwood/ts219-setup.c | |||
@@ -137,6 +137,6 @@ MACHINE_START(TS219, "QNAP TS-119/TS-219") | |||
137 | .map_io = kirkwood_map_io, | 137 | .map_io = kirkwood_map_io, |
138 | .init_early = kirkwood_init_early, | 138 | .init_early = kirkwood_init_early, |
139 | .init_irq = kirkwood_init_irq, | 139 | .init_irq = kirkwood_init_irq, |
140 | .timer = &kirkwood_timer, | 140 | .init_time = kirkwood_timer_init, |
141 | .restart = kirkwood_restart, | 141 | .restart = kirkwood_restart, |
142 | MACHINE_END | 142 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c index e4c61279ea86..81d585806b2f 100644 --- a/arch/arm/mach-kirkwood/ts41x-setup.c +++ b/arch/arm/mach-kirkwood/ts41x-setup.c | |||
@@ -181,6 +181,6 @@ MACHINE_START(TS41X, "QNAP TS-41x") | |||
181 | .map_io = kirkwood_map_io, | 181 | .map_io = kirkwood_map_io, |
182 | .init_early = kirkwood_init_early, | 182 | .init_early = kirkwood_init_early, |
183 | .init_irq = kirkwood_init_irq, | 183 | .init_irq = kirkwood_init_irq, |
184 | .timer = &kirkwood_timer, | 184 | .init_time = kirkwood_timer_init, |
185 | .restart = kirkwood_restart, | 185 | .restart = kirkwood_restart, |
186 | MACHINE_END | 186 | MACHINE_END |
diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c index b0c306ccbc6e..456d6386edf8 100644 --- a/arch/arm/mach-ks8695/board-acs5k.c +++ b/arch/arm/mach-ks8695/board-acs5k.c | |||
@@ -227,6 +227,6 @@ MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board") | |||
227 | .map_io = ks8695_map_io, | 227 | .map_io = ks8695_map_io, |
228 | .init_irq = ks8695_init_irq, | 228 | .init_irq = ks8695_init_irq, |
229 | .init_machine = acs5k_init, | 229 | .init_machine = acs5k_init, |
230 | .timer = &ks8695_timer, | 230 | .init_time = ks8695_timer_init, |
231 | .restart = ks8695_restart, | 231 | .restart = ks8695_restart, |
232 | MACHINE_END | 232 | MACHINE_END |
diff --git a/arch/arm/mach-ks8695/board-dsm320.c b/arch/arm/mach-ks8695/board-dsm320.c index e0d36cef2c56..d37c218c3584 100644 --- a/arch/arm/mach-ks8695/board-dsm320.c +++ b/arch/arm/mach-ks8695/board-dsm320.c | |||
@@ -125,6 +125,6 @@ MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player") | |||
125 | .map_io = ks8695_map_io, | 125 | .map_io = ks8695_map_io, |
126 | .init_irq = ks8695_init_irq, | 126 | .init_irq = ks8695_init_irq, |
127 | .init_machine = dsm320_init, | 127 | .init_machine = dsm320_init, |
128 | .timer = &ks8695_timer, | 128 | .init_time = ks8695_timer_init, |
129 | .restart = ks8695_restart, | 129 | .restart = ks8695_restart, |
130 | MACHINE_END | 130 | MACHINE_END |
diff --git a/arch/arm/mach-ks8695/board-micrel.c b/arch/arm/mach-ks8695/board-micrel.c index a8270725b76d..3acbdfd31391 100644 --- a/arch/arm/mach-ks8695/board-micrel.c +++ b/arch/arm/mach-ks8695/board-micrel.c | |||
@@ -57,6 +57,6 @@ MACHINE_START(KS8695, "KS8695 Centaur Development Board") | |||
57 | .map_io = ks8695_map_io, | 57 | .map_io = ks8695_map_io, |
58 | .init_irq = ks8695_init_irq, | 58 | .init_irq = ks8695_init_irq, |
59 | .init_machine = micrel_init, | 59 | .init_machine = micrel_init, |
60 | .timer = &ks8695_timer, | 60 | .init_time = ks8695_timer_init, |
61 | .restart = ks8695_restart, | 61 | .restart = ks8695_restart, |
62 | MACHINE_END | 62 | MACHINE_END |
diff --git a/arch/arm/mach-ks8695/board-og.c b/arch/arm/mach-ks8695/board-og.c index 1623ba461e47..002bc619bb68 100644 --- a/arch/arm/mach-ks8695/board-og.c +++ b/arch/arm/mach-ks8695/board-og.c | |||
@@ -145,7 +145,7 @@ MACHINE_START(CM4002, "OpenGear/CM4002") | |||
145 | .map_io = ks8695_map_io, | 145 | .map_io = ks8695_map_io, |
146 | .init_irq = ks8695_init_irq, | 146 | .init_irq = ks8695_init_irq, |
147 | .init_machine = og_init, | 147 | .init_machine = og_init, |
148 | .timer = &ks8695_timer, | 148 | .init_time = ks8695_timer_init, |
149 | .restart = ks8695_restart, | 149 | .restart = ks8695_restart, |
150 | MACHINE_END | 150 | MACHINE_END |
151 | #endif | 151 | #endif |
@@ -157,7 +157,7 @@ MACHINE_START(CM4008, "OpenGear/CM4008") | |||
157 | .map_io = ks8695_map_io, | 157 | .map_io = ks8695_map_io, |
158 | .init_irq = ks8695_init_irq, | 158 | .init_irq = ks8695_init_irq, |
159 | .init_machine = og_init, | 159 | .init_machine = og_init, |
160 | .timer = &ks8695_timer, | 160 | .init_time = ks8695_timer_init, |
161 | .restart = ks8695_restart, | 161 | .restart = ks8695_restart, |
162 | MACHINE_END | 162 | MACHINE_END |
163 | #endif | 163 | #endif |
@@ -169,7 +169,7 @@ MACHINE_START(CM41XX, "OpenGear/CM41xx") | |||
169 | .map_io = ks8695_map_io, | 169 | .map_io = ks8695_map_io, |
170 | .init_irq = ks8695_init_irq, | 170 | .init_irq = ks8695_init_irq, |
171 | .init_machine = og_init, | 171 | .init_machine = og_init, |
172 | .timer = &ks8695_timer, | 172 | .init_time = ks8695_timer_init, |
173 | .restart = ks8695_restart, | 173 | .restart = ks8695_restart, |
174 | MACHINE_END | 174 | MACHINE_END |
175 | #endif | 175 | #endif |
@@ -181,7 +181,7 @@ MACHINE_START(IM4004, "OpenGear/IM4004") | |||
181 | .map_io = ks8695_map_io, | 181 | .map_io = ks8695_map_io, |
182 | .init_irq = ks8695_init_irq, | 182 | .init_irq = ks8695_init_irq, |
183 | .init_machine = og_init, | 183 | .init_machine = og_init, |
184 | .timer = &ks8695_timer, | 184 | .init_time = ks8695_timer_init, |
185 | .restart = ks8695_restart, | 185 | .restart = ks8695_restart, |
186 | MACHINE_END | 186 | MACHINE_END |
187 | #endif | 187 | #endif |
@@ -193,7 +193,7 @@ MACHINE_START(IM42XX, "OpenGear/IM42xx") | |||
193 | .map_io = ks8695_map_io, | 193 | .map_io = ks8695_map_io, |
194 | .init_irq = ks8695_init_irq, | 194 | .init_irq = ks8695_init_irq, |
195 | .init_machine = og_init, | 195 | .init_machine = og_init, |
196 | .timer = &ks8695_timer, | 196 | .init_time = ks8695_timer_init, |
197 | .restart = ks8695_restart, | 197 | .restart = ks8695_restart, |
198 | MACHINE_END | 198 | MACHINE_END |
199 | #endif | 199 | #endif |
diff --git a/arch/arm/mach-ks8695/board-sg.c b/arch/arm/mach-ks8695/board-sg.c index f35b98b5bf37..fdf2352d2cf8 100644 --- a/arch/arm/mach-ks8695/board-sg.c +++ b/arch/arm/mach-ks8695/board-sg.c | |||
@@ -91,7 +91,7 @@ MACHINE_START(LITE300, "SecureComputing/SG300") | |||
91 | .map_io = ks8695_map_io, | 91 | .map_io = ks8695_map_io, |
92 | .init_irq = ks8695_init_irq, | 92 | .init_irq = ks8695_init_irq, |
93 | .init_machine = sg_init, | 93 | .init_machine = sg_init, |
94 | .timer = &ks8695_timer, | 94 | .init_time = ks8695_timer_init, |
95 | .restart = ks8695_restart, | 95 | .restart = ks8695_restart, |
96 | MACHINE_END | 96 | MACHINE_END |
97 | #endif | 97 | #endif |
@@ -103,7 +103,7 @@ MACHINE_START(SG310, "McAfee/SG310") | |||
103 | .map_io = ks8695_map_io, | 103 | .map_io = ks8695_map_io, |
104 | .init_irq = ks8695_init_irq, | 104 | .init_irq = ks8695_init_irq, |
105 | .init_machine = sg_init, | 105 | .init_machine = sg_init, |
106 | .timer = &ks8695_timer, | 106 | .init_time = ks8695_timer_init, |
107 | .restart = ks8695_restart, | 107 | .restart = ks8695_restart, |
108 | MACHINE_END | 108 | MACHINE_END |
109 | #endif | 109 | #endif |
@@ -115,7 +115,7 @@ MACHINE_START(SE4200, "SecureComputing/SE4200") | |||
115 | .map_io = ks8695_map_io, | 115 | .map_io = ks8695_map_io, |
116 | .init_irq = ks8695_init_irq, | 116 | .init_irq = ks8695_init_irq, |
117 | .init_machine = sg_init, | 117 | .init_machine = sg_init, |
118 | .timer = &ks8695_timer, | 118 | .init_time = ks8695_timer_init, |
119 | .restart = ks8695_restart, | 119 | .restart = ks8695_restart, |
120 | MACHINE_END | 120 | MACHINE_END |
121 | #endif | 121 | #endif |
diff --git a/arch/arm/mach-ks8695/generic.h b/arch/arm/mach-ks8695/generic.h index f8bdb11a9c33..6e97ce462d73 100644 --- a/arch/arm/mach-ks8695/generic.h +++ b/arch/arm/mach-ks8695/generic.h | |||
@@ -13,4 +13,4 @@ | |||
13 | extern __init void ks8695_map_io(void); | 13 | extern __init void ks8695_map_io(void); |
14 | extern __init void ks8695_init_irq(void); | 14 | extern __init void ks8695_init_irq(void); |
15 | extern void ks8695_restart(char, const char *); | 15 | extern void ks8695_restart(char, const char *); |
16 | extern struct sys_timer ks8695_timer; | 16 | extern void ks8695_timer_init(void); |
diff --git a/arch/arm/mach-ks8695/time.c b/arch/arm/mach-ks8695/time.c index 46c84bc7792c..c272a3863d5f 100644 --- a/arch/arm/mach-ks8695/time.c +++ b/arch/arm/mach-ks8695/time.c | |||
@@ -146,7 +146,7 @@ static void ks8695_timer_setup(void) | |||
146 | 0xFFFFFFFFU); | 146 | 0xFFFFFFFFU); |
147 | } | 147 | } |
148 | 148 | ||
149 | static void __init ks8695_timer_init (void) | 149 | void __init ks8695_timer_init(void) |
150 | { | 150 | { |
151 | ks8695_timer_setup(); | 151 | ks8695_timer_setup(); |
152 | 152 | ||
@@ -154,10 +154,6 @@ static void __init ks8695_timer_init (void) | |||
154 | setup_irq(KS8695_IRQ_TIMER1, &ks8695_timer_irq); | 154 | setup_irq(KS8695_IRQ_TIMER1, &ks8695_timer_irq); |
155 | } | 155 | } |
156 | 156 | ||
157 | struct sys_timer ks8695_timer = { | ||
158 | .init = ks8695_timer_init, | ||
159 | }; | ||
160 | |||
161 | void ks8695_restart(char mode, const char *cmd) | 157 | void ks8695_restart(char mode, const char *cmd) |
162 | { | 158 | { |
163 | unsigned int reg; | 159 | unsigned int reg; |
diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h index afeac3b1fae6..e0b26062a272 100644 --- a/arch/arm/mach-lpc32xx/common.h +++ b/arch/arm/mach-lpc32xx/common.h | |||
@@ -25,7 +25,7 @@ | |||
25 | /* | 25 | /* |
26 | * Other arch specific structures and functions | 26 | * Other arch specific structures and functions |
27 | */ | 27 | */ |
28 | extern struct sys_timer lpc32xx_timer; | 28 | extern void lpc32xx_timer_init(void); |
29 | extern void __init lpc32xx_init_irq(void); | 29 | extern void __init lpc32xx_init_irq(void); |
30 | extern void __init lpc32xx_map_io(void); | 30 | extern void __init lpc32xx_map_io(void); |
31 | extern void __init lpc32xx_serial_init(void); | 31 | extern void __init lpc32xx_serial_init(void); |
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c index e8ff4c3f0566..c1cd5a943ab1 100644 --- a/arch/arm/mach-lpc32xx/phy3250.c +++ b/arch/arm/mach-lpc32xx/phy3250.c | |||
@@ -263,7 +263,7 @@ DT_MACHINE_START(LPC32XX_DT, "LPC32XX SoC (Flattened Device Tree)") | |||
263 | .atag_offset = 0x100, | 263 | .atag_offset = 0x100, |
264 | .map_io = lpc32xx_map_io, | 264 | .map_io = lpc32xx_map_io, |
265 | .init_irq = lpc32xx_init_irq, | 265 | .init_irq = lpc32xx_init_irq, |
266 | .timer = &lpc32xx_timer, | 266 | .init_time = lpc32xx_timer_init, |
267 | .init_machine = lpc3250_machine_init, | 267 | .init_machine = lpc3250_machine_init, |
268 | .dt_compat = lpc32xx_dt_compat, | 268 | .dt_compat = lpc32xx_dt_compat, |
269 | .restart = lpc23xx_restart, | 269 | .restart = lpc23xx_restart, |
diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c index c40667c33161..20eab63d10ba 100644 --- a/arch/arm/mach-lpc32xx/timer.c +++ b/arch/arm/mach-lpc32xx/timer.c | |||
@@ -70,7 +70,6 @@ static void lpc32xx_clkevt_mode(enum clock_event_mode mode, | |||
70 | static struct clock_event_device lpc32xx_clkevt = { | 70 | static struct clock_event_device lpc32xx_clkevt = { |
71 | .name = "lpc32xx_clkevt", | 71 | .name = "lpc32xx_clkevt", |
72 | .features = CLOCK_EVT_FEAT_ONESHOT, | 72 | .features = CLOCK_EVT_FEAT_ONESHOT, |
73 | .shift = 32, | ||
74 | .rating = 300, | 73 | .rating = 300, |
75 | .set_next_event = lpc32xx_clkevt_next_event, | 74 | .set_next_event = lpc32xx_clkevt_next_event, |
76 | .set_mode = lpc32xx_clkevt_mode, | 75 | .set_mode = lpc32xx_clkevt_mode, |
@@ -100,7 +99,7 @@ static struct irqaction lpc32xx_timer_irq = { | |||
100 | * clocks need to be enabled here manually and then tagged as used in | 99 | * clocks need to be enabled here manually and then tagged as used in |
101 | * the clock driver initialization | 100 | * the clock driver initialization |
102 | */ | 101 | */ |
103 | static void __init lpc32xx_timer_init(void) | 102 | void __init lpc32xx_timer_init(void) |
104 | { | 103 | { |
105 | u32 clkrate, pllreg; | 104 | u32 clkrate, pllreg; |
106 | 105 | ||
@@ -141,14 +140,8 @@ static void __init lpc32xx_timer_init(void) | |||
141 | setup_irq(IRQ_LPC32XX_TIMER0, &lpc32xx_timer_irq); | 140 | setup_irq(IRQ_LPC32XX_TIMER0, &lpc32xx_timer_irq); |
142 | 141 | ||
143 | /* Setup the clockevent structure. */ | 142 | /* Setup the clockevent structure. */ |
144 | lpc32xx_clkevt.mult = div_sc(clkrate, NSEC_PER_SEC, | ||
145 | lpc32xx_clkevt.shift); | ||
146 | lpc32xx_clkevt.max_delta_ns = clockevent_delta2ns(-1, | ||
147 | &lpc32xx_clkevt); | ||
148 | lpc32xx_clkevt.min_delta_ns = clockevent_delta2ns(1, | ||
149 | &lpc32xx_clkevt) + 1; | ||
150 | lpc32xx_clkevt.cpumask = cpumask_of(0); | 143 | lpc32xx_clkevt.cpumask = cpumask_of(0); |
151 | clockevents_register_device(&lpc32xx_clkevt); | 144 | clockevents_config_and_register(&lpc32xx_clkevt, clkrate, 1, -1); |
152 | 145 | ||
153 | /* Use timer1 as clock source. */ | 146 | /* Use timer1 as clock source. */ |
154 | __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET, | 147 | __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET, |
@@ -161,8 +154,3 @@ static void __init lpc32xx_timer_init(void) | |||
161 | clocksource_mmio_init(LPC32XX_TIMER_TC(LPC32XX_TIMER1_BASE), | 154 | clocksource_mmio_init(LPC32XX_TIMER_TC(LPC32XX_TIMER1_BASE), |
162 | "lpc32xx_clksrc", clkrate, 300, 32, clocksource_mmio_readl_up); | 155 | "lpc32xx_clksrc", clkrate, 300, 32, clocksource_mmio_readl_up); |
163 | } | 156 | } |
164 | |||
165 | struct sys_timer lpc32xx_timer = { | ||
166 | .init = &lpc32xx_timer_init, | ||
167 | }; | ||
168 | |||
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c index e5dba9c5dc54..9f64d5632e07 100644 --- a/arch/arm/mach-mmp/aspenite.c +++ b/arch/arm/mach-mmp/aspenite.c | |||
@@ -262,7 +262,7 @@ MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform") | |||
262 | .map_io = mmp_map_io, | 262 | .map_io = mmp_map_io, |
263 | .nr_irqs = MMP_NR_IRQS, | 263 | .nr_irqs = MMP_NR_IRQS, |
264 | .init_irq = pxa168_init_irq, | 264 | .init_irq = pxa168_init_irq, |
265 | .timer = &pxa168_timer, | 265 | .init_time = pxa168_timer_init, |
266 | .init_machine = common_init, | 266 | .init_machine = common_init, |
267 | .restart = pxa168_restart, | 267 | .restart = pxa168_restart, |
268 | MACHINE_END | 268 | MACHINE_END |
@@ -271,7 +271,7 @@ MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform") | |||
271 | .map_io = mmp_map_io, | 271 | .map_io = mmp_map_io, |
272 | .nr_irqs = MMP_NR_IRQS, | 272 | .nr_irqs = MMP_NR_IRQS, |
273 | .init_irq = pxa168_init_irq, | 273 | .init_irq = pxa168_init_irq, |
274 | .timer = &pxa168_timer, | 274 | .init_time = pxa168_timer_init, |
275 | .init_machine = common_init, | 275 | .init_machine = common_init, |
276 | .restart = pxa168_restart, | 276 | .restart = pxa168_restart, |
277 | MACHINE_END | 277 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/avengers_lite.c b/arch/arm/mach-mmp/avengers_lite.c index 603542ae6fbd..1f94957b56ae 100644 --- a/arch/arm/mach-mmp/avengers_lite.c +++ b/arch/arm/mach-mmp/avengers_lite.c | |||
@@ -45,7 +45,7 @@ MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform") | |||
45 | .map_io = mmp_map_io, | 45 | .map_io = mmp_map_io, |
46 | .nr_irqs = MMP_NR_IRQS, | 46 | .nr_irqs = MMP_NR_IRQS, |
47 | .init_irq = pxa168_init_irq, | 47 | .init_irq = pxa168_init_irq, |
48 | .timer = &pxa168_timer, | 48 | .init_time = pxa168_timer_init, |
49 | .init_machine = avengers_lite_init, | 49 | .init_machine = avengers_lite_init, |
50 | .restart = pxa168_restart, | 50 | .restart = pxa168_restart, |
51 | MACHINE_END | 51 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c index 5cb769cd26d9..2358011c7d8e 100644 --- a/arch/arm/mach-mmp/brownstone.c +++ b/arch/arm/mach-mmp/brownstone.c | |||
@@ -218,7 +218,7 @@ MACHINE_START(BROWNSTONE, "Brownstone Development Platform") | |||
218 | .map_io = mmp_map_io, | 218 | .map_io = mmp_map_io, |
219 | .nr_irqs = BROWNSTONE_NR_IRQS, | 219 | .nr_irqs = BROWNSTONE_NR_IRQS, |
220 | .init_irq = mmp2_init_irq, | 220 | .init_irq = mmp2_init_irq, |
221 | .timer = &mmp2_timer, | 221 | .init_time = mmp2_timer_init, |
222 | .init_machine = brownstone_init, | 222 | .init_machine = brownstone_init, |
223 | .restart = mmp_restart, | 223 | .restart = mmp_restart, |
224 | MACHINE_END | 224 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h index bd453274fca2..0bdc50b134ce 100644 --- a/arch/arm/mach-mmp/common.h +++ b/arch/arm/mach-mmp/common.h | |||
@@ -1,7 +1,5 @@ | |||
1 | #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) | 1 | #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) |
2 | 2 | ||
3 | struct sys_timer; | ||
4 | |||
5 | extern void timer_init(int irq); | 3 | extern void timer_init(int irq); |
6 | 4 | ||
7 | extern void __init icu_init_irq(void); | 5 | extern void __init icu_init_irq(void); |
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c index 8059cc0905c6..754c352dd02b 100644 --- a/arch/arm/mach-mmp/flint.c +++ b/arch/arm/mach-mmp/flint.c | |||
@@ -121,7 +121,7 @@ MACHINE_START(FLINT, "Flint Development Platform") | |||
121 | .map_io = mmp_map_io, | 121 | .map_io = mmp_map_io, |
122 | .nr_irqs = FLINT_NR_IRQS, | 122 | .nr_irqs = FLINT_NR_IRQS, |
123 | .init_irq = mmp2_init_irq, | 123 | .init_irq = mmp2_init_irq, |
124 | .timer = &mmp2_timer, | 124 | .init_time = mmp2_timer_init, |
125 | .init_machine = flint_init, | 125 | .init_machine = flint_init, |
126 | .restart = mmp_restart, | 126 | .restart = mmp_restart, |
127 | MACHINE_END | 127 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c index 5c3d61ee729a..d1e2d595e79c 100644 --- a/arch/arm/mach-mmp/gplugd.c +++ b/arch/arm/mach-mmp/gplugd.c | |||
@@ -194,7 +194,7 @@ MACHINE_START(GPLUGD, "PXA168-based GuruPlug Display (gplugD) Platform") | |||
194 | .map_io = mmp_map_io, | 194 | .map_io = mmp_map_io, |
195 | .nr_irqs = MMP_NR_IRQS, | 195 | .nr_irqs = MMP_NR_IRQS, |
196 | .init_irq = pxa168_init_irq, | 196 | .init_irq = pxa168_init_irq, |
197 | .timer = &pxa168_timer, | 197 | .init_time = pxa168_timer_init, |
198 | .init_machine = gplugd_init, | 198 | .init_machine = gplugd_init, |
199 | .restart = pxa168_restart, | 199 | .restart = pxa168_restart, |
200 | MACHINE_END | 200 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h index c4ca4d17194a..0764f4ecec82 100644 --- a/arch/arm/mach-mmp/include/mach/mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mmp2.h | |||
@@ -3,9 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/platform_data/pxa_sdhci.h> | 4 | #include <linux/platform_data/pxa_sdhci.h> |
5 | 5 | ||
6 | struct sys_timer; | 6 | extern void mmp2_timer_init(void); |
7 | |||
8 | extern struct sys_timer mmp2_timer; | ||
9 | extern void __init mmp2_init_icu(void); | 7 | extern void __init mmp2_init_icu(void); |
10 | extern void __init mmp2_init_irq(void); | 8 | extern void __init mmp2_init_irq(void); |
11 | extern void mmp2_clear_pmic_int(void); | 9 | extern void mmp2_clear_pmic_int(void); |
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h index 37632d964d50..7ed1df21ea1c 100644 --- a/arch/arm/mach-mmp/include/mach/pxa168.h +++ b/arch/arm/mach-mmp/include/mach/pxa168.h | |||
@@ -1,9 +1,7 @@ | |||
1 | #ifndef __ASM_MACH_PXA168_H | 1 | #ifndef __ASM_MACH_PXA168_H |
2 | #define __ASM_MACH_PXA168_H | 2 | #define __ASM_MACH_PXA168_H |
3 | 3 | ||
4 | struct sys_timer; | 4 | extern void pxa168_timer_init(void); |
5 | |||
6 | extern struct sys_timer pxa168_timer; | ||
7 | extern void __init pxa168_init_irq(void); | 5 | extern void __init pxa168_init_irq(void); |
8 | extern void pxa168_restart(char, const char *); | 6 | extern void pxa168_restart(char, const char *); |
9 | extern void pxa168_clear_keypad_wakeup(void); | 7 | extern void pxa168_clear_keypad_wakeup(void); |
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h index 3b58a3b2d7df..eff31ab6dc3b 100644 --- a/arch/arm/mach-mmp/include/mach/pxa910.h +++ b/arch/arm/mach-mmp/include/mach/pxa910.h | |||
@@ -1,9 +1,7 @@ | |||
1 | #ifndef __ASM_MACH_PXA910_H | 1 | #ifndef __ASM_MACH_PXA910_H |
2 | #define __ASM_MACH_PXA910_H | 2 | #define __ASM_MACH_PXA910_H |
3 | 3 | ||
4 | struct sys_timer; | 4 | extern void pxa910_timer_init(void); |
5 | |||
6 | extern struct sys_timer pxa910_timer; | ||
7 | extern void __init pxa910_init_irq(void); | 5 | extern void __init pxa910_init_irq(void); |
8 | 6 | ||
9 | #include <linux/i2c.h> | 7 | #include <linux/i2c.h> |
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c index ff73249884d0..66634fd0ecb0 100644 --- a/arch/arm/mach-mmp/jasper.c +++ b/arch/arm/mach-mmp/jasper.c | |||
@@ -174,7 +174,7 @@ MACHINE_START(MARVELL_JASPER, "Jasper Development Platform") | |||
174 | .map_io = mmp_map_io, | 174 | .map_io = mmp_map_io, |
175 | .nr_irqs = JASPER_NR_IRQS, | 175 | .nr_irqs = JASPER_NR_IRQS, |
176 | .init_irq = mmp2_init_irq, | 176 | .init_irq = mmp2_init_irq, |
177 | .timer = &mmp2_timer, | 177 | .init_time = mmp2_timer_init, |
178 | .init_machine = jasper_init, | 178 | .init_machine = jasper_init, |
179 | .restart = mmp_restart, | 179 | .restart = mmp_restart, |
180 | MACHINE_END | 180 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/mmp-dt.c b/arch/arm/mach-mmp/mmp-dt.c index 033cc31b3c72..d063efa0a4f1 100644 --- a/arch/arm/mach-mmp/mmp-dt.c +++ b/arch/arm/mach-mmp/mmp-dt.c | |||
@@ -22,10 +22,6 @@ | |||
22 | extern void __init mmp_dt_irq_init(void); | 22 | extern void __init mmp_dt_irq_init(void); |
23 | extern void __init mmp_dt_init_timer(void); | 23 | extern void __init mmp_dt_init_timer(void); |
24 | 24 | ||
25 | static struct sys_timer mmp_dt_timer = { | ||
26 | .init = mmp_dt_init_timer, | ||
27 | }; | ||
28 | |||
29 | static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = { | 25 | static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = { |
30 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), | 26 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), |
31 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL), | 27 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL), |
@@ -69,7 +65,7 @@ static const char *mmp_dt_board_compat[] __initdata = { | |||
69 | DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") | 65 | DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") |
70 | .map_io = mmp_map_io, | 66 | .map_io = mmp_map_io, |
71 | .init_irq = mmp_dt_irq_init, | 67 | .init_irq = mmp_dt_irq_init, |
72 | .timer = &mmp_dt_timer, | 68 | .init_time = mmp_dt_init_timer, |
73 | .init_machine = pxa168_dt_init, | 69 | .init_machine = pxa168_dt_init, |
74 | .dt_compat = mmp_dt_board_compat, | 70 | .dt_compat = mmp_dt_board_compat, |
75 | MACHINE_END | 71 | MACHINE_END |
@@ -77,7 +73,7 @@ MACHINE_END | |||
77 | DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)") | 73 | DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)") |
78 | .map_io = mmp_map_io, | 74 | .map_io = mmp_map_io, |
79 | .init_irq = mmp_dt_irq_init, | 75 | .init_irq = mmp_dt_irq_init, |
80 | .timer = &mmp_dt_timer, | 76 | .init_time = mmp_dt_init_timer, |
81 | .init_machine = pxa910_dt_init, | 77 | .init_machine = pxa910_dt_init, |
82 | .dt_compat = mmp_dt_board_compat, | 78 | .dt_compat = mmp_dt_board_compat, |
83 | MACHINE_END | 79 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/mmp2-dt.c b/arch/arm/mach-mmp/mmp2-dt.c index 535a5ed5977b..fad431aa6e09 100644 --- a/arch/arm/mach-mmp/mmp2-dt.c +++ b/arch/arm/mach-mmp/mmp2-dt.c | |||
@@ -24,10 +24,6 @@ | |||
24 | extern void __init mmp_dt_irq_init(void); | 24 | extern void __init mmp_dt_irq_init(void); |
25 | extern void __init mmp_dt_init_timer(void); | 25 | extern void __init mmp_dt_init_timer(void); |
26 | 26 | ||
27 | static struct sys_timer mmp_dt_timer = { | ||
28 | .init = mmp_dt_init_timer, | ||
29 | }; | ||
30 | |||
31 | static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = { | 27 | static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = { |
32 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4030000, "pxa2xx-uart.0", NULL), | 28 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4030000, "pxa2xx-uart.0", NULL), |
33 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.1", NULL), | 29 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.1", NULL), |
@@ -54,7 +50,7 @@ static const char *mmp2_dt_board_compat[] __initdata = { | |||
54 | DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)") | 50 | DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)") |
55 | .map_io = mmp_map_io, | 51 | .map_io = mmp_map_io, |
56 | .init_irq = mmp_dt_irq_init, | 52 | .init_irq = mmp_dt_irq_init, |
57 | .timer = &mmp_dt_timer, | 53 | .init_time = mmp_dt_init_timer, |
58 | .init_machine = mmp2_dt_init, | 54 | .init_machine = mmp2_dt_init, |
59 | .dt_compat = mmp2_dt_board_compat, | 55 | .dt_compat = mmp2_dt_board_compat, |
60 | MACHINE_END | 56 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index 3a3768c7a191..d94d114eef7b 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c | |||
@@ -114,7 +114,7 @@ postcore_initcall(mmp2_init); | |||
114 | 114 | ||
115 | #define APBC_TIMERS APBC_REG(0x024) | 115 | #define APBC_TIMERS APBC_REG(0x024) |
116 | 116 | ||
117 | static void __init mmp2_timer_init(void) | 117 | void __init mmp2_timer_init(void) |
118 | { | 118 | { |
119 | unsigned long clk_rst; | 119 | unsigned long clk_rst; |
120 | 120 | ||
@@ -130,10 +130,6 @@ static void __init mmp2_timer_init(void) | |||
130 | timer_init(IRQ_MMP2_TIMER1); | 130 | timer_init(IRQ_MMP2_TIMER1); |
131 | } | 131 | } |
132 | 132 | ||
133 | struct sys_timer mmp2_timer = { | ||
134 | .init = mmp2_timer_init, | ||
135 | }; | ||
136 | |||
137 | /* on-chip devices */ | 133 | /* on-chip devices */ |
138 | MMP2_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4030000, 0x30, 4, 5); | 134 | MMP2_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4030000, 0x30, 4, 5); |
139 | MMP2_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4017000, 0x30, 20, 21); | 135 | MMP2_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4017000, 0x30, 20, 21); |
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index b7f074f15498..9bc7b86a86a7 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
@@ -67,7 +67,7 @@ postcore_initcall(pxa168_init); | |||
67 | #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) | 67 | #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) |
68 | #define APBC_TIMERS APBC_REG(0x34) | 68 | #define APBC_TIMERS APBC_REG(0x34) |
69 | 69 | ||
70 | static void __init pxa168_timer_init(void) | 70 | void __init pxa168_timer_init(void) |
71 | { | 71 | { |
72 | /* this is early, we have to initialize the CCU registers by | 72 | /* this is early, we have to initialize the CCU registers by |
73 | * ourselves instead of using clk_* API. Clock rate is defined | 73 | * ourselves instead of using clk_* API. Clock rate is defined |
@@ -81,10 +81,6 @@ static void __init pxa168_timer_init(void) | |||
81 | timer_init(IRQ_PXA168_TIMER1); | 81 | timer_init(IRQ_PXA168_TIMER1); |
82 | } | 82 | } |
83 | 83 | ||
84 | struct sys_timer pxa168_timer = { | ||
85 | .init = pxa168_timer_init, | ||
86 | }; | ||
87 | |||
88 | void pxa168_clear_keypad_wakeup(void) | 84 | void pxa168_clear_keypad_wakeup(void) |
89 | { | 85 | { |
90 | uint32_t val; | 86 | uint32_t val; |
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 8b1e16fbb7a5..c6a89f1eca4e 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
@@ -101,7 +101,7 @@ postcore_initcall(pxa910_init); | |||
101 | #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) | 101 | #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) |
102 | #define APBC_TIMERS APBC_REG(0x34) | 102 | #define APBC_TIMERS APBC_REG(0x34) |
103 | 103 | ||
104 | static void __init pxa910_timer_init(void) | 104 | void __init pxa910_timer_init(void) |
105 | { | 105 | { |
106 | /* reset and configure */ | 106 | /* reset and configure */ |
107 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); | 107 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); |
@@ -110,10 +110,6 @@ static void __init pxa910_timer_init(void) | |||
110 | timer_init(IRQ_PXA910_AP1_TIMER1); | 110 | timer_init(IRQ_PXA910_AP1_TIMER1); |
111 | } | 111 | } |
112 | 112 | ||
113 | struct sys_timer pxa910_timer = { | ||
114 | .init = pxa910_timer_init, | ||
115 | }; | ||
116 | |||
117 | /* on-chip devices */ | 113 | /* on-chip devices */ |
118 | 114 | ||
119 | /* NOTE: there are totally 3 UARTs on PXA910: | 115 | /* NOTE: there are totally 3 UARTs on PXA910: |
diff --git a/arch/arm/mach-mmp/tavorevb.c b/arch/arm/mach-mmp/tavorevb.c index b28f9084dfff..4c127d23955d 100644 --- a/arch/arm/mach-mmp/tavorevb.c +++ b/arch/arm/mach-mmp/tavorevb.c | |||
@@ -103,7 +103,7 @@ MACHINE_START(TAVOREVB, "PXA910 Evaluation Board (aka TavorEVB)") | |||
103 | .map_io = mmp_map_io, | 103 | .map_io = mmp_map_io, |
104 | .nr_irqs = MMP_NR_IRQS, | 104 | .nr_irqs = MMP_NR_IRQS, |
105 | .init_irq = pxa910_init_irq, | 105 | .init_irq = pxa910_init_irq, |
106 | .timer = &pxa910_timer, | 106 | .init_time = pxa910_timer_init, |
107 | .init_machine = tavorevb_init, | 107 | .init_machine = tavorevb_init, |
108 | .restart = mmp_restart, | 108 | .restart = mmp_restart, |
109 | MACHINE_END | 109 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c index dd30ea74785c..8609967975ed 100644 --- a/arch/arm/mach-mmp/teton_bga.c +++ b/arch/arm/mach-mmp/teton_bga.c | |||
@@ -86,7 +86,7 @@ MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform") | |||
86 | .map_io = mmp_map_io, | 86 | .map_io = mmp_map_io, |
87 | .nr_irqs = MMP_NR_IRQS, | 87 | .nr_irqs = MMP_NR_IRQS, |
88 | .init_irq = pxa168_init_irq, | 88 | .init_irq = pxa168_init_irq, |
89 | .timer = &pxa168_timer, | 89 | .init_time = pxa168_timer_init, |
90 | .init_machine = teton_bga_init, | 90 | .init_machine = teton_bga_init, |
91 | .restart = pxa168_restart, | 91 | .restart = pxa168_restart, |
92 | MACHINE_END | 92 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c index 936447c70977..86a18b3d252e 100644 --- a/arch/arm/mach-mmp/time.c +++ b/arch/arm/mach-mmp/time.c | |||
@@ -141,7 +141,6 @@ static void timer_set_mode(enum clock_event_mode mode, | |||
141 | static struct clock_event_device ckevt = { | 141 | static struct clock_event_device ckevt = { |
142 | .name = "clockevent", | 142 | .name = "clockevent", |
143 | .features = CLOCK_EVT_FEAT_ONESHOT, | 143 | .features = CLOCK_EVT_FEAT_ONESHOT, |
144 | .shift = 32, | ||
145 | .rating = 200, | 144 | .rating = 200, |
146 | .set_next_event = timer_set_next_event, | 145 | .set_next_event = timer_set_next_event, |
147 | .set_mode = timer_set_mode, | 146 | .set_mode = timer_set_mode, |
@@ -198,15 +197,13 @@ void __init timer_init(int irq) | |||
198 | 197 | ||
199 | setup_sched_clock(mmp_read_sched_clock, 32, CLOCK_TICK_RATE); | 198 | setup_sched_clock(mmp_read_sched_clock, 32, CLOCK_TICK_RATE); |
200 | 199 | ||
201 | ckevt.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, ckevt.shift); | ||
202 | ckevt.max_delta_ns = clockevent_delta2ns(MAX_DELTA, &ckevt); | ||
203 | ckevt.min_delta_ns = clockevent_delta2ns(MIN_DELTA, &ckevt); | ||
204 | ckevt.cpumask = cpumask_of(0); | 200 | ckevt.cpumask = cpumask_of(0); |
205 | 201 | ||
206 | setup_irq(irq, &timer_irq); | 202 | setup_irq(irq, &timer_irq); |
207 | 203 | ||
208 | clocksource_register_hz(&cksrc, CLOCK_TICK_RATE); | 204 | clocksource_register_hz(&cksrc, CLOCK_TICK_RATE); |
209 | clockevents_register_device(&ckevt); | 205 | clockevents_config_and_register(&ckevt, CLOCK_TICK_RATE, |
206 | MIN_DELTA, MAX_DELTA); | ||
210 | } | 207 | } |
211 | 208 | ||
212 | #ifdef CONFIG_OF | 209 | #ifdef CONFIG_OF |
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c index ce55fd8821c4..6e474900b13e 100644 --- a/arch/arm/mach-mmp/ttc_dkb.c +++ b/arch/arm/mach-mmp/ttc_dkb.c | |||
@@ -218,7 +218,7 @@ MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") | |||
218 | .map_io = mmp_map_io, | 218 | .map_io = mmp_map_io, |
219 | .nr_irqs = TTCDKB_NR_IRQS, | 219 | .nr_irqs = TTCDKB_NR_IRQS, |
220 | .init_irq = pxa910_init_irq, | 220 | .init_irq = pxa910_init_irq, |
221 | .timer = &pxa910_timer, | 221 | .init_time = pxa910_timer_init, |
222 | .init_machine = ttc_dkb_init, | 222 | .init_machine = ttc_dkb_init, |
223 | .restart = mmp_restart, | 223 | .restart = mmp_restart, |
224 | MACHINE_END | 224 | MACHINE_END |
diff --git a/arch/arm/mach-msm/board-dt-8660.c b/arch/arm/mach-msm/board-dt-8660.c index c111cec64338..7dcfc5300bbd 100644 --- a/arch/arm/mach-msm/board-dt-8660.c +++ b/arch/arm/mach-msm/board-dt-8660.c | |||
@@ -47,6 +47,6 @@ DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)") | |||
47 | .init_irq = irqchip_init, | 47 | .init_irq = irqchip_init, |
48 | .init_machine = msm8x60_dt_init, | 48 | .init_machine = msm8x60_dt_init, |
49 | .init_late = msm8x60_init_late, | 49 | .init_late = msm8x60_init_late, |
50 | .timer = &msm_dt_timer, | 50 | .init_time = msm_dt_timer_init, |
51 | .dt_compat = msm8x60_fluid_match, | 51 | .dt_compat = msm8x60_fluid_match, |
52 | MACHINE_END | 52 | MACHINE_END |
diff --git a/arch/arm/mach-msm/board-dt-8960.c b/arch/arm/mach-msm/board-dt-8960.c index fad0e5083e43..73019363ffa4 100644 --- a/arch/arm/mach-msm/board-dt-8960.c +++ b/arch/arm/mach-msm/board-dt-8960.c | |||
@@ -32,7 +32,7 @@ DT_MACHINE_START(MSM8960_DT, "Qualcomm MSM (Flattened Device Tree)") | |||
32 | .smp = smp_ops(msm_smp_ops), | 32 | .smp = smp_ops(msm_smp_ops), |
33 | .map_io = msm_map_msm8960_io, | 33 | .map_io = msm_map_msm8960_io, |
34 | .init_irq = irqchip_init, | 34 | .init_irq = irqchip_init, |
35 | .timer = &msm_dt_timer, | 35 | .init_time = msm_dt_timer_init, |
36 | .init_machine = msm_dt_init, | 36 | .init_machine = msm_dt_init, |
37 | .dt_compat = msm8960_dt_match, | 37 | .dt_compat = msm8960_dt_match, |
38 | MACHINE_END | 38 | MACHINE_END |
diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c index 6ce542e2e21c..84d720af34ab 100644 --- a/arch/arm/mach-msm/board-halibut.c +++ b/arch/arm/mach-msm/board-halibut.c | |||
@@ -106,5 +106,5 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)") | |||
106 | .init_irq = halibut_init_irq, | 106 | .init_irq = halibut_init_irq, |
107 | .init_machine = halibut_init, | 107 | .init_machine = halibut_init, |
108 | .init_late = halibut_init_late, | 108 | .init_late = halibut_init_late, |
109 | .timer = &msm7x01_timer, | 109 | .init_time = msm7x01_timer_init, |
110 | MACHINE_END | 110 | MACHINE_END |
diff --git a/arch/arm/mach-msm/board-mahimahi.c b/arch/arm/mach-msm/board-mahimahi.c index df00bc03ce74..30c3496db593 100644 --- a/arch/arm/mach-msm/board-mahimahi.c +++ b/arch/arm/mach-msm/board-mahimahi.c | |||
@@ -75,7 +75,7 @@ static void __init mahimahi_init_late(void) | |||
75 | smd_debugfs_init(); | 75 | smd_debugfs_init(); |
76 | } | 76 | } |
77 | 77 | ||
78 | extern struct sys_timer msm_timer; | 78 | void msm_timer_init(void); |
79 | 79 | ||
80 | MACHINE_START(MAHIMAHI, "mahimahi") | 80 | MACHINE_START(MAHIMAHI, "mahimahi") |
81 | .atag_offset = 0x100, | 81 | .atag_offset = 0x100, |
@@ -84,5 +84,5 @@ MACHINE_START(MAHIMAHI, "mahimahi") | |||
84 | .init_irq = msm_init_irq, | 84 | .init_irq = msm_init_irq, |
85 | .init_machine = mahimahi_init, | 85 | .init_machine = mahimahi_init, |
86 | .init_late = mahimahi_init_late, | 86 | .init_late = mahimahi_init_late, |
87 | .timer = &msm_timer, | 87 | .init_time = msm_timer_init, |
88 | MACHINE_END | 88 | MACHINE_END |
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c index effa6f4336c7..7bc3f82e3ec9 100644 --- a/arch/arm/mach-msm/board-msm7x30.c +++ b/arch/arm/mach-msm/board-msm7x30.c | |||
@@ -131,7 +131,7 @@ MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF") | |||
131 | .init_irq = msm7x30_init_irq, | 131 | .init_irq = msm7x30_init_irq, |
132 | .init_machine = msm7x30_init, | 132 | .init_machine = msm7x30_init, |
133 | .init_late = msm7x30_init_late, | 133 | .init_late = msm7x30_init_late, |
134 | .timer = &msm7x30_timer, | 134 | .init_time = msm7x30_timer_init, |
135 | MACHINE_END | 135 | MACHINE_END |
136 | 136 | ||
137 | MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA") | 137 | MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA") |
@@ -142,7 +142,7 @@ MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA") | |||
142 | .init_irq = msm7x30_init_irq, | 142 | .init_irq = msm7x30_init_irq, |
143 | .init_machine = msm7x30_init, | 143 | .init_machine = msm7x30_init, |
144 | .init_late = msm7x30_init_late, | 144 | .init_late = msm7x30_init_late, |
145 | .timer = &msm7x30_timer, | 145 | .init_time = msm7x30_timer_init, |
146 | MACHINE_END | 146 | MACHINE_END |
147 | 147 | ||
148 | MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID") | 148 | MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID") |
@@ -153,5 +153,5 @@ MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID") | |||
153 | .init_irq = msm7x30_init_irq, | 153 | .init_irq = msm7x30_init_irq, |
154 | .init_machine = msm7x30_init, | 154 | .init_machine = msm7x30_init, |
155 | .init_late = msm7x30_init_late, | 155 | .init_late = msm7x30_init_late, |
156 | .timer = &msm7x30_timer, | 156 | .init_time = msm7x30_timer_init, |
157 | MACHINE_END | 157 | MACHINE_END |
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c index 2448fcf09eb1..686e7949a73a 100644 --- a/arch/arm/mach-msm/board-qsd8x50.c +++ b/arch/arm/mach-msm/board-qsd8x50.c | |||
@@ -200,7 +200,7 @@ MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF") | |||
200 | .init_irq = qsd8x50_init_irq, | 200 | .init_irq = qsd8x50_init_irq, |
201 | .init_machine = qsd8x50_init, | 201 | .init_machine = qsd8x50_init, |
202 | .init_late = qsd8x50_init_late, | 202 | .init_late = qsd8x50_init_late, |
203 | .timer = &qsd8x50_timer, | 203 | .init_time = qsd8x50_timer_init, |
204 | MACHINE_END | 204 | MACHINE_END |
205 | 205 | ||
206 | MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5") | 206 | MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5") |
@@ -209,5 +209,5 @@ MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5") | |||
209 | .init_irq = qsd8x50_init_irq, | 209 | .init_irq = qsd8x50_init_irq, |
210 | .init_machine = qsd8x50_init, | 210 | .init_machine = qsd8x50_init, |
211 | .init_late = qsd8x50_init_late, | 211 | .init_late = qsd8x50_init_late, |
212 | .timer = &qsd8x50_timer, | 212 | .init_time = qsd8x50_timer_init, |
213 | MACHINE_END | 213 | MACHINE_END |
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c index b7b0fc7e3278..70730111b37c 100644 --- a/arch/arm/mach-msm/board-sapphire.c +++ b/arch/arm/mach-msm/board-sapphire.c | |||
@@ -53,7 +53,7 @@ static struct platform_device *devices[] __initdata = { | |||
53 | &msm_device_uart3, | 53 | &msm_device_uart3, |
54 | }; | 54 | }; |
55 | 55 | ||
56 | extern struct sys_timer msm_timer; | 56 | void msm_timer_init(void); |
57 | 57 | ||
58 | static void __init sapphire_init_irq(void) | 58 | static void __init sapphire_init_irq(void) |
59 | { | 59 | { |
@@ -113,5 +113,5 @@ MACHINE_START(SAPPHIRE, "sapphire") | |||
113 | .init_irq = sapphire_init_irq, | 113 | .init_irq = sapphire_init_irq, |
114 | .init_machine = sapphire_init, | 114 | .init_machine = sapphire_init, |
115 | .init_late = sapphire_init_late, | 115 | .init_late = sapphire_init_late, |
116 | .timer = &msm_timer, | 116 | .init_time = msm_timer_init, |
117 | MACHINE_END | 117 | MACHINE_END |
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c index 4ba0800e243e..919bfa32871a 100644 --- a/arch/arm/mach-msm/board-trout.c +++ b/arch/arm/mach-msm/board-trout.c | |||
@@ -110,5 +110,5 @@ MACHINE_START(TROUT, "HTC Dream") | |||
110 | .init_irq = trout_init_irq, | 110 | .init_irq = trout_init_irq, |
111 | .init_machine = trout_init, | 111 | .init_machine = trout_init, |
112 | .init_late = trout_init_late, | 112 | .init_late = trout_init_late, |
113 | .timer = &msm7x01_timer, | 113 | .init_time = msm7x01_timer_init, |
114 | MACHINE_END | 114 | MACHINE_END |
diff --git a/arch/arm/mach-msm/common.h b/arch/arm/mach-msm/common.h index 633a7159d5ff..ce8215a269e5 100644 --- a/arch/arm/mach-msm/common.h +++ b/arch/arm/mach-msm/common.h | |||
@@ -12,10 +12,10 @@ | |||
12 | #ifndef __MACH_COMMON_H | 12 | #ifndef __MACH_COMMON_H |
13 | #define __MACH_COMMON_H | 13 | #define __MACH_COMMON_H |
14 | 14 | ||
15 | extern struct sys_timer msm7x01_timer; | 15 | extern void msm7x01_timer_init(void); |
16 | extern struct sys_timer msm7x30_timer; | 16 | extern void msm7x30_timer_init(void); |
17 | extern struct sys_timer msm_dt_timer; | 17 | extern void msm_dt_timer_init(void); |
18 | extern struct sys_timer qsd8x50_timer; | 18 | extern void qsd8x50_timer_init(void); |
19 | 19 | ||
20 | extern void msm_map_common_io(void); | 20 | extern void msm_map_common_io(void); |
21 | extern void msm_map_msm7x30_io(void); | 21 | extern void msm_map_msm7x30_io(void); |
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 4330285d6753..2969027f02fa 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
@@ -143,13 +143,9 @@ static int __cpuinit msm_local_timer_setup(struct clock_event_device *evt) | |||
143 | evt->rating = msm_clockevent.rating; | 143 | evt->rating = msm_clockevent.rating; |
144 | evt->set_mode = msm_timer_set_mode; | 144 | evt->set_mode = msm_timer_set_mode; |
145 | evt->set_next_event = msm_timer_set_next_event; | 145 | evt->set_next_event = msm_timer_set_next_event; |
146 | evt->shift = msm_clockevent.shift; | ||
147 | evt->mult = div_sc(GPT_HZ, NSEC_PER_SEC, evt->shift); | ||
148 | evt->max_delta_ns = clockevent_delta2ns(0xf0000000, evt); | ||
149 | evt->min_delta_ns = clockevent_delta2ns(4, evt); | ||
150 | 146 | ||
151 | *__this_cpu_ptr(msm_evt.percpu_evt) = evt; | 147 | *__this_cpu_ptr(msm_evt.percpu_evt) = evt; |
152 | clockevents_register_device(evt); | 148 | clockevents_config_and_register(evt, GPT_HZ, 4, 0xf0000000); |
153 | enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING); | 149 | enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING); |
154 | return 0; | 150 | return 0; |
155 | } | 151 | } |
@@ -228,7 +224,7 @@ static const struct of_device_id msm_gpt_match[] __initconst = { | |||
228 | { }, | 224 | { }, |
229 | }; | 225 | }; |
230 | 226 | ||
231 | static void __init msm_dt_timer_init(void) | 227 | void __init msm_dt_timer_init(void) |
232 | { | 228 | { |
233 | struct device_node *np; | 229 | struct device_node *np; |
234 | u32 freq; | 230 | u32 freq; |
@@ -295,10 +291,6 @@ static void __init msm_dt_timer_init(void) | |||
295 | 291 | ||
296 | msm_timer_init(freq, 32, irq, !!percpu_offset); | 292 | msm_timer_init(freq, 32, irq, !!percpu_offset); |
297 | } | 293 | } |
298 | |||
299 | struct sys_timer msm_dt_timer = { | ||
300 | .init = msm_dt_timer_init | ||
301 | }; | ||
302 | #endif | 294 | #endif |
303 | 295 | ||
304 | static int __init msm_timer_map(phys_addr_t event, phys_addr_t source) | 296 | static int __init msm_timer_map(phys_addr_t event, phys_addr_t source) |
@@ -316,7 +308,7 @@ static int __init msm_timer_map(phys_addr_t event, phys_addr_t source) | |||
316 | return 0; | 308 | return 0; |
317 | } | 309 | } |
318 | 310 | ||
319 | static void __init msm7x01_timer_init(void) | 311 | void __init msm7x01_timer_init(void) |
320 | { | 312 | { |
321 | struct clocksource *cs = &msm_clocksource; | 313 | struct clocksource *cs = &msm_clocksource; |
322 | 314 | ||
@@ -329,28 +321,16 @@ static void __init msm7x01_timer_init(void) | |||
329 | false); | 321 | false); |
330 | } | 322 | } |
331 | 323 | ||
332 | struct sys_timer msm7x01_timer = { | 324 | void __init msm7x30_timer_init(void) |
333 | .init = msm7x01_timer_init | ||
334 | }; | ||
335 | |||
336 | static void __init msm7x30_timer_init(void) | ||
337 | { | 325 | { |
338 | if (msm_timer_map(0xc0100004, 0xc0100024)) | 326 | if (msm_timer_map(0xc0100004, 0xc0100024)) |
339 | return; | 327 | return; |
340 | msm_timer_init(24576000 / 4, 32, 1, false); | 328 | msm_timer_init(24576000 / 4, 32, 1, false); |
341 | } | 329 | } |
342 | 330 | ||
343 | struct sys_timer msm7x30_timer = { | 331 | void __init qsd8x50_timer_init(void) |
344 | .init = msm7x30_timer_init | ||
345 | }; | ||
346 | |||
347 | static void __init qsd8x50_timer_init(void) | ||
348 | { | 332 | { |
349 | if (msm_timer_map(0xAC100000, 0xAC100010)) | 333 | if (msm_timer_map(0xAC100000, 0xAC100010)) |
350 | return; | 334 | return; |
351 | msm_timer_init(19200000 / 4, 32, 7, false); | 335 | msm_timer_init(19200000 / 4, 32, 7, false); |
352 | } | 336 | } |
353 | |||
354 | struct sys_timer qsd8x50_timer = { | ||
355 | .init = qsd8x50_timer_init | ||
356 | }; | ||
diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c index ee74ec97c141..1f2ef98b37c6 100644 --- a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c +++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c | |||
@@ -150,6 +150,6 @@ MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL") | |||
150 | .map_io = mv78xx0_map_io, | 150 | .map_io = mv78xx0_map_io, |
151 | .init_early = mv78xx0_init_early, | 151 | .init_early = mv78xx0_init_early, |
152 | .init_irq = mv78xx0_init_irq, | 152 | .init_irq = mv78xx0_init_irq, |
153 | .timer = &mv78xx0_timer, | 153 | .init_time = mv78xx0_timer_init, |
154 | .restart = mv78xx0_restart, | 154 | .restart = mv78xx0_restart, |
155 | MACHINE_END | 155 | MACHINE_END |
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index d0cb4857b4b3..0efa14498ebc 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -336,16 +336,12 @@ void __init mv78xx0_init_early(void) | |||
336 | orion_time_set_base(TIMER_VIRT_BASE); | 336 | orion_time_set_base(TIMER_VIRT_BASE); |
337 | } | 337 | } |
338 | 338 | ||
339 | static void __init_refok mv78xx0_timer_init(void) | 339 | void __init_refok mv78xx0_timer_init(void) |
340 | { | 340 | { |
341 | orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, | 341 | orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, |
342 | IRQ_MV78XX0_TIMER_1, get_tclk()); | 342 | IRQ_MV78XX0_TIMER_1, get_tclk()); |
343 | } | 343 | } |
344 | 344 | ||
345 | struct sys_timer mv78xx0_timer = { | ||
346 | .init = mv78xx0_timer_init, | ||
347 | }; | ||
348 | |||
349 | 345 | ||
350 | /***************************************************************************** | 346 | /***************************************************************************** |
351 | * General | 347 | * General |
diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h index 507c767d49e0..5e9485bad0ac 100644 --- a/arch/arm/mach-mv78xx0/common.h +++ b/arch/arm/mach-mv78xx0/common.h | |||
@@ -47,7 +47,7 @@ void mv78xx0_uart3_init(void); | |||
47 | void mv78xx0_i2c_init(void); | 47 | void mv78xx0_i2c_init(void); |
48 | void mv78xx0_restart(char, const char *); | 48 | void mv78xx0_restart(char, const char *); |
49 | 49 | ||
50 | extern struct sys_timer mv78xx0_timer; | 50 | extern void mv78xx0_timer_init(void); |
51 | 51 | ||
52 | 52 | ||
53 | #endif | 53 | #endif |
diff --git a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c index 4d6d48bf51ef..4e0f22b30bc8 100644 --- a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c +++ b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c | |||
@@ -98,6 +98,6 @@ MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board") | |||
98 | .map_io = mv78xx0_map_io, | 98 | .map_io = mv78xx0_map_io, |
99 | .init_early = mv78xx0_init_early, | 99 | .init_early = mv78xx0_init_early, |
100 | .init_irq = mv78xx0_init_irq, | 100 | .init_irq = mv78xx0_init_irq, |
101 | .timer = &mv78xx0_timer, | 101 | .init_time = mv78xx0_timer_init, |
102 | .restart = mv78xx0_restart, | 102 | .restart = mv78xx0_restart, |
103 | MACHINE_END | 103 | MACHINE_END |
diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c index 9a882706e138..d2d06f3957f3 100644 --- a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c +++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c | |||
@@ -83,6 +83,6 @@ MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board") | |||
83 | .map_io = mv78xx0_map_io, | 83 | .map_io = mv78xx0_map_io, |
84 | .init_early = mv78xx0_init_early, | 84 | .init_early = mv78xx0_init_early, |
85 | .init_irq = mv78xx0_init_irq, | 85 | .init_irq = mv78xx0_init_irq, |
86 | .timer = &mv78xx0_timer, | 86 | .init_time = mv78xx0_timer_init, |
87 | .restart = mv78xx0_restart, | 87 | .restart = mv78xx0_restart, |
88 | MACHINE_END | 88 | MACHINE_END |
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c index 7434b5e36197..a5ea616d6d12 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/armada-370-xp.c | |||
@@ -56,10 +56,6 @@ void __init armada_370_xp_init_early(void) | |||
56 | init_dma_coherent_pool_size(SZ_1M); | 56 | init_dma_coherent_pool_size(SZ_1M); |
57 | } | 57 | } |
58 | 58 | ||
59 | struct sys_timer armada_370_xp_timer = { | ||
60 | .init = armada_370_xp_timer_and_clk_init, | ||
61 | }; | ||
62 | |||
63 | static void __init armada_370_xp_dt_init(void) | 59 | static void __init armada_370_xp_dt_init(void) |
64 | { | 60 | { |
65 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 61 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
@@ -78,7 +74,7 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)") | |||
78 | .init_early = armada_370_xp_init_early, | 74 | .init_early = armada_370_xp_init_early, |
79 | .init_irq = armada_370_xp_init_irq, | 75 | .init_irq = armada_370_xp_init_irq, |
80 | .handle_irq = armada_370_xp_handle_irq, | 76 | .handle_irq = armada_370_xp_handle_irq, |
81 | .timer = &armada_370_xp_timer, | 77 | .init_time = armada_370_xp_timer_and_clk_init, |
82 | .restart = mvebu_restart, | 78 | .restart = mvebu_restart, |
83 | .dt_compat = armada_370_xp_dt_compat, | 79 | .dt_compat = armada_370_xp_dt_compat, |
84 | MACHINE_END | 80 | MACHINE_END |
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index c66129b5dd18..5fad7cefe8aa 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c | |||
@@ -163,19 +163,11 @@ static void __init imx23_timer_init(void) | |||
163 | mx23_clocks_init(); | 163 | mx23_clocks_init(); |
164 | } | 164 | } |
165 | 165 | ||
166 | static struct sys_timer imx23_timer = { | ||
167 | .init = imx23_timer_init, | ||
168 | }; | ||
169 | |||
170 | static void __init imx28_timer_init(void) | 166 | static void __init imx28_timer_init(void) |
171 | { | 167 | { |
172 | mx28_clocks_init(); | 168 | mx28_clocks_init(); |
173 | } | 169 | } |
174 | 170 | ||
175 | static struct sys_timer imx28_timer = { | ||
176 | .init = imx28_timer_init, | ||
177 | }; | ||
178 | |||
179 | enum mac_oui { | 171 | enum mac_oui { |
180 | OUI_FSL, | 172 | OUI_FSL, |
181 | OUI_DENX, | 173 | OUI_DENX, |
@@ -446,7 +438,7 @@ DT_MACHINE_START(IMX23, "Freescale i.MX23 (Device Tree)") | |||
446 | .map_io = mx23_map_io, | 438 | .map_io = mx23_map_io, |
447 | .init_irq = icoll_init_irq, | 439 | .init_irq = icoll_init_irq, |
448 | .handle_irq = icoll_handle_irq, | 440 | .handle_irq = icoll_handle_irq, |
449 | .timer = &imx23_timer, | 441 | .init_time = imx23_timer_init, |
450 | .init_machine = mxs_machine_init, | 442 | .init_machine = mxs_machine_init, |
451 | .dt_compat = imx23_dt_compat, | 443 | .dt_compat = imx23_dt_compat, |
452 | .restart = mxs_restart, | 444 | .restart = mxs_restart, |
@@ -456,7 +448,7 @@ DT_MACHINE_START(IMX28, "Freescale i.MX28 (Device Tree)") | |||
456 | .map_io = mx28_map_io, | 448 | .map_io = mx28_map_io, |
457 | .init_irq = icoll_init_irq, | 449 | .init_irq = icoll_init_irq, |
458 | .handle_irq = icoll_handle_irq, | 450 | .handle_irq = icoll_handle_irq, |
459 | .timer = &imx28_timer, | 451 | .init_time = imx28_timer_init, |
460 | .init_machine = mxs_machine_init, | 452 | .init_machine = mxs_machine_init, |
461 | .dt_compat = imx28_dt_compat, | 453 | .dt_compat = imx28_dt_compat, |
462 | .restart = mxs_restart, | 454 | .restart = mxs_restart, |
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c index 856f4c796061..27451b1ba3f1 100644 --- a/arch/arm/mach-mxs/timer.c +++ b/arch/arm/mach-mxs/timer.c | |||
@@ -195,7 +195,6 @@ static void mxs_set_mode(enum clock_event_mode mode, | |||
195 | static struct clock_event_device mxs_clockevent_device = { | 195 | static struct clock_event_device mxs_clockevent_device = { |
196 | .name = "mxs_timrot", | 196 | .name = "mxs_timrot", |
197 | .features = CLOCK_EVT_FEAT_ONESHOT, | 197 | .features = CLOCK_EVT_FEAT_ONESHOT, |
198 | .shift = 32, | ||
199 | .set_mode = mxs_set_mode, | 198 | .set_mode = mxs_set_mode, |
200 | .set_next_event = timrotv2_set_next_event, | 199 | .set_next_event = timrotv2_set_next_event, |
201 | .rating = 200, | 200 | .rating = 200, |
@@ -203,25 +202,12 @@ static struct clock_event_device mxs_clockevent_device = { | |||
203 | 202 | ||
204 | static int __init mxs_clockevent_init(struct clk *timer_clk) | 203 | static int __init mxs_clockevent_init(struct clk *timer_clk) |
205 | { | 204 | { |
206 | unsigned int c = clk_get_rate(timer_clk); | 205 | if (timrot_is_v1()) |
207 | |||
208 | mxs_clockevent_device.mult = | ||
209 | div_sc(c, NSEC_PER_SEC, mxs_clockevent_device.shift); | ||
210 | mxs_clockevent_device.cpumask = cpumask_of(0); | ||
211 | if (timrot_is_v1()) { | ||
212 | mxs_clockevent_device.set_next_event = timrotv1_set_next_event; | 206 | mxs_clockevent_device.set_next_event = timrotv1_set_next_event; |
213 | mxs_clockevent_device.max_delta_ns = | 207 | mxs_clockevent_device.cpumask = cpumask_of(0); |
214 | clockevent_delta2ns(0xfffe, &mxs_clockevent_device); | 208 | clockevents_config_and_register(&mxs_clockevent_device, |
215 | mxs_clockevent_device.min_delta_ns = | 209 | clk_get_rate(timer_clk), 0xf, |
216 | clockevent_delta2ns(0xf, &mxs_clockevent_device); | 210 | timrot_is_v1() ? 0xfffe : 0xfffffffe); |
217 | } else { | ||
218 | mxs_clockevent_device.max_delta_ns = | ||
219 | clockevent_delta2ns(0xfffffffe, &mxs_clockevent_device); | ||
220 | mxs_clockevent_device.min_delta_ns = | ||
221 | clockevent_delta2ns(0xf, &mxs_clockevent_device); | ||
222 | } | ||
223 | |||
224 | clockevents_register_device(&mxs_clockevent_device); | ||
225 | 211 | ||
226 | return 0; | 212 | return 0; |
227 | } | 213 | } |
diff --git a/arch/arm/mach-netx/generic.h b/arch/arm/mach-netx/generic.h index 9b915119b8d6..768b26bbb42b 100644 --- a/arch/arm/mach-netx/generic.h +++ b/arch/arm/mach-netx/generic.h | |||
@@ -21,5 +21,4 @@ extern void __init netx_map_io(void); | |||
21 | extern void __init netx_init_irq(void); | 21 | extern void __init netx_init_irq(void); |
22 | extern void netx_restart(char, const char *); | 22 | extern void netx_restart(char, const char *); |
23 | 23 | ||
24 | struct sys_timer; | 24 | extern void netx_timer_init(void); |
25 | extern struct sys_timer netx_timer; | ||
diff --git a/arch/arm/mach-netx/nxdb500.c b/arch/arm/mach-netx/nxdb500.c index 04d5e5eb6473..9b558eb3070f 100644 --- a/arch/arm/mach-netx/nxdb500.c +++ b/arch/arm/mach-netx/nxdb500.c | |||
@@ -203,7 +203,7 @@ MACHINE_START(NXDB500, "Hilscher nxdb500") | |||
203 | .atag_offset = 0x100, | 203 | .atag_offset = 0x100, |
204 | .map_io = netx_map_io, | 204 | .map_io = netx_map_io, |
205 | .init_irq = netx_init_irq, | 205 | .init_irq = netx_init_irq, |
206 | .timer = &netx_timer, | 206 | .init_time = netx_timer_init, |
207 | .init_machine = nxdb500_init, | 207 | .init_machine = nxdb500_init, |
208 | .restart = netx_restart, | 208 | .restart = netx_restart, |
209 | MACHINE_END | 209 | MACHINE_END |
diff --git a/arch/arm/mach-netx/nxdkn.c b/arch/arm/mach-netx/nxdkn.c index cf15bdd50f6f..a5e86cd365e7 100644 --- a/arch/arm/mach-netx/nxdkn.c +++ b/arch/arm/mach-netx/nxdkn.c | |||
@@ -96,7 +96,7 @@ MACHINE_START(NXDKN, "Hilscher nxdkn") | |||
96 | .atag_offset = 0x100, | 96 | .atag_offset = 0x100, |
97 | .map_io = netx_map_io, | 97 | .map_io = netx_map_io, |
98 | .init_irq = netx_init_irq, | 98 | .init_irq = netx_init_irq, |
99 | .timer = &netx_timer, | 99 | .init_time = netx_timer_init, |
100 | .init_machine = nxdkn_init, | 100 | .init_machine = nxdkn_init, |
101 | .restart = netx_restart, | 101 | .restart = netx_restart, |
102 | MACHINE_END | 102 | MACHINE_END |
diff --git a/arch/arm/mach-netx/nxeb500hmi.c b/arch/arm/mach-netx/nxeb500hmi.c index 069bd26e1b72..ad17885d0159 100644 --- a/arch/arm/mach-netx/nxeb500hmi.c +++ b/arch/arm/mach-netx/nxeb500hmi.c | |||
@@ -180,7 +180,7 @@ MACHINE_START(NXEB500HMI, "Hilscher nxeb500hmi") | |||
180 | .atag_offset = 0x100, | 180 | .atag_offset = 0x100, |
181 | .map_io = netx_map_io, | 181 | .map_io = netx_map_io, |
182 | .init_irq = netx_init_irq, | 182 | .init_irq = netx_init_irq, |
183 | .timer = &netx_timer, | 183 | .init_time = netx_timer_init, |
184 | .init_machine = nxeb500hmi_init, | 184 | .init_machine = nxeb500hmi_init, |
185 | .restart = netx_restart, | 185 | .restart = netx_restart, |
186 | MACHINE_END | 186 | MACHINE_END |
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c index e24c141ba489..6df42e643031 100644 --- a/arch/arm/mach-netx/time.c +++ b/arch/arm/mach-netx/time.c | |||
@@ -76,7 +76,6 @@ static int netx_set_next_event(unsigned long evt, | |||
76 | 76 | ||
77 | static struct clock_event_device netx_clockevent = { | 77 | static struct clock_event_device netx_clockevent = { |
78 | .name = "netx-timer" __stringify(TIMER_CLOCKEVENT), | 78 | .name = "netx-timer" __stringify(TIMER_CLOCKEVENT), |
79 | .shift = 32, | ||
80 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 79 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
81 | .set_next_event = netx_set_next_event, | 80 | .set_next_event = netx_set_next_event, |
82 | .set_mode = netx_set_mode, | 81 | .set_mode = netx_set_mode, |
@@ -107,7 +106,7 @@ static struct irqaction netx_timer_irq = { | |||
107 | /* | 106 | /* |
108 | * Set up timer interrupt | 107 | * Set up timer interrupt |
109 | */ | 108 | */ |
110 | static void __init netx_timer_init(void) | 109 | void __init netx_timer_init(void) |
111 | { | 110 | { |
112 | /* disable timer initially */ | 111 | /* disable timer initially */ |
113 | writel(0, NETX_GPIO_COUNTER_CTRL(0)); | 112 | writel(0, NETX_GPIO_COUNTER_CTRL(0)); |
@@ -140,18 +139,9 @@ static void __init netx_timer_init(void) | |||
140 | clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE), | 139 | clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE), |
141 | "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up); | 140 | "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up); |
142 | 141 | ||
143 | netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, | ||
144 | netx_clockevent.shift); | ||
145 | netx_clockevent.max_delta_ns = | ||
146 | clockevent_delta2ns(0xfffffffe, &netx_clockevent); | ||
147 | /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine. | 142 | /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine. |
148 | * Adding some safety ... */ | 143 | * Adding some safety ... */ |
149 | netx_clockevent.min_delta_ns = | ||
150 | clockevent_delta2ns(0xa00, &netx_clockevent); | ||
151 | netx_clockevent.cpumask = cpumask_of(0); | 144 | netx_clockevent.cpumask = cpumask_of(0); |
152 | clockevents_register_device(&netx_clockevent); | 145 | clockevents_config_and_register(&netx_clockevent, CLOCK_TICK_RATE, |
146 | 0xa00, 0xfffffffe); | ||
153 | } | 147 | } |
154 | |||
155 | struct sys_timer netx_timer = { | ||
156 | .init = netx_timer_init, | ||
157 | }; | ||
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index 5748df0d725a..aaed48d94374 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c | |||
@@ -266,10 +266,6 @@ static void __init nomadik_timer_init(void) | |||
266 | nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE), IRQ_MTU0); | 266 | nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE), IRQ_MTU0); |
267 | } | 267 | } |
268 | 268 | ||
269 | static struct sys_timer nomadik_timer = { | ||
270 | .init = nomadik_timer_init, | ||
271 | }; | ||
272 | |||
273 | static struct i2c_board_info __initdata nhk8815_i2c0_devices[] = { | 269 | static struct i2c_board_info __initdata nhk8815_i2c0_devices[] = { |
274 | { | 270 | { |
275 | I2C_BOARD_INFO("stw4811", 0x2d), | 271 | I2C_BOARD_INFO("stw4811", 0x2d), |
@@ -351,7 +347,7 @@ MACHINE_START(NOMADIK, "NHK8815") | |||
351 | .atag_offset = 0x100, | 347 | .atag_offset = 0x100, |
352 | .map_io = cpu8815_map_io, | 348 | .map_io = cpu8815_map_io, |
353 | .init_irq = cpu8815_init_irq, | 349 | .init_irq = cpu8815_init_irq, |
354 | .timer = &nomadik_timer, | 350 | .init_time = nomadik_timer_init, |
355 | .init_machine = nhk8815_platform_init, | 351 | .init_machine = nhk8815_platform_init, |
356 | .restart = cpu8815_restart, | 352 | .restart = cpu8815_restart, |
357 | MACHINE_END | 353 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 2e98a3ac7c5e..2aab761ee68d 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
@@ -628,6 +628,6 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") | |||
628 | .init_irq = omap1_init_irq, | 628 | .init_irq = omap1_init_irq, |
629 | .init_machine = ams_delta_init, | 629 | .init_machine = ams_delta_init, |
630 | .init_late = ams_delta_init_late, | 630 | .init_late = ams_delta_init_late, |
631 | .timer = &omap1_timer, | 631 | .init_time = omap1_timer_init, |
632 | .restart = omap1_restart, | 632 | .restart = omap1_restart, |
633 | MACHINE_END | 633 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index 560a7dcf0a56..702d58039cc1 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c | |||
@@ -364,6 +364,6 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample") | |||
364 | .init_irq = omap1_init_irq, | 364 | .init_irq = omap1_init_irq, |
365 | .init_machine = omap_fsample_init, | 365 | .init_machine = omap_fsample_init, |
366 | .init_late = omap1_init_late, | 366 | .init_late = omap1_init_late, |
367 | .timer = &omap1_timer, | 367 | .init_time = omap1_timer_init, |
368 | .restart = omap1_restart, | 368 | .restart = omap1_restart, |
369 | MACHINE_END | 369 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c index 608e7d2a2778..e1d9171774bc 100644 --- a/arch/arm/mach-omap1/board-generic.c +++ b/arch/arm/mach-omap1/board-generic.c | |||
@@ -84,6 +84,6 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") | |||
84 | .init_irq = omap1_init_irq, | 84 | .init_irq = omap1_init_irq, |
85 | .init_machine = omap_generic_init, | 85 | .init_machine = omap_generic_init, |
86 | .init_late = omap1_init_late, | 86 | .init_late = omap1_init_late, |
87 | .timer = &omap1_timer, | 87 | .init_time = omap1_timer_init, |
88 | .restart = omap1_restart, | 88 | .restart = omap1_restart, |
89 | MACHINE_END | 89 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 2274bd677efc..0dac3d239e32 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -461,6 +461,6 @@ MACHINE_START(OMAP_H2, "TI-H2") | |||
461 | .init_irq = omap1_init_irq, | 461 | .init_irq = omap1_init_irq, |
462 | .init_machine = h2_init, | 462 | .init_machine = h2_init, |
463 | .init_late = omap1_init_late, | 463 | .init_late = omap1_init_late, |
464 | .timer = &omap1_timer, | 464 | .init_time = omap1_timer_init, |
465 | .restart = omap1_restart, | 465 | .restart = omap1_restart, |
466 | MACHINE_END | 466 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 1051935f0aac..816ecd13f81e 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
@@ -454,6 +454,6 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") | |||
454 | .init_irq = omap1_init_irq, | 454 | .init_irq = omap1_init_irq, |
455 | .init_machine = h3_init, | 455 | .init_machine = h3_init, |
456 | .init_late = omap1_init_late, | 456 | .init_late = omap1_init_late, |
457 | .timer = &omap1_timer, | 457 | .init_time = omap1_timer_init, |
458 | .restart = omap1_restart, | 458 | .restart = omap1_restart, |
459 | MACHINE_END | 459 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c index 356f816c84a6..35a2379b986f 100644 --- a/arch/arm/mach-omap1/board-htcherald.c +++ b/arch/arm/mach-omap1/board-htcherald.c | |||
@@ -603,6 +603,6 @@ MACHINE_START(HERALD, "HTC Herald") | |||
603 | .init_irq = omap1_init_irq, | 603 | .init_irq = omap1_init_irq, |
604 | .init_machine = htcherald_init, | 604 | .init_machine = htcherald_init, |
605 | .init_late = omap1_init_late, | 605 | .init_late = omap1_init_late, |
606 | .timer = &omap1_timer, | 606 | .init_time = omap1_timer_init, |
607 | .restart = omap1_restart, | 607 | .restart = omap1_restart, |
608 | MACHINE_END | 608 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c index f8033fab0f82..bd5f02e9c354 100644 --- a/arch/arm/mach-omap1/board-innovator.c +++ b/arch/arm/mach-omap1/board-innovator.c | |||
@@ -458,6 +458,6 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") | |||
458 | .init_irq = omap1_init_irq, | 458 | .init_irq = omap1_init_irq, |
459 | .init_machine = innovator_init, | 459 | .init_machine = innovator_init, |
460 | .init_late = omap1_init_late, | 460 | .init_late = omap1_init_late, |
461 | .timer = &omap1_timer, | 461 | .init_time = omap1_timer_init, |
462 | .restart = omap1_restart, | 462 | .restart = omap1_restart, |
463 | MACHINE_END | 463 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 24d2f2df11a0..4695ca717706 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c | |||
@@ -242,6 +242,6 @@ MACHINE_START(NOKIA770, "Nokia 770") | |||
242 | .init_irq = omap1_init_irq, | 242 | .init_irq = omap1_init_irq, |
243 | .init_machine = omap_nokia770_init, | 243 | .init_machine = omap_nokia770_init, |
244 | .init_late = omap1_init_late, | 244 | .init_late = omap1_init_late, |
245 | .timer = &omap1_timer, | 245 | .init_time = omap1_timer_init, |
246 | .restart = omap1_restart, | 246 | .restart = omap1_restart, |
247 | MACHINE_END | 247 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index 872ea47cd28a..a7ce69286688 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c | |||
@@ -609,6 +609,6 @@ MACHINE_START(OMAP_OSK, "TI-OSK") | |||
609 | .init_irq = omap1_init_irq, | 609 | .init_irq = omap1_init_irq, |
610 | .init_machine = osk_init, | 610 | .init_machine = osk_init, |
611 | .init_late = omap1_init_late, | 611 | .init_late = omap1_init_late, |
612 | .timer = &omap1_timer, | 612 | .init_time = omap1_timer_init, |
613 | .restart = omap1_restart, | 613 | .restart = omap1_restart, |
614 | MACHINE_END | 614 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index c33dceb46607..845a1a7aef95 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c | |||
@@ -268,6 +268,6 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E") | |||
268 | .init_irq = omap1_init_irq, | 268 | .init_irq = omap1_init_irq, |
269 | .init_machine = omap_palmte_init, | 269 | .init_machine = omap_palmte_init, |
270 | .init_late = omap1_init_late, | 270 | .init_late = omap1_init_late, |
271 | .timer = &omap1_timer, | 271 | .init_time = omap1_timer_init, |
272 | .restart = omap1_restart, | 272 | .restart = omap1_restart, |
273 | MACHINE_END | 273 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c index 2948b0ee4be8..65a4a3e357f2 100644 --- a/arch/arm/mach-omap1/board-palmtt.c +++ b/arch/arm/mach-omap1/board-palmtt.c | |||
@@ -314,6 +314,6 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T") | |||
314 | .init_irq = omap1_init_irq, | 314 | .init_irq = omap1_init_irq, |
315 | .init_machine = omap_palmtt_init, | 315 | .init_machine = omap_palmtt_init, |
316 | .init_late = omap1_init_late, | 316 | .init_late = omap1_init_late, |
317 | .timer = &omap1_timer, | 317 | .init_time = omap1_timer_init, |
318 | .restart = omap1_restart, | 318 | .restart = omap1_restart, |
319 | MACHINE_END | 319 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c index 7a05895c0be3..01c970071fd8 100644 --- a/arch/arm/mach-omap1/board-palmz71.c +++ b/arch/arm/mach-omap1/board-palmz71.c | |||
@@ -330,6 +330,6 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71") | |||
330 | .init_irq = omap1_init_irq, | 330 | .init_irq = omap1_init_irq, |
331 | .init_machine = omap_palmz71_init, | 331 | .init_machine = omap_palmz71_init, |
332 | .init_late = omap1_init_late, | 332 | .init_late = omap1_init_late, |
333 | .timer = &omap1_timer, | 333 | .init_time = omap1_timer_init, |
334 | .restart = omap1_restart, | 334 | .restart = omap1_restart, |
335 | MACHINE_END | 335 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c index 27f8d12ec222..8b2f7127f716 100644 --- a/arch/arm/mach-omap1/board-perseus2.c +++ b/arch/arm/mach-omap1/board-perseus2.c | |||
@@ -326,6 +326,6 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") | |||
326 | .init_irq = omap1_init_irq, | 326 | .init_irq = omap1_init_irq, |
327 | .init_machine = omap_perseus2_init, | 327 | .init_machine = omap_perseus2_init, |
328 | .init_late = omap1_init_late, | 328 | .init_late = omap1_init_late, |
329 | .timer = &omap1_timer, | 329 | .init_time = omap1_timer_init, |
330 | .restart = omap1_restart, | 330 | .restart = omap1_restart, |
331 | MACHINE_END | 331 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index 20ed52ae1714..9732a98f3e06 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c | |||
@@ -407,6 +407,6 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1") | |||
407 | .init_irq = omap1_init_irq, | 407 | .init_irq = omap1_init_irq, |
408 | .init_machine = omap_sx1_init, | 408 | .init_machine = omap_sx1_init, |
409 | .init_late = omap1_init_late, | 409 | .init_late = omap1_init_late, |
410 | .timer = &omap1_timer, | 410 | .init_time = omap1_timer_init, |
411 | .restart = omap1_restart, | 411 | .restart = omap1_restart, |
412 | MACHINE_END | 412 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c index abf705f49b19..6c116e1a4b01 100644 --- a/arch/arm/mach-omap1/board-voiceblue.c +++ b/arch/arm/mach-omap1/board-voiceblue.c | |||
@@ -289,6 +289,6 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") | |||
289 | .init_irq = omap1_init_irq, | 289 | .init_irq = omap1_init_irq, |
290 | .init_machine = voiceblue_init, | 290 | .init_machine = voiceblue_init, |
291 | .init_late = omap1_init_late, | 291 | .init_late = omap1_init_late, |
292 | .timer = &omap1_timer, | 292 | .init_time = omap1_timer_init, |
293 | .restart = voiceblue_restart, | 293 | .restart = voiceblue_restart, |
294 | MACHINE_END | 294 | MACHINE_END |
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h index b53e0854422f..fb18831e88aa 100644 --- a/arch/arm/mach-omap1/common.h +++ b/arch/arm/mach-omap1/common.h | |||
@@ -75,7 +75,7 @@ extern void __init omap_check_revision(void); | |||
75 | extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, | 75 | extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, |
76 | unsigned int ctrl); | 76 | unsigned int ctrl); |
77 | 77 | ||
78 | extern struct sys_timer omap1_timer; | 78 | extern void omap1_timer_init(void); |
79 | #ifdef CONFIG_OMAP_32K_TIMER | 79 | #ifdef CONFIG_OMAP_32K_TIMER |
80 | extern int omap_32k_timer_init(void); | 80 | extern int omap_32k_timer_init(void); |
81 | #else | 81 | #else |
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index 4d4816fd6fc9..726ec23d29c7 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c | |||
@@ -145,7 +145,6 @@ static void omap_mpu_set_mode(enum clock_event_mode mode, | |||
145 | static struct clock_event_device clockevent_mpu_timer1 = { | 145 | static struct clock_event_device clockevent_mpu_timer1 = { |
146 | .name = "mpu_timer1", | 146 | .name = "mpu_timer1", |
147 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 147 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
148 | .shift = 32, | ||
149 | .set_next_event = omap_mpu_set_next_event, | 148 | .set_next_event = omap_mpu_set_next_event, |
150 | .set_mode = omap_mpu_set_mode, | 149 | .set_mode = omap_mpu_set_mode, |
151 | }; | 150 | }; |
@@ -170,15 +169,9 @@ static __init void omap_init_mpu_timer(unsigned long rate) | |||
170 | setup_irq(INT_TIMER1, &omap_mpu_timer1_irq); | 169 | setup_irq(INT_TIMER1, &omap_mpu_timer1_irq); |
171 | omap_mpu_timer_start(0, (rate / HZ) - 1, 1); | 170 | omap_mpu_timer_start(0, (rate / HZ) - 1, 1); |
172 | 171 | ||
173 | clockevent_mpu_timer1.mult = div_sc(rate, NSEC_PER_SEC, | ||
174 | clockevent_mpu_timer1.shift); | ||
175 | clockevent_mpu_timer1.max_delta_ns = | ||
176 | clockevent_delta2ns(-1, &clockevent_mpu_timer1); | ||
177 | clockevent_mpu_timer1.min_delta_ns = | ||
178 | clockevent_delta2ns(1, &clockevent_mpu_timer1); | ||
179 | |||
180 | clockevent_mpu_timer1.cpumask = cpumask_of(0); | 172 | clockevent_mpu_timer1.cpumask = cpumask_of(0); |
181 | clockevents_register_device(&clockevent_mpu_timer1); | 173 | clockevents_config_and_register(&clockevent_mpu_timer1, rate, |
174 | 1, -1); | ||
182 | } | 175 | } |
183 | 176 | ||
184 | 177 | ||
@@ -236,12 +229,8 @@ static inline void omap_mpu_timer_init(void) | |||
236 | * Timer initialization | 229 | * Timer initialization |
237 | * --------------------------------------------------------------------------- | 230 | * --------------------------------------------------------------------------- |
238 | */ | 231 | */ |
239 | static void __init omap1_timer_init(void) | 232 | void __init omap1_timer_init(void) |
240 | { | 233 | { |
241 | if (omap_32k_timer_init() != 0) | 234 | if (omap_32k_timer_init() != 0) |
242 | omap_mpu_timer_init(); | 235 | omap_mpu_timer_init(); |
243 | } | 236 | } |
244 | |||
245 | struct sys_timer omap1_timer = { | ||
246 | .init = omap1_timer_init, | ||
247 | }; | ||
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c index 41152fadd4c0..0b74246ba62c 100644 --- a/arch/arm/mach-omap1/timer32k.c +++ b/arch/arm/mach-omap1/timer32k.c | |||
@@ -140,7 +140,6 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode, | |||
140 | static struct clock_event_device clockevent_32k_timer = { | 140 | static struct clock_event_device clockevent_32k_timer = { |
141 | .name = "32k-timer", | 141 | .name = "32k-timer", |
142 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 142 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
143 | .shift = 32, | ||
144 | .set_next_event = omap_32k_timer_set_next_event, | 143 | .set_next_event = omap_32k_timer_set_next_event, |
145 | .set_mode = omap_32k_timer_set_mode, | 144 | .set_mode = omap_32k_timer_set_mode, |
146 | }; | 145 | }; |
@@ -165,16 +164,9 @@ static __init void omap_init_32k_timer(void) | |||
165 | { | 164 | { |
166 | setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); | 165 | setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); |
167 | 166 | ||
168 | clockevent_32k_timer.mult = div_sc(OMAP_32K_TICKS_PER_SEC, | ||
169 | NSEC_PER_SEC, | ||
170 | clockevent_32k_timer.shift); | ||
171 | clockevent_32k_timer.max_delta_ns = | ||
172 | clockevent_delta2ns(0xfffffffe, &clockevent_32k_timer); | ||
173 | clockevent_32k_timer.min_delta_ns = | ||
174 | clockevent_delta2ns(1, &clockevent_32k_timer); | ||
175 | |||
176 | clockevent_32k_timer.cpumask = cpumask_of(0); | 167 | clockevent_32k_timer.cpumask = cpumask_of(0); |
177 | clockevents_register_device(&clockevent_32k_timer); | 168 | clockevents_config_and_register(&clockevent_32k_timer, |
169 | OMAP_32K_TICKS_PER_SEC, 1, 0xfffffffe); | ||
178 | } | 170 | } |
179 | 171 | ||
180 | /* | 172 | /* |
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 4815ea6f8f5d..5f413968d568 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -284,6 +284,6 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") | |||
284 | .handle_irq = omap2_intc_handle_irq, | 284 | .handle_irq = omap2_intc_handle_irq, |
285 | .init_machine = omap_2430sdp_init, | 285 | .init_machine = omap_2430sdp_init, |
286 | .init_late = omap2430_init_late, | 286 | .init_late = omap2430_init_late, |
287 | .timer = &omap2_timer, | 287 | .init_time = omap2_sync32k_timer_init, |
288 | .restart = omap2xxx_restart, | 288 | .restart = omap2xxx_restart, |
289 | MACHINE_END | 289 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index bb73afc9ac17..8e2513f6a282 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -597,6 +597,6 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") | |||
597 | .handle_irq = omap3_intc_handle_irq, | 597 | .handle_irq = omap3_intc_handle_irq, |
598 | .init_machine = omap_3430sdp_init, | 598 | .init_machine = omap_3430sdp_init, |
599 | .init_late = omap3430_init_late, | 599 | .init_late = omap3430_init_late, |
600 | .timer = &omap3_timer, | 600 | .init_time = omap3_sync32k_timer_init, |
601 | .restart = omap3xxx_restart, | 601 | .restart = omap3xxx_restart, |
602 | MACHINE_END | 602 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index 050aaa771254..33846274bb8a 100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c | |||
@@ -211,6 +211,6 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") | |||
211 | .handle_irq = omap3_intc_handle_irq, | 211 | .handle_irq = omap3_intc_handle_irq, |
212 | .init_machine = omap_sdp_init, | 212 | .init_machine = omap_sdp_init, |
213 | .init_late = omap3630_init_late, | 213 | .init_late = omap3630_init_late, |
214 | .timer = &omap3_timer, | 214 | .init_time = omap3_sync32k_timer_init, |
215 | .restart = omap3xxx_restart, | 215 | .restart = omap3xxx_restart, |
216 | MACHINE_END | 216 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index cb43253dfa86..f8eeef40efe8 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -724,6 +724,6 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") | |||
724 | .init_irq = gic_init_irq, | 724 | .init_irq = gic_init_irq, |
725 | .init_machine = omap_4430sdp_init, | 725 | .init_machine = omap_4430sdp_init, |
726 | .init_late = omap4430_init_late, | 726 | .init_late = omap4430_init_late, |
727 | .timer = &omap4_timer, | 727 | .init_time = omap4_local_timer_init, |
728 | .restart = omap44xx_restart, | 728 | .restart = omap44xx_restart, |
729 | MACHINE_END | 729 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c index 51b96a1206d1..07f0be24a5d1 100644 --- a/arch/arm/mach-omap2/board-am3517crane.c +++ b/arch/arm/mach-omap2/board-am3517crane.c | |||
@@ -92,6 +92,6 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") | |||
92 | .handle_irq = omap3_intc_handle_irq, | 92 | .handle_irq = omap3_intc_handle_irq, |
93 | .init_machine = am3517_crane_init, | 93 | .init_machine = am3517_crane_init, |
94 | .init_late = am35xx_init_late, | 94 | .init_late = am35xx_init_late, |
95 | .timer = &omap3_timer, | 95 | .init_time = omap3_sync32k_timer_init, |
96 | .restart = omap3xxx_restart, | 96 | .restart = omap3xxx_restart, |
97 | MACHINE_END | 97 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index f81a303b87ff..6f5b2a05f4b2 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -393,6 +393,6 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") | |||
393 | .handle_irq = omap3_intc_handle_irq, | 393 | .handle_irq = omap3_intc_handle_irq, |
394 | .init_machine = am3517_evm_init, | 394 | .init_machine = am3517_evm_init, |
395 | .init_late = am35xx_init_late, | 395 | .init_late = am35xx_init_late, |
396 | .timer = &omap3_timer, | 396 | .init_time = omap3_sync32k_timer_init, |
397 | .restart = omap3xxx_restart, | 397 | .restart = omap3xxx_restart, |
398 | MACHINE_END | 398 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 5d0a61f54165..3a6ca74709ab 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -337,6 +337,6 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") | |||
337 | .handle_irq = omap2_intc_handle_irq, | 337 | .handle_irq = omap2_intc_handle_irq, |
338 | .init_machine = omap_apollon_init, | 338 | .init_machine = omap_apollon_init, |
339 | .init_late = omap2420_init_late, | 339 | .init_late = omap2420_init_late, |
340 | .timer = &omap2_timer, | 340 | .init_time = omap2_sync32k_timer_init, |
341 | .restart = omap2xxx_restart, | 341 | .restart = omap2xxx_restart, |
342 | MACHINE_END | 342 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index b3102c2f4a3c..68647c389190 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -751,7 +751,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35") | |||
751 | .handle_irq = omap3_intc_handle_irq, | 751 | .handle_irq = omap3_intc_handle_irq, |
752 | .init_machine = cm_t35_init, | 752 | .init_machine = cm_t35_init, |
753 | .init_late = omap35xx_init_late, | 753 | .init_late = omap35xx_init_late, |
754 | .timer = &omap3_timer, | 754 | .init_time = omap3_sync32k_timer_init, |
755 | .restart = omap3xxx_restart, | 755 | .restart = omap3xxx_restart, |
756 | MACHINE_END | 756 | MACHINE_END |
757 | 757 | ||
@@ -764,6 +764,6 @@ MACHINE_START(CM_T3730, "Compulab CM-T3730") | |||
764 | .handle_irq = omap3_intc_handle_irq, | 764 | .handle_irq = omap3_intc_handle_irq, |
765 | .init_machine = cm_t3730_init, | 765 | .init_machine = cm_t3730_init, |
766 | .init_late = omap3630_init_late, | 766 | .init_late = omap3630_init_late, |
767 | .timer = &omap3_timer, | 767 | .init_time = omap3_sync32k_timer_init, |
768 | .restart = omap3xxx_restart, | 768 | .restart = omap3xxx_restart, |
769 | MACHINE_END | 769 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index ebbc2adb499e..6a9529ab95cd 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c | |||
@@ -297,6 +297,6 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517") | |||
297 | .handle_irq = omap3_intc_handle_irq, | 297 | .handle_irq = omap3_intc_handle_irq, |
298 | .init_machine = cm_t3517_init, | 298 | .init_machine = cm_t3517_init, |
299 | .init_late = am35xx_init_late, | 299 | .init_late = am35xx_init_late, |
300 | .timer = &omap3_gp_timer, | 300 | .init_time = omap3_gp_gptimer_timer_init, |
301 | .restart = omap3xxx_restart, | 301 | .restart = omap3xxx_restart, |
302 | MACHINE_END | 302 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 12865af25d3a..0b1d8f758088 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -643,6 +643,6 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") | |||
643 | .handle_irq = omap3_intc_handle_irq, | 643 | .handle_irq = omap3_intc_handle_irq, |
644 | .init_machine = devkit8000_init, | 644 | .init_machine = devkit8000_init, |
645 | .init_late = omap35xx_init_late, | 645 | .init_late = omap35xx_init_late, |
646 | .timer = &omap3_secure_timer, | 646 | .init_time = omap3_secure_sync32k_timer_init, |
647 | .restart = omap3xxx_restart, | 647 | .restart = omap3xxx_restart, |
648 | MACHINE_END | 648 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 73be86852f6a..2590463e4b57 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -64,7 +64,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)") | |||
64 | .init_irq = omap_intc_of_init, | 64 | .init_irq = omap_intc_of_init, |
65 | .handle_irq = omap2_intc_handle_irq, | 65 | .handle_irq = omap2_intc_handle_irq, |
66 | .init_machine = omap_generic_init, | 66 | .init_machine = omap_generic_init, |
67 | .timer = &omap2_timer, | 67 | .init_time = omap2_sync32k_timer_init, |
68 | .dt_compat = omap242x_boards_compat, | 68 | .dt_compat = omap242x_boards_compat, |
69 | .restart = omap2xxx_restart, | 69 | .restart = omap2xxx_restart, |
70 | MACHINE_END | 70 | MACHINE_END |
@@ -83,7 +83,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)") | |||
83 | .init_irq = omap_intc_of_init, | 83 | .init_irq = omap_intc_of_init, |
84 | .handle_irq = omap2_intc_handle_irq, | 84 | .handle_irq = omap2_intc_handle_irq, |
85 | .init_machine = omap_generic_init, | 85 | .init_machine = omap_generic_init, |
86 | .timer = &omap2_timer, | 86 | .init_time = omap2_sync32k_timer_init, |
87 | .dt_compat = omap243x_boards_compat, | 87 | .dt_compat = omap243x_boards_compat, |
88 | .restart = omap2xxx_restart, | 88 | .restart = omap2xxx_restart, |
89 | MACHINE_END | 89 | MACHINE_END |
@@ -102,7 +102,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") | |||
102 | .init_irq = omap_intc_of_init, | 102 | .init_irq = omap_intc_of_init, |
103 | .handle_irq = omap3_intc_handle_irq, | 103 | .handle_irq = omap3_intc_handle_irq, |
104 | .init_machine = omap_generic_init, | 104 | .init_machine = omap_generic_init, |
105 | .timer = &omap3_timer, | 105 | .init_time = omap3_sync32k_timer_init, |
106 | .dt_compat = omap3_boards_compat, | 106 | .dt_compat = omap3_boards_compat, |
107 | .restart = omap3xxx_restart, | 107 | .restart = omap3xxx_restart, |
108 | MACHINE_END | 108 | MACHINE_END |
@@ -119,7 +119,7 @@ DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)") | |||
119 | .init_irq = omap_intc_of_init, | 119 | .init_irq = omap_intc_of_init, |
120 | .handle_irq = omap3_intc_handle_irq, | 120 | .handle_irq = omap3_intc_handle_irq, |
121 | .init_machine = omap_generic_init, | 121 | .init_machine = omap_generic_init, |
122 | .timer = &omap3_secure_timer, | 122 | .init_time = omap3_secure_sync32k_timer_init, |
123 | .dt_compat = omap3_gp_boards_compat, | 123 | .dt_compat = omap3_gp_boards_compat, |
124 | .restart = omap3xxx_restart, | 124 | .restart = omap3xxx_restart, |
125 | MACHINE_END | 125 | MACHINE_END |
@@ -138,7 +138,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)") | |||
138 | .init_irq = omap_intc_of_init, | 138 | .init_irq = omap_intc_of_init, |
139 | .handle_irq = omap3_intc_handle_irq, | 139 | .handle_irq = omap3_intc_handle_irq, |
140 | .init_machine = omap_generic_init, | 140 | .init_machine = omap_generic_init, |
141 | .timer = &omap3_am33xx_timer, | 141 | .init_time = omap3_am33xx_gptimer_timer_init, |
142 | .dt_compat = am33xx_boards_compat, | 142 | .dt_compat = am33xx_boards_compat, |
143 | MACHINE_END | 143 | MACHINE_END |
144 | #endif | 144 | #endif |
@@ -157,7 +157,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") | |||
157 | .init_irq = omap_gic_of_init, | 157 | .init_irq = omap_gic_of_init, |
158 | .init_machine = omap_generic_init, | 158 | .init_machine = omap_generic_init, |
159 | .init_late = omap4430_init_late, | 159 | .init_late = omap4430_init_late, |
160 | .timer = &omap4_timer, | 160 | .init_time = omap4_local_timer_init, |
161 | .dt_compat = omap4_boards_compat, | 161 | .dt_compat = omap4_boards_compat, |
162 | .restart = omap44xx_restart, | 162 | .restart = omap44xx_restart, |
163 | MACHINE_END | 163 | MACHINE_END |
@@ -176,7 +176,7 @@ DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") | |||
176 | .init_early = omap5_init_early, | 176 | .init_early = omap5_init_early, |
177 | .init_irq = omap_gic_of_init, | 177 | .init_irq = omap_gic_of_init, |
178 | .init_machine = omap_generic_init, | 178 | .init_machine = omap_generic_init, |
179 | .timer = &omap5_timer, | 179 | .init_time = omap5_realtime_timer_init, |
180 | .dt_compat = omap5_boards_compat, | 180 | .dt_compat = omap5_boards_compat, |
181 | .restart = omap44xx_restart, | 181 | .restart = omap44xx_restart, |
182 | MACHINE_END | 182 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 3be1311f9e33..812c829fa46f 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -342,6 +342,6 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board") | |||
342 | .handle_irq = omap2_intc_handle_irq, | 342 | .handle_irq = omap2_intc_handle_irq, |
343 | .init_machine = omap_h4_init, | 343 | .init_machine = omap_h4_init, |
344 | .init_late = omap2420_init_late, | 344 | .init_late = omap2420_init_late, |
345 | .timer = &omap2_timer, | 345 | .init_time = omap2_sync32k_timer_init, |
346 | .restart = omap2xxx_restart, | 346 | .restart = omap2xxx_restart, |
347 | MACHINE_END | 347 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 0f24cb84ba5a..5b447649f5a0 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -655,7 +655,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board") | |||
655 | .handle_irq = omap3_intc_handle_irq, | 655 | .handle_irq = omap3_intc_handle_irq, |
656 | .init_machine = igep_init, | 656 | .init_machine = igep_init, |
657 | .init_late = omap35xx_init_late, | 657 | .init_late = omap35xx_init_late, |
658 | .timer = &omap3_timer, | 658 | .init_time = omap3_sync32k_timer_init, |
659 | .restart = omap3xxx_restart, | 659 | .restart = omap3xxx_restart, |
660 | MACHINE_END | 660 | MACHINE_END |
661 | 661 | ||
@@ -668,6 +668,6 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module") | |||
668 | .handle_irq = omap3_intc_handle_irq, | 668 | .handle_irq = omap3_intc_handle_irq, |
669 | .init_machine = igep_init, | 669 | .init_machine = igep_init, |
670 | .init_late = omap35xx_init_late, | 670 | .init_late = omap35xx_init_late, |
671 | .timer = &omap3_timer, | 671 | .init_time = omap3_sync32k_timer_init, |
672 | .restart = omap3xxx_restart, | 672 | .restart = omap3xxx_restart, |
673 | MACHINE_END | 673 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 0869f4f3d3e1..ff440c0d04dd 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -435,6 +435,6 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board") | |||
435 | .handle_irq = omap3_intc_handle_irq, | 435 | .handle_irq = omap3_intc_handle_irq, |
436 | .init_machine = omap_ldp_init, | 436 | .init_machine = omap_ldp_init, |
437 | .init_late = omap3430_init_late, | 437 | .init_late = omap3430_init_late, |
438 | .timer = &omap3_timer, | 438 | .init_time = omap3_sync32k_timer_init, |
439 | .restart = omap3xxx_restart, | 439 | .restart = omap3xxx_restart, |
440 | MACHINE_END | 440 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 0abb30fe399c..f6eeb87e4e95 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
@@ -731,7 +731,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800") | |||
731 | .handle_irq = omap2_intc_handle_irq, | 731 | .handle_irq = omap2_intc_handle_irq, |
732 | .init_machine = n8x0_init_machine, | 732 | .init_machine = n8x0_init_machine, |
733 | .init_late = omap2420_init_late, | 733 | .init_late = omap2420_init_late, |
734 | .timer = &omap2_timer, | 734 | .init_time = omap2_sync32k_timer_init, |
735 | .restart = omap2xxx_restart, | 735 | .restart = omap2xxx_restart, |
736 | MACHINE_END | 736 | MACHINE_END |
737 | 737 | ||
@@ -744,7 +744,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810") | |||
744 | .handle_irq = omap2_intc_handle_irq, | 744 | .handle_irq = omap2_intc_handle_irq, |
745 | .init_machine = n8x0_init_machine, | 745 | .init_machine = n8x0_init_machine, |
746 | .init_late = omap2420_init_late, | 746 | .init_late = omap2420_init_late, |
747 | .timer = &omap2_timer, | 747 | .init_time = omap2_sync32k_timer_init, |
748 | .restart = omap2xxx_restart, | 748 | .restart = omap2xxx_restart, |
749 | MACHINE_END | 749 | MACHINE_END |
750 | 750 | ||
@@ -757,6 +757,6 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") | |||
757 | .handle_irq = omap2_intc_handle_irq, | 757 | .handle_irq = omap2_intc_handle_irq, |
758 | .init_machine = n8x0_init_machine, | 758 | .init_machine = n8x0_init_machine, |
759 | .init_late = omap2420_init_late, | 759 | .init_late = omap2420_init_late, |
760 | .timer = &omap2_timer, | 760 | .init_time = omap2_sync32k_timer_init, |
761 | .restart = omap2xxx_restart, | 761 | .restart = omap2xxx_restart, |
762 | MACHINE_END | 762 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 22c483d5dfa8..b81b4585f46f 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -544,6 +544,6 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | |||
544 | .handle_irq = omap3_intc_handle_irq, | 544 | .handle_irq = omap3_intc_handle_irq, |
545 | .init_machine = omap3_beagle_init, | 545 | .init_machine = omap3_beagle_init, |
546 | .init_late = omap3_init_late, | 546 | .init_late = omap3_init_late, |
547 | .timer = &omap3_secure_timer, | 547 | .init_time = omap3_secure_sync32k_timer_init, |
548 | .restart = omap3xxx_restart, | 548 | .restart = omap3xxx_restart, |
549 | MACHINE_END | 549 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 3985f35aee06..f2f636b19762 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -757,6 +757,6 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM") | |||
757 | .handle_irq = omap3_intc_handle_irq, | 757 | .handle_irq = omap3_intc_handle_irq, |
758 | .init_machine = omap3_evm_init, | 758 | .init_machine = omap3_evm_init, |
759 | .init_late = omap35xx_init_late, | 759 | .init_late = omap35xx_init_late, |
760 | .timer = &omap3_timer, | 760 | .init_time = omap3_sync32k_timer_init, |
761 | .restart = omap3xxx_restart, | 761 | .restart = omap3xxx_restart, |
762 | MACHINE_END | 762 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c index 2a065ba6eb58..0fba43a9b07d 100644 --- a/arch/arm/mach-omap2/board-omap3logic.c +++ b/arch/arm/mach-omap2/board-omap3logic.c | |||
@@ -231,7 +231,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") | |||
231 | .handle_irq = omap3_intc_handle_irq, | 231 | .handle_irq = omap3_intc_handle_irq, |
232 | .init_machine = omap3logic_init, | 232 | .init_machine = omap3logic_init, |
233 | .init_late = omap35xx_init_late, | 233 | .init_late = omap35xx_init_late, |
234 | .timer = &omap3_timer, | 234 | .init_time = omap3_sync32k_timer_init, |
235 | .restart = omap3xxx_restart, | 235 | .restart = omap3xxx_restart, |
236 | MACHINE_END | 236 | MACHINE_END |
237 | 237 | ||
@@ -244,6 +244,6 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") | |||
244 | .handle_irq = omap3_intc_handle_irq, | 244 | .handle_irq = omap3_intc_handle_irq, |
245 | .init_machine = omap3logic_init, | 245 | .init_machine = omap3logic_init, |
246 | .init_late = omap35xx_init_late, | 246 | .init_late = omap35xx_init_late, |
247 | .timer = &omap3_timer, | 247 | .init_time = omap3_sync32k_timer_init, |
248 | .restart = omap3xxx_restart, | 248 | .restart = omap3xxx_restart, |
249 | MACHINE_END | 249 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index a53a6683c1b8..12e181689340 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -618,6 +618,6 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") | |||
618 | .handle_irq = omap3_intc_handle_irq, | 618 | .handle_irq = omap3_intc_handle_irq, |
619 | .init_machine = omap3pandora_init, | 619 | .init_machine = omap3pandora_init, |
620 | .init_late = omap35xx_init_late, | 620 | .init_late = omap35xx_init_late, |
621 | .timer = &omap3_timer, | 621 | .init_time = omap3_sync32k_timer_init, |
622 | .restart = omap3xxx_restart, | 622 | .restart = omap3xxx_restart, |
623 | MACHINE_END | 623 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index 53a6cbcf9747..13ee40545604 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
@@ -427,6 +427,6 @@ MACHINE_START(SBC3530, "OMAP3 STALKER") | |||
427 | .handle_irq = omap3_intc_handle_irq, | 427 | .handle_irq = omap3_intc_handle_irq, |
428 | .init_machine = omap3_stalker_init, | 428 | .init_machine = omap3_stalker_init, |
429 | .init_late = omap35xx_init_late, | 429 | .init_late = omap35xx_init_late, |
430 | .timer = &omap3_secure_timer, | 430 | .init_time = omap3_secure_sync32k_timer_init, |
431 | .restart = omap3xxx_restart, | 431 | .restart = omap3xxx_restart, |
432 | MACHINE_END | 432 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 263cb9cfbf37..36c455c85ed9 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -386,6 +386,6 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") | |||
386 | .handle_irq = omap3_intc_handle_irq, | 386 | .handle_irq = omap3_intc_handle_irq, |
387 | .init_machine = omap3_touchbook_init, | 387 | .init_machine = omap3_touchbook_init, |
388 | .init_late = omap3430_init_late, | 388 | .init_late = omap3430_init_late, |
389 | .timer = &omap3_secure_timer, | 389 | .init_time = omap3_secure_sync32k_timer_init, |
390 | .restart = omap3xxx_restart, | 390 | .restart = omap3xxx_restart, |
391 | MACHINE_END | 391 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index e9270b3e44c7..b62317906b39 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -461,6 +461,6 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") | |||
461 | .init_irq = gic_init_irq, | 461 | .init_irq = gic_init_irq, |
462 | .init_machine = omap4_panda_init, | 462 | .init_machine = omap4_panda_init, |
463 | .init_late = omap4430_init_late, | 463 | .init_late = omap4430_init_late, |
464 | .timer = &omap4_timer, | 464 | .init_time = omap4_local_timer_init, |
465 | .restart = omap44xx_restart, | 465 | .restart = omap44xx_restart, |
466 | MACHINE_END | 466 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index c8fde3e56441..233a37d541c3 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -551,6 +551,6 @@ MACHINE_START(OVERO, "Gumstix Overo") | |||
551 | .handle_irq = omap3_intc_handle_irq, | 551 | .handle_irq = omap3_intc_handle_irq, |
552 | .init_machine = overo_init, | 552 | .init_machine = overo_init, |
553 | .init_late = omap35xx_init_late, | 553 | .init_late = omap35xx_init_late, |
554 | .timer = &omap3_timer, | 554 | .init_time = omap3_sync32k_timer_init, |
555 | .restart = omap3xxx_restart, | 555 | .restart = omap3xxx_restart, |
556 | MACHINE_END | 556 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c index 0c777b75e484..386a2ddc1173 100644 --- a/arch/arm/mach-omap2/board-rm680.c +++ b/arch/arm/mach-omap2/board-rm680.c | |||
@@ -147,7 +147,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board") | |||
147 | .handle_irq = omap3_intc_handle_irq, | 147 | .handle_irq = omap3_intc_handle_irq, |
148 | .init_machine = rm680_init, | 148 | .init_machine = rm680_init, |
149 | .init_late = omap3630_init_late, | 149 | .init_late = omap3630_init_late, |
150 | .timer = &omap3_timer, | 150 | .init_time = omap3_sync32k_timer_init, |
151 | .restart = omap3xxx_restart, | 151 | .restart = omap3xxx_restart, |
152 | MACHINE_END | 152 | MACHINE_END |
153 | 153 | ||
@@ -160,6 +160,6 @@ MACHINE_START(NOKIA_RM696, "Nokia RM-696 board") | |||
160 | .handle_irq = omap3_intc_handle_irq, | 160 | .handle_irq = omap3_intc_handle_irq, |
161 | .init_machine = rm680_init, | 161 | .init_machine = rm680_init, |
162 | .init_late = omap3630_init_late, | 162 | .init_late = omap3630_init_late, |
163 | .timer = &omap3_timer, | 163 | .init_time = omap3_sync32k_timer_init, |
164 | .restart = omap3xxx_restart, | 164 | .restart = omap3xxx_restart, |
165 | MACHINE_END | 165 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index d0374ea2dfb0..f7c4616cbb60 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c | |||
@@ -123,6 +123,6 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") | |||
123 | .handle_irq = omap3_intc_handle_irq, | 123 | .handle_irq = omap3_intc_handle_irq, |
124 | .init_machine = rx51_init, | 124 | .init_machine = rx51_init, |
125 | .init_late = omap3430_init_late, | 125 | .init_late = omap3430_init_late, |
126 | .timer = &omap3_timer, | 126 | .init_time = omap3_sync32k_timer_init, |
127 | .restart = omap3xxx_restart, | 127 | .restart = omap3xxx_restart, |
128 | MACHINE_END | 128 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c index 1a3e056d63a7..6273c286e1d8 100644 --- a/arch/arm/mach-omap2/board-ti8168evm.c +++ b/arch/arm/mach-omap2/board-ti8168evm.c | |||
@@ -43,7 +43,7 @@ MACHINE_START(TI8168EVM, "ti8168evm") | |||
43 | .map_io = ti81xx_map_io, | 43 | .map_io = ti81xx_map_io, |
44 | .init_early = ti81xx_init_early, | 44 | .init_early = ti81xx_init_early, |
45 | .init_irq = ti81xx_init_irq, | 45 | .init_irq = ti81xx_init_irq, |
46 | .timer = &omap3_timer, | 46 | .init_time = omap3_sync32k_timer_init, |
47 | .init_machine = ti81xx_evm_init, | 47 | .init_machine = ti81xx_evm_init, |
48 | .init_late = ti81xx_init_late, | 48 | .init_late = ti81xx_init_late, |
49 | .restart = omap44xx_restart, | 49 | .restart = omap44xx_restart, |
@@ -55,7 +55,7 @@ MACHINE_START(TI8148EVM, "ti8148evm") | |||
55 | .map_io = ti81xx_map_io, | 55 | .map_io = ti81xx_map_io, |
56 | .init_early = ti81xx_init_early, | 56 | .init_early = ti81xx_init_early, |
57 | .init_irq = ti81xx_init_irq, | 57 | .init_irq = ti81xx_init_irq, |
58 | .timer = &omap3_timer, | 58 | .init_time = omap3_sync32k_timer_init, |
59 | .init_machine = ti81xx_evm_init, | 59 | .init_machine = ti81xx_evm_init, |
60 | .init_late = ti81xx_init_late, | 60 | .init_late = ti81xx_init_late, |
61 | .restart = omap44xx_restart, | 61 | .restart = omap44xx_restart, |
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c index d7fa31e67238..d257cf1e0abe 100644 --- a/arch/arm/mach-omap2/board-zoom.c +++ b/arch/arm/mach-omap2/board-zoom.c | |||
@@ -137,7 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") | |||
137 | .handle_irq = omap3_intc_handle_irq, | 137 | .handle_irq = omap3_intc_handle_irq, |
138 | .init_machine = omap_zoom_init, | 138 | .init_machine = omap_zoom_init, |
139 | .init_late = omap3430_init_late, | 139 | .init_late = omap3430_init_late, |
140 | .timer = &omap3_timer, | 140 | .init_time = omap3_sync32k_timer_init, |
141 | .restart = omap3xxx_restart, | 141 | .restart = omap3xxx_restart, |
142 | MACHINE_END | 142 | MACHINE_END |
143 | 143 | ||
@@ -150,6 +150,6 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") | |||
150 | .handle_irq = omap3_intc_handle_irq, | 150 | .handle_irq = omap3_intc_handle_irq, |
151 | .init_machine = omap_zoom_init, | 151 | .init_machine = omap_zoom_init, |
152 | .init_late = omap3630_init_late, | 152 | .init_late = omap3630_init_late, |
153 | .timer = &omap3_timer, | 153 | .init_time = omap3_sync32k_timer_init, |
154 | .restart = omap3xxx_restart, | 154 | .restart = omap3xxx_restart, |
155 | MACHINE_END | 155 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 948bcaa82eb6..b4350274361b 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -79,13 +79,13 @@ static inline int omap_mux_late_init(void) | |||
79 | 79 | ||
80 | extern void omap2_init_common_infrastructure(void); | 80 | extern void omap2_init_common_infrastructure(void); |
81 | 81 | ||
82 | extern struct sys_timer omap2_timer; | 82 | extern void omap2_sync32k_timer_init(void); |
83 | extern struct sys_timer omap3_timer; | 83 | extern void omap3_sync32k_timer_init(void); |
84 | extern struct sys_timer omap3_secure_timer; | 84 | extern void omap3_secure_sync32k_timer_init(void); |
85 | extern struct sys_timer omap3_gp_timer; | 85 | extern void omap3_gp_gptimer_timer_init(void); |
86 | extern struct sys_timer omap3_am33xx_timer; | 86 | extern void omap3_am33xx_gptimer_timer_init(void); |
87 | extern struct sys_timer omap4_timer; | 87 | extern void omap4_local_timer_init(void); |
88 | extern struct sys_timer omap5_timer; | 88 | extern void omap5_realtime_timer_init(void); |
89 | 89 | ||
90 | void omap2420_init_early(void); | 90 | void omap2420_init_early(void); |
91 | void omap2430_init_early(void); | 91 | void omap2430_init_early(void); |
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index b8ad6e632bb8..d86074745c50 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -131,7 +131,6 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode, | |||
131 | static struct clock_event_device clockevent_gpt = { | 131 | static struct clock_event_device clockevent_gpt = { |
132 | .name = "gp_timer", | 132 | .name = "gp_timer", |
133 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 133 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
134 | .shift = 32, | ||
135 | .rating = 300, | 134 | .rating = 300, |
136 | .set_next_event = omap2_gp_timer_set_next_event, | 135 | .set_next_event = omap2_gp_timer_set_next_event, |
137 | .set_mode = omap2_gp_timer_set_mode, | 136 | .set_mode = omap2_gp_timer_set_mode, |
@@ -336,17 +335,11 @@ static void __init omap2_gp_clockevent_init(int gptimer_id, | |||
336 | 335 | ||
337 | __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW); | 336 | __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW); |
338 | 337 | ||
339 | clockevent_gpt.mult = div_sc(clkev.rate, NSEC_PER_SEC, | ||
340 | clockevent_gpt.shift); | ||
341 | clockevent_gpt.max_delta_ns = | ||
342 | clockevent_delta2ns(0xffffffff, &clockevent_gpt); | ||
343 | clockevent_gpt.min_delta_ns = | ||
344 | clockevent_delta2ns(3, &clockevent_gpt); | ||
345 | /* Timer internal resynch latency. */ | ||
346 | |||
347 | clockevent_gpt.cpumask = cpu_possible_mask; | 338 | clockevent_gpt.cpumask = cpu_possible_mask; |
348 | clockevent_gpt.irq = omap_dm_timer_get_irq(&clkev); | 339 | clockevent_gpt.irq = omap_dm_timer_get_irq(&clkev); |
349 | clockevents_register_device(&clockevent_gpt); | 340 | clockevents_config_and_register(&clockevent_gpt, clkev.rate, |
341 | 3, /* Timer internal resynch latency */ | ||
342 | 0xffffffff); | ||
350 | 343 | ||
351 | pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n", | 344 | pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n", |
352 | gptimer_id, clkev.rate); | 345 | gptimer_id, clkev.rate); |
@@ -552,7 +545,7 @@ static inline void __init realtime_counter_init(void) | |||
552 | 545 | ||
553 | #define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ | 546 | #define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ |
554 | clksrc_nr, clksrc_src) \ | 547 | clksrc_nr, clksrc_src) \ |
555 | static void __init omap##name##_gptimer_timer_init(void) \ | 548 | void __init omap##name##_gptimer_timer_init(void) \ |
556 | { \ | 549 | { \ |
557 | omap_dmtimer_init(); \ | 550 | omap_dmtimer_init(); \ |
558 | omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ | 551 | omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ |
@@ -561,7 +554,7 @@ static void __init omap##name##_gptimer_timer_init(void) \ | |||
561 | 554 | ||
562 | #define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ | 555 | #define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ |
563 | clksrc_nr, clksrc_src) \ | 556 | clksrc_nr, clksrc_src) \ |
564 | static void __init omap##name##_sync32k_timer_init(void) \ | 557 | void __init omap##name##_sync32k_timer_init(void) \ |
565 | { \ | 558 | { \ |
566 | omap_dmtimer_init(); \ | 559 | omap_dmtimer_init(); \ |
567 | omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ | 560 | omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ |
@@ -572,33 +565,23 @@ static void __init omap##name##_sync32k_timer_init(void) \ | |||
572 | omap2_sync32k_clocksource_init(); \ | 565 | omap2_sync32k_clocksource_init(); \ |
573 | } | 566 | } |
574 | 567 | ||
575 | #define OMAP_SYS_TIMER(name, clksrc) \ | ||
576 | struct sys_timer omap##name##_timer = { \ | ||
577 | .init = omap##name##_##clksrc##_timer_init, \ | ||
578 | }; | ||
579 | |||
580 | #ifdef CONFIG_ARCH_OMAP2 | 568 | #ifdef CONFIG_ARCH_OMAP2 |
581 | OMAP_SYS_32K_TIMER_INIT(2, 1, OMAP2_32K_SOURCE, "ti,timer-alwon", | 569 | OMAP_SYS_32K_TIMER_INIT(2, 1, OMAP2_32K_SOURCE, "ti,timer-alwon", |
582 | 2, OMAP2_MPU_SOURCE); | 570 | 2, OMAP2_MPU_SOURCE); |
583 | OMAP_SYS_TIMER(2, sync32k); | ||
584 | #endif /* CONFIG_ARCH_OMAP2 */ | 571 | #endif /* CONFIG_ARCH_OMAP2 */ |
585 | 572 | ||
586 | #ifdef CONFIG_ARCH_OMAP3 | 573 | #ifdef CONFIG_ARCH_OMAP3 |
587 | OMAP_SYS_32K_TIMER_INIT(3, 1, OMAP3_32K_SOURCE, "ti,timer-alwon", | 574 | OMAP_SYS_32K_TIMER_INIT(3, 1, OMAP3_32K_SOURCE, "ti,timer-alwon", |
588 | 2, OMAP3_MPU_SOURCE); | 575 | 2, OMAP3_MPU_SOURCE); |
589 | OMAP_SYS_TIMER(3, sync32k); | ||
590 | OMAP_SYS_32K_TIMER_INIT(3_secure, 12, OMAP3_32K_SOURCE, "ti,timer-secure", | 576 | OMAP_SYS_32K_TIMER_INIT(3_secure, 12, OMAP3_32K_SOURCE, "ti,timer-secure", |
591 | 2, OMAP3_MPU_SOURCE); | 577 | 2, OMAP3_MPU_SOURCE); |
592 | OMAP_SYS_TIMER(3_secure, sync32k); | ||
593 | OMAP_SYS_GP_TIMER_INIT(3_gp, 1, OMAP3_MPU_SOURCE, "ti,timer-alwon", | 578 | OMAP_SYS_GP_TIMER_INIT(3_gp, 1, OMAP3_MPU_SOURCE, "ti,timer-alwon", |
594 | 2, OMAP3_MPU_SOURCE); | 579 | 2, OMAP3_MPU_SOURCE); |
595 | OMAP_SYS_TIMER(3_gp, gptimer); | ||
596 | #endif /* CONFIG_ARCH_OMAP3 */ | 580 | #endif /* CONFIG_ARCH_OMAP3 */ |
597 | 581 | ||
598 | #ifdef CONFIG_SOC_AM33XX | 582 | #ifdef CONFIG_SOC_AM33XX |
599 | OMAP_SYS_GP_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon", | 583 | OMAP_SYS_GP_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon", |
600 | 2, OMAP4_MPU_SOURCE); | 584 | 2, OMAP4_MPU_SOURCE); |
601 | OMAP_SYS_TIMER(3_am33xx, gptimer); | ||
602 | #endif /* CONFIG_SOC_AM33XX */ | 585 | #endif /* CONFIG_SOC_AM33XX */ |
603 | 586 | ||
604 | #ifdef CONFIG_ARCH_OMAP4 | 587 | #ifdef CONFIG_ARCH_OMAP4 |
@@ -606,7 +589,7 @@ OMAP_SYS_32K_TIMER_INIT(4, 1, OMAP4_32K_SOURCE, "ti,timer-alwon", | |||
606 | 2, OMAP4_MPU_SOURCE); | 589 | 2, OMAP4_MPU_SOURCE); |
607 | #ifdef CONFIG_LOCAL_TIMERS | 590 | #ifdef CONFIG_LOCAL_TIMERS |
608 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29); | 591 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29); |
609 | static void __init omap4_local_timer_init(void) | 592 | void __init omap4_local_timer_init(void) |
610 | { | 593 | { |
611 | omap4_sync32k_timer_init(); | 594 | omap4_sync32k_timer_init(); |
612 | /* Local timers are not supprted on OMAP4430 ES1.0 */ | 595 | /* Local timers are not supprted on OMAP4430 ES1.0 */ |
@@ -624,18 +607,17 @@ static void __init omap4_local_timer_init(void) | |||
624 | } | 607 | } |
625 | } | 608 | } |
626 | #else /* CONFIG_LOCAL_TIMERS */ | 609 | #else /* CONFIG_LOCAL_TIMERS */ |
627 | static void __init omap4_local_timer_init(void) | 610 | void __init omap4_local_timer_init(void) |
628 | { | 611 | { |
629 | omap4_sync32k_timer_init(); | 612 | omap4_sync32k_timer_init(); |
630 | } | 613 | } |
631 | #endif /* CONFIG_LOCAL_TIMERS */ | 614 | #endif /* CONFIG_LOCAL_TIMERS */ |
632 | OMAP_SYS_TIMER(4, local); | ||
633 | #endif /* CONFIG_ARCH_OMAP4 */ | 615 | #endif /* CONFIG_ARCH_OMAP4 */ |
634 | 616 | ||
635 | #ifdef CONFIG_SOC_OMAP5 | 617 | #ifdef CONFIG_SOC_OMAP5 |
636 | OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon", | 618 | OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon", |
637 | 2, OMAP4_MPU_SOURCE); | 619 | 2, OMAP4_MPU_SOURCE); |
638 | static void __init omap5_realtime_timer_init(void) | 620 | void __init omap5_realtime_timer_init(void) |
639 | { | 621 | { |
640 | int err; | 622 | int err; |
641 | 623 | ||
@@ -646,7 +628,6 @@ static void __init omap5_realtime_timer_init(void) | |||
646 | if (err) | 628 | if (err) |
647 | pr_err("%s: arch_timer_register failed %d\n", __func__, err); | 629 | pr_err("%s: arch_timer_register failed %d\n", __func__, err); |
648 | } | 630 | } |
649 | OMAP_SYS_TIMER(5, realtime); | ||
650 | #endif /* CONFIG_SOC_OMAP5 */ | 631 | #endif /* CONFIG_SOC_OMAP5 */ |
651 | 632 | ||
652 | /** | 633 | /** |
diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c index 32e5c211a89b..35a8014529ca 100644 --- a/arch/arm/mach-orion5x/board-dt.c +++ b/arch/arm/mach-orion5x/board-dt.c | |||
@@ -72,7 +72,7 @@ DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)") | |||
72 | .map_io = orion5x_map_io, | 72 | .map_io = orion5x_map_io, |
73 | .init_early = orion5x_init_early, | 73 | .init_early = orion5x_init_early, |
74 | .init_irq = orion_dt_init_irq, | 74 | .init_irq = orion_dt_init_irq, |
75 | .timer = &orion5x_timer, | 75 | .init_time = orion5x_timer_init, |
76 | .init_machine = orion5x_dt_init, | 76 | .init_machine = orion5x_dt_init, |
77 | .restart = orion5x_restart, | 77 | .restart = orion5x_restart, |
78 | .dt_compat = orion5x_dt_compat, | 78 | .dt_compat = orion5x_dt_compat, |
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index 550f92320afb..d068f1431c40 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -217,7 +217,7 @@ int __init orion5x_find_tclk(void) | |||
217 | return 166666667; | 217 | return 166666667; |
218 | } | 218 | } |
219 | 219 | ||
220 | static void __init orion5x_timer_init(void) | 220 | void __init orion5x_timer_init(void) |
221 | { | 221 | { |
222 | orion5x_tclk = orion5x_find_tclk(); | 222 | orion5x_tclk = orion5x_find_tclk(); |
223 | 223 | ||
@@ -225,10 +225,6 @@ static void __init orion5x_timer_init(void) | |||
225 | IRQ_ORION5X_BRIDGE, orion5x_tclk); | 225 | IRQ_ORION5X_BRIDGE, orion5x_tclk); |
226 | } | 226 | } |
227 | 227 | ||
228 | struct sys_timer orion5x_timer = { | ||
229 | .init = orion5x_timer_init, | ||
230 | }; | ||
231 | |||
232 | 228 | ||
233 | /***************************************************************************** | 229 | /***************************************************************************** |
234 | * General | 230 | * General |
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index 7db5cdd9c4b7..e60345760283 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h | |||
@@ -15,7 +15,7 @@ void orion5x_init(void); | |||
15 | void orion5x_id(u32 *dev, u32 *rev, char **dev_name); | 15 | void orion5x_id(u32 *dev, u32 *rev, char **dev_name); |
16 | void clk_init(void); | 16 | void clk_init(void); |
17 | extern int orion5x_tclk; | 17 | extern int orion5x_tclk; |
18 | extern struct sys_timer orion5x_timer; | 18 | extern void orion5x_timer_init(void); |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * Enumerations and functions for Orion windows mapping. Used by Orion core | 21 | * Enumerations and functions for Orion windows mapping. Used by Orion core |
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c index e3629c063df2..57d0af74874d 100644 --- a/arch/arm/mach-orion5x/d2net-setup.c +++ b/arch/arm/mach-orion5x/d2net-setup.c | |||
@@ -342,7 +342,7 @@ MACHINE_START(D2NET, "LaCie d2 Network") | |||
342 | .map_io = orion5x_map_io, | 342 | .map_io = orion5x_map_io, |
343 | .init_early = orion5x_init_early, | 343 | .init_early = orion5x_init_early, |
344 | .init_irq = orion5x_init_irq, | 344 | .init_irq = orion5x_init_irq, |
345 | .timer = &orion5x_timer, | 345 | .init_time = orion5x_timer_init, |
346 | .fixup = tag_fixup_mem32, | 346 | .fixup = tag_fixup_mem32, |
347 | .restart = orion5x_restart, | 347 | .restart = orion5x_restart, |
348 | MACHINE_END | 348 | MACHINE_END |
@@ -355,7 +355,7 @@ MACHINE_START(BIGDISK, "LaCie Big Disk Network") | |||
355 | .map_io = orion5x_map_io, | 355 | .map_io = orion5x_map_io, |
356 | .init_early = orion5x_init_early, | 356 | .init_early = orion5x_init_early, |
357 | .init_irq = orion5x_init_irq, | 357 | .init_irq = orion5x_init_irq, |
358 | .timer = &orion5x_timer, | 358 | .init_time = orion5x_timer_init, |
359 | .fixup = tag_fixup_mem32, | 359 | .fixup = tag_fixup_mem32, |
360 | .restart = orion5x_restart, | 360 | .restart = orion5x_restart, |
361 | MACHINE_END | 361 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c index 41fe2b1ff47c..76665640087b 100644 --- a/arch/arm/mach-orion5x/db88f5281-setup.c +++ b/arch/arm/mach-orion5x/db88f5281-setup.c | |||
@@ -362,6 +362,6 @@ MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board") | |||
362 | .map_io = orion5x_map_io, | 362 | .map_io = orion5x_map_io, |
363 | .init_early = orion5x_init_early, | 363 | .init_early = orion5x_init_early, |
364 | .init_irq = orion5x_init_irq, | 364 | .init_irq = orion5x_init_irq, |
365 | .timer = &orion5x_timer, | 365 | .init_time = orion5x_timer_init, |
366 | .restart = orion5x_restart, | 366 | .restart = orion5x_restart, |
367 | MACHINE_END | 367 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index e533588880ff..6eb1732757fd 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c | |||
@@ -714,7 +714,7 @@ MACHINE_START(DNS323, "D-Link DNS-323") | |||
714 | .map_io = orion5x_map_io, | 714 | .map_io = orion5x_map_io, |
715 | .init_early = orion5x_init_early, | 715 | .init_early = orion5x_init_early, |
716 | .init_irq = orion5x_init_irq, | 716 | .init_irq = orion5x_init_irq, |
717 | .timer = &orion5x_timer, | 717 | .init_time = orion5x_timer_init, |
718 | .fixup = tag_fixup_mem32, | 718 | .fixup = tag_fixup_mem32, |
719 | .restart = orion5x_restart, | 719 | .restart = orion5x_restart, |
720 | MACHINE_END | 720 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c index f1ae10ae5bd4..b98403526218 100644 --- a/arch/arm/mach-orion5x/kurobox_pro-setup.c +++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c | |||
@@ -383,7 +383,7 @@ MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro") | |||
383 | .map_io = orion5x_map_io, | 383 | .map_io = orion5x_map_io, |
384 | .init_early = orion5x_init_early, | 384 | .init_early = orion5x_init_early, |
385 | .init_irq = orion5x_init_irq, | 385 | .init_irq = orion5x_init_irq, |
386 | .timer = &orion5x_timer, | 386 | .init_time = orion5x_timer_init, |
387 | .fixup = tag_fixup_mem32, | 387 | .fixup = tag_fixup_mem32, |
388 | .restart = orion5x_restart, | 388 | .restart = orion5x_restart, |
389 | MACHINE_END | 389 | MACHINE_END |
@@ -397,7 +397,7 @@ MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live") | |||
397 | .map_io = orion5x_map_io, | 397 | .map_io = orion5x_map_io, |
398 | .init_early = orion5x_init_early, | 398 | .init_early = orion5x_init_early, |
399 | .init_irq = orion5x_init_irq, | 399 | .init_irq = orion5x_init_irq, |
400 | .timer = &orion5x_timer, | 400 | .init_time = orion5x_timer_init, |
401 | .fixup = tag_fixup_mem32, | 401 | .fixup = tag_fixup_mem32, |
402 | .restart = orion5x_restart, | 402 | .restart = orion5x_restart, |
403 | MACHINE_END | 403 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c index 0c9e413b5805..044da5b6a6ae 100644 --- a/arch/arm/mach-orion5x/ls-chl-setup.c +++ b/arch/arm/mach-orion5x/ls-chl-setup.c | |||
@@ -322,7 +322,7 @@ MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)") | |||
322 | .map_io = orion5x_map_io, | 322 | .map_io = orion5x_map_io, |
323 | .init_early = orion5x_init_early, | 323 | .init_early = orion5x_init_early, |
324 | .init_irq = orion5x_init_irq, | 324 | .init_irq = orion5x_init_irq, |
325 | .timer = &orion5x_timer, | 325 | .init_time = orion5x_timer_init, |
326 | .fixup = tag_fixup_mem32, | 326 | .fixup = tag_fixup_mem32, |
327 | .restart = orion5x_restart, | 327 | .restart = orion5x_restart, |
328 | MACHINE_END | 328 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/ls_hgl-setup.c b/arch/arm/mach-orion5x/ls_hgl-setup.c index c1b5d8a58037..d49f93423f52 100644 --- a/arch/arm/mach-orion5x/ls_hgl-setup.c +++ b/arch/arm/mach-orion5x/ls_hgl-setup.c | |||
@@ -269,7 +269,7 @@ MACHINE_START(LINKSTATION_LS_HGL, "Buffalo Linkstation LS-HGL") | |||
269 | .map_io = orion5x_map_io, | 269 | .map_io = orion5x_map_io, |
270 | .init_early = orion5x_init_early, | 270 | .init_early = orion5x_init_early, |
271 | .init_irq = orion5x_init_irq, | 271 | .init_irq = orion5x_init_irq, |
272 | .timer = &orion5x_timer, | 272 | .init_time = orion5x_timer_init, |
273 | .fixup = tag_fixup_mem32, | 273 | .fixup = tag_fixup_mem32, |
274 | .restart = orion5x_restart, | 274 | .restart = orion5x_restart, |
275 | MACHINE_END | 275 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c index 949eaa8f12e3..8e3965c6c0fe 100644 --- a/arch/arm/mach-orion5x/lsmini-setup.c +++ b/arch/arm/mach-orion5x/lsmini-setup.c | |||
@@ -271,7 +271,7 @@ MACHINE_START(LINKSTATION_MINI, "Buffalo Linkstation Mini") | |||
271 | .map_io = orion5x_map_io, | 271 | .map_io = orion5x_map_io, |
272 | .init_early = orion5x_init_early, | 272 | .init_early = orion5x_init_early, |
273 | .init_irq = orion5x_init_irq, | 273 | .init_irq = orion5x_init_irq, |
274 | .timer = &orion5x_timer, | 274 | .init_time = orion5x_timer_init, |
275 | .fixup = tag_fixup_mem32, | 275 | .fixup = tag_fixup_mem32, |
276 | .restart = orion5x_restart, | 276 | .restart = orion5x_restart, |
277 | MACHINE_END | 277 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c index 1c16d045333e..0ec94a1f2b16 100644 --- a/arch/arm/mach-orion5x/mss2-setup.c +++ b/arch/arm/mach-orion5x/mss2-setup.c | |||
@@ -265,7 +265,7 @@ MACHINE_START(MSS2, "Maxtor Shared Storage II") | |||
265 | .map_io = orion5x_map_io, | 265 | .map_io = orion5x_map_io, |
266 | .init_early = orion5x_init_early, | 266 | .init_early = orion5x_init_early, |
267 | .init_irq = orion5x_init_irq, | 267 | .init_irq = orion5x_init_irq, |
268 | .timer = &orion5x_timer, | 268 | .init_time = orion5x_timer_init, |
269 | .fixup = tag_fixup_mem32, | 269 | .fixup = tag_fixup_mem32, |
270 | .restart = orion5x_restart, | 270 | .restart = orion5x_restart, |
271 | MACHINE_END | 271 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c index c87fde4deeca..18143f2a9093 100644 --- a/arch/arm/mach-orion5x/mv2120-setup.c +++ b/arch/arm/mach-orion5x/mv2120-setup.c | |||
@@ -233,7 +233,7 @@ MACHINE_START(MV2120, "HP Media Vault mv2120") | |||
233 | .map_io = orion5x_map_io, | 233 | .map_io = orion5x_map_io, |
234 | .init_early = orion5x_init_early, | 234 | .init_early = orion5x_init_early, |
235 | .init_irq = orion5x_init_irq, | 235 | .init_irq = orion5x_init_irq, |
236 | .timer = &orion5x_timer, | 236 | .init_time = orion5x_timer_init, |
237 | .fixup = tag_fixup_mem32, | 237 | .fixup = tag_fixup_mem32, |
238 | .restart = orion5x_restart, | 238 | .restart = orion5x_restart, |
239 | MACHINE_END | 239 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c index 3506f16c0bf2..282e503b003e 100644 --- a/arch/arm/mach-orion5x/net2big-setup.c +++ b/arch/arm/mach-orion5x/net2big-setup.c | |||
@@ -425,7 +425,7 @@ MACHINE_START(NET2BIG, "LaCie 2Big Network") | |||
425 | .map_io = orion5x_map_io, | 425 | .map_io = orion5x_map_io, |
426 | .init_early = orion5x_init_early, | 426 | .init_early = orion5x_init_early, |
427 | .init_irq = orion5x_init_irq, | 427 | .init_irq = orion5x_init_irq, |
428 | .timer = &orion5x_timer, | 428 | .init_time = orion5x_timer_init, |
429 | .fixup = tag_fixup_mem32, | 429 | .fixup = tag_fixup_mem32, |
430 | .restart = orion5x_restart, | 430 | .restart = orion5x_restart, |
431 | MACHINE_END | 431 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c index 9b1c95310291..d6e72f672afb 100644 --- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c +++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c | |||
@@ -171,7 +171,7 @@ MACHINE_START(RD88F5181L_FXO, "Marvell Orion-VoIP FXO Reference Design") | |||
171 | .map_io = orion5x_map_io, | 171 | .map_io = orion5x_map_io, |
172 | .init_early = orion5x_init_early, | 172 | .init_early = orion5x_init_early, |
173 | .init_irq = orion5x_init_irq, | 173 | .init_irq = orion5x_init_irq, |
174 | .timer = &orion5x_timer, | 174 | .init_time = orion5x_timer_init, |
175 | .fixup = tag_fixup_mem32, | 175 | .fixup = tag_fixup_mem32, |
176 | .restart = orion5x_restart, | 176 | .restart = orion5x_restart, |
177 | MACHINE_END | 177 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c index 51ba2b81a10b..c8b7913310e5 100644 --- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c +++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c | |||
@@ -183,7 +183,7 @@ MACHINE_START(RD88F5181L_GE, "Marvell Orion-VoIP GE Reference Design") | |||
183 | .map_io = orion5x_map_io, | 183 | .map_io = orion5x_map_io, |
184 | .init_early = orion5x_init_early, | 184 | .init_early = orion5x_init_early, |
185 | .init_irq = orion5x_init_irq, | 185 | .init_irq = orion5x_init_irq, |
186 | .timer = &orion5x_timer, | 186 | .init_time = orion5x_timer_init, |
187 | .fixup = tag_fixup_mem32, | 187 | .fixup = tag_fixup_mem32, |
188 | .restart = orion5x_restart, | 188 | .restart = orion5x_restart, |
189 | MACHINE_END | 189 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c index 0a56b9444f1b..f9e156725d7c 100644 --- a/arch/arm/mach-orion5x/rd88f5182-setup.c +++ b/arch/arm/mach-orion5x/rd88f5182-setup.c | |||
@@ -281,6 +281,6 @@ MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design") | |||
281 | .map_io = orion5x_map_io, | 281 | .map_io = orion5x_map_io, |
282 | .init_early = orion5x_init_early, | 282 | .init_early = orion5x_init_early, |
283 | .init_irq = orion5x_init_irq, | 283 | .init_irq = orion5x_init_irq, |
284 | .timer = &orion5x_timer, | 284 | .init_time = orion5x_timer_init, |
285 | .restart = orion5x_restart, | 285 | .restart = orion5x_restart, |
286 | MACHINE_END | 286 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c index ed50910b08a4..78a1e6ab1b9d 100644 --- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c +++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c | |||
@@ -123,7 +123,7 @@ MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design") | |||
123 | .map_io = orion5x_map_io, | 123 | .map_io = orion5x_map_io, |
124 | .init_early = orion5x_init_early, | 124 | .init_early = orion5x_init_early, |
125 | .init_irq = orion5x_init_irq, | 125 | .init_irq = orion5x_init_irq, |
126 | .timer = &orion5x_timer, | 126 | .init_time = orion5x_timer_init, |
127 | .fixup = tag_fixup_mem32, | 127 | .fixup = tag_fixup_mem32, |
128 | .restart = orion5x_restart, | 128 | .restart = orion5x_restart, |
129 | MACHINE_END | 129 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/terastation_pro2-setup.c b/arch/arm/mach-orion5x/terastation_pro2-setup.c index 90e571dc4deb..acc0877ec1c9 100644 --- a/arch/arm/mach-orion5x/terastation_pro2-setup.c +++ b/arch/arm/mach-orion5x/terastation_pro2-setup.c | |||
@@ -361,7 +361,7 @@ MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live") | |||
361 | .map_io = orion5x_map_io, | 361 | .map_io = orion5x_map_io, |
362 | .init_early = orion5x_init_early, | 362 | .init_early = orion5x_init_early, |
363 | .init_irq = orion5x_init_irq, | 363 | .init_irq = orion5x_init_irq, |
364 | .timer = &orion5x_timer, | 364 | .init_time = orion5x_timer_init, |
365 | .fixup = tag_fixup_mem32, | 365 | .fixup = tag_fixup_mem32, |
366 | .restart = orion5x_restart, | 366 | .restart = orion5x_restart, |
367 | MACHINE_END | 367 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c index b184f680e0db..9c17f0c2b488 100644 --- a/arch/arm/mach-orion5x/ts209-setup.c +++ b/arch/arm/mach-orion5x/ts209-setup.c | |||
@@ -326,7 +326,7 @@ MACHINE_START(TS209, "QNAP TS-109/TS-209") | |||
326 | .map_io = orion5x_map_io, | 326 | .map_io = orion5x_map_io, |
327 | .init_early = orion5x_init_early, | 327 | .init_early = orion5x_init_early, |
328 | .init_irq = orion5x_init_irq, | 328 | .init_irq = orion5x_init_irq, |
329 | .timer = &orion5x_timer, | 329 | .init_time = orion5x_timer_init, |
330 | .fixup = tag_fixup_mem32, | 330 | .fixup = tag_fixup_mem32, |
331 | .restart = orion5x_restart, | 331 | .restart = orion5x_restart, |
332 | MACHINE_END | 332 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/ts409-setup.c b/arch/arm/mach-orion5x/ts409-setup.c index a5c2e64c4ece..8cc5ab6c503e 100644 --- a/arch/arm/mach-orion5x/ts409-setup.c +++ b/arch/arm/mach-orion5x/ts409-setup.c | |||
@@ -315,7 +315,7 @@ MACHINE_START(TS409, "QNAP TS-409") | |||
315 | .map_io = orion5x_map_io, | 315 | .map_io = orion5x_map_io, |
316 | .init_early = orion5x_init_early, | 316 | .init_early = orion5x_init_early, |
317 | .init_irq = orion5x_init_irq, | 317 | .init_irq = orion5x_init_irq, |
318 | .timer = &orion5x_timer, | 318 | .init_time = orion5x_timer_init, |
319 | .fixup = tag_fixup_mem32, | 319 | .fixup = tag_fixup_mem32, |
320 | .restart = orion5x_restart, | 320 | .restart = orion5x_restart, |
321 | MACHINE_END | 321 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c index b0727dcd1ef9..e960855d32ac 100644 --- a/arch/arm/mach-orion5x/ts78xx-setup.c +++ b/arch/arm/mach-orion5x/ts78xx-setup.c | |||
@@ -619,6 +619,6 @@ MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC") | |||
619 | .map_io = ts78xx_map_io, | 619 | .map_io = ts78xx_map_io, |
620 | .init_early = orion5x_init_early, | 620 | .init_early = orion5x_init_early, |
621 | .init_irq = orion5x_init_irq, | 621 | .init_irq = orion5x_init_irq, |
622 | .timer = &orion5x_timer, | 622 | .init_time = orion5x_timer_init, |
623 | .restart = orion5x_restart, | 623 | .restart = orion5x_restart, |
624 | MACHINE_END | 624 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c index 754c12b6abf0..66552ca7e05d 100644 --- a/arch/arm/mach-orion5x/wnr854t-setup.c +++ b/arch/arm/mach-orion5x/wnr854t-setup.c | |||
@@ -176,7 +176,7 @@ MACHINE_START(WNR854T, "Netgear WNR854T") | |||
176 | .map_io = orion5x_map_io, | 176 | .map_io = orion5x_map_io, |
177 | .init_early = orion5x_init_early, | 177 | .init_early = orion5x_init_early, |
178 | .init_irq = orion5x_init_irq, | 178 | .init_irq = orion5x_init_irq, |
179 | .timer = &orion5x_timer, | 179 | .init_time = orion5x_timer_init, |
180 | .fixup = tag_fixup_mem32, | 180 | .fixup = tag_fixup_mem32, |
181 | .restart = orion5x_restart, | 181 | .restart = orion5x_restart, |
182 | MACHINE_END | 182 | MACHINE_END |
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c index 45c21251eb1e..2c5408e2e689 100644 --- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c +++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c | |||
@@ -264,7 +264,7 @@ MACHINE_START(WRT350N_V2, "Linksys WRT350N v2") | |||
264 | .map_io = orion5x_map_io, | 264 | .map_io = orion5x_map_io, |
265 | .init_early = orion5x_init_early, | 265 | .init_early = orion5x_init_early, |
266 | .init_irq = orion5x_init_irq, | 266 | .init_irq = orion5x_init_irq, |
267 | .timer = &orion5x_timer, | 267 | .init_time = orion5x_timer_init, |
268 | .fixup = tag_fixup_mem32, | 268 | .fixup = tag_fixup_mem32, |
269 | .restart = orion5x_restart, | 269 | .restart = orion5x_restart, |
270 | MACHINE_END | 270 | MACHINE_END |
diff --git a/arch/arm/mach-picoxcell/common.c b/arch/arm/mach-picoxcell/common.c index 35ee21443f03..70b441ad1d18 100644 --- a/arch/arm/mach-picoxcell/common.c +++ b/arch/arm/mach-picoxcell/common.c | |||
@@ -88,7 +88,7 @@ DT_MACHINE_START(PICOXCELL, "Picochip picoXcell") | |||
88 | .map_io = picoxcell_map_io, | 88 | .map_io = picoxcell_map_io, |
89 | .nr_irqs = NR_IRQS_LEGACY, | 89 | .nr_irqs = NR_IRQS_LEGACY, |
90 | .init_irq = irqchip_init, | 90 | .init_irq = irqchip_init, |
91 | .timer = &dw_apb_timer, | 91 | .init_time = dw_apb_timer_init, |
92 | .init_machine = picoxcell_init_machine, | 92 | .init_machine = picoxcell_init_machine, |
93 | .dt_compat = picoxcell_dt_match, | 93 | .dt_compat = picoxcell_dt_match, |
94 | .restart = picoxcell_wdt_restart, | 94 | .restart = picoxcell_wdt_restart, |
diff --git a/arch/arm/mach-picoxcell/common.h b/arch/arm/mach-picoxcell/common.h index a65cb02f84c8..481b42a4ef15 100644 --- a/arch/arm/mach-picoxcell/common.h +++ b/arch/arm/mach-picoxcell/common.h | |||
@@ -12,6 +12,6 @@ | |||
12 | 12 | ||
13 | #include <asm/mach/time.h> | 13 | #include <asm/mach/time.h> |
14 | 14 | ||
15 | extern struct sys_timer dw_apb_timer; | 15 | extern void dw_apb_timer_init(void); |
16 | 16 | ||
17 | #endif /* __PICOXCELL_COMMON_H__ */ | 17 | #endif /* __PICOXCELL_COMMON_H__ */ |
diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c index f25a54194639..ed3570e5eb8f 100644 --- a/arch/arm/mach-prima2/common.c +++ b/arch/arm/mach-prima2/common.c | |||
@@ -40,7 +40,7 @@ DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)") | |||
40 | /* Maintainer: Barry Song <baohua.song@csr.com> */ | 40 | /* Maintainer: Barry Song <baohua.song@csr.com> */ |
41 | .map_io = sirfsoc_map_lluart, | 41 | .map_io = sirfsoc_map_lluart, |
42 | .init_irq = sirfsoc_of_irq_init, | 42 | .init_irq = sirfsoc_of_irq_init, |
43 | .timer = &sirfsoc_timer, | 43 | .init_time = sirfsoc_timer_init, |
44 | .dma_zone_size = SZ_256M, | 44 | .dma_zone_size = SZ_256M, |
45 | .init_machine = sirfsoc_mach_init, | 45 | .init_machine = sirfsoc_mach_init, |
46 | .init_late = sirfsoc_init_late, | 46 | .init_late = sirfsoc_init_late, |
diff --git a/arch/arm/mach-prima2/common.h b/arch/arm/mach-prima2/common.h index 60d826fc2185..9c75f124e3cf 100644 --- a/arch/arm/mach-prima2/common.h +++ b/arch/arm/mach-prima2/common.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <asm/mach/time.h> | 13 | #include <asm/mach/time.h> |
14 | 14 | ||
15 | extern struct sys_timer sirfsoc_timer; | 15 | extern void sirfsoc_timer_init(void); |
16 | 16 | ||
17 | extern void __init sirfsoc_of_irq_init(void); | 17 | extern void __init sirfsoc_of_irq_init(void); |
18 | extern void __init sirfsoc_of_clk_init(void); | 18 | extern void __init sirfsoc_of_clk_init(void); |
diff --git a/arch/arm/mach-prima2/timer.c b/arch/arm/mach-prima2/timer.c index d95bf252f694..a7a2c199c3ea 100644 --- a/arch/arm/mach-prima2/timer.c +++ b/arch/arm/mach-prima2/timer.c | |||
@@ -175,19 +175,13 @@ static u32 notrace sirfsoc_read_sched_clock(void) | |||
175 | 175 | ||
176 | static void __init sirfsoc_clockevent_init(void) | 176 | static void __init sirfsoc_clockevent_init(void) |
177 | { | 177 | { |
178 | clockevents_calc_mult_shift(&sirfsoc_clockevent, CLOCK_TICK_RATE, 60); | ||
179 | |||
180 | sirfsoc_clockevent.max_delta_ns = | ||
181 | clockevent_delta2ns(-2, &sirfsoc_clockevent); | ||
182 | sirfsoc_clockevent.min_delta_ns = | ||
183 | clockevent_delta2ns(2, &sirfsoc_clockevent); | ||
184 | |||
185 | sirfsoc_clockevent.cpumask = cpumask_of(0); | 178 | sirfsoc_clockevent.cpumask = cpumask_of(0); |
186 | clockevents_register_device(&sirfsoc_clockevent); | 179 | clockevents_config_and_register(&sirfsoc_clockevent, CLOCK_TICK_RATE, |
180 | 2, -2); | ||
187 | } | 181 | } |
188 | 182 | ||
189 | /* initialize the kernel jiffy timer source */ | 183 | /* initialize the kernel jiffy timer source */ |
190 | static void __init sirfsoc_timer_init(void) | 184 | void __init sirfsoc_timer_init(void) |
191 | { | 185 | { |
192 | unsigned long rate; | 186 | unsigned long rate; |
193 | struct clk *clk; | 187 | struct clk *clk; |
@@ -226,7 +220,7 @@ static struct of_device_id timer_ids[] = { | |||
226 | {}, | 220 | {}, |
227 | }; | 221 | }; |
228 | 222 | ||
229 | static void __init sirfsoc_of_timer_map(void) | 223 | void __init sirfsoc_of_timer_map(void) |
230 | { | 224 | { |
231 | struct device_node *np; | 225 | struct device_node *np; |
232 | const unsigned int *intspec; | 226 | const unsigned int *intspec; |
@@ -245,7 +239,3 @@ static void __init sirfsoc_of_timer_map(void) | |||
245 | 239 | ||
246 | of_node_put(np); | 240 | of_node_put(np); |
247 | } | 241 | } |
248 | |||
249 | struct sys_timer sirfsoc_timer = { | ||
250 | .init = sirfsoc_timer_init, | ||
251 | }; | ||
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c index 208229342514..2f71b3fbd319 100644 --- a/arch/arm/mach-pxa/balloon3.c +++ b/arch/arm/mach-pxa/balloon3.c | |||
@@ -822,7 +822,7 @@ MACHINE_START(BALLOON3, "Balloon3") | |||
822 | .nr_irqs = BALLOON3_NR_IRQS, | 822 | .nr_irqs = BALLOON3_NR_IRQS, |
823 | .init_irq = balloon3_init_irq, | 823 | .init_irq = balloon3_init_irq, |
824 | .handle_irq = pxa27x_handle_irq, | 824 | .handle_irq = pxa27x_handle_irq, |
825 | .timer = &pxa_timer, | 825 | .init_time = pxa_timer_init, |
826 | .init_machine = balloon3_init, | 826 | .init_machine = balloon3_init, |
827 | .atag_offset = 0x100, | 827 | .atag_offset = 0x100, |
828 | .restart = pxa_restart, | 828 | .restart = pxa_restart, |
diff --git a/arch/arm/mach-pxa/capc7117.c b/arch/arm/mach-pxa/capc7117.c index 9a8760b72913..c092730749b9 100644 --- a/arch/arm/mach-pxa/capc7117.c +++ b/arch/arm/mach-pxa/capc7117.c | |||
@@ -153,7 +153,7 @@ MACHINE_START(CAPC7117, | |||
153 | .nr_irqs = PXA_NR_IRQS, | 153 | .nr_irqs = PXA_NR_IRQS, |
154 | .init_irq = pxa3xx_init_irq, | 154 | .init_irq = pxa3xx_init_irq, |
155 | .handle_irq = pxa3xx_handle_irq, | 155 | .handle_irq = pxa3xx_handle_irq, |
156 | .timer = &pxa_timer, | 156 | .init_time = pxa_timer_init, |
157 | .init_machine = capc7117_init, | 157 | .init_machine = capc7117_init, |
158 | .restart = pxa_restart, | 158 | .restart = pxa_restart, |
159 | MACHINE_END | 159 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c index a103c8ffea9f..bb99f59a36d8 100644 --- a/arch/arm/mach-pxa/cm-x2xx.c +++ b/arch/arm/mach-pxa/cm-x2xx.c | |||
@@ -520,7 +520,7 @@ MACHINE_START(ARMCORE, "Compulab CM-X2XX") | |||
520 | .init_irq = cmx2xx_init_irq, | 520 | .init_irq = cmx2xx_init_irq, |
521 | /* NOTE: pxa25x_handle_irq() works on PXA27x w/o camera support */ | 521 | /* NOTE: pxa25x_handle_irq() works on PXA27x w/o camera support */ |
522 | .handle_irq = pxa25x_handle_irq, | 522 | .handle_irq = pxa25x_handle_irq, |
523 | .timer = &pxa_timer, | 523 | .init_time = pxa_timer_init, |
524 | .init_machine = cmx2xx_init, | 524 | .init_machine = cmx2xx_init, |
525 | #ifdef CONFIG_PCI | 525 | #ifdef CONFIG_PCI |
526 | .dma_zone_size = SZ_64M, | 526 | .dma_zone_size = SZ_64M, |
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index cc2b23afcaaf..8091aac89edf 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -854,7 +854,7 @@ MACHINE_START(CM_X300, "CM-X300 module") | |||
854 | .nr_irqs = PXA_NR_IRQS, | 854 | .nr_irqs = PXA_NR_IRQS, |
855 | .init_irq = pxa3xx_init_irq, | 855 | .init_irq = pxa3xx_init_irq, |
856 | .handle_irq = pxa3xx_handle_irq, | 856 | .handle_irq = pxa3xx_handle_irq, |
857 | .timer = &pxa_timer, | 857 | .init_time = pxa_timer_init, |
858 | .init_machine = cm_x300_init, | 858 | .init_machine = cm_x300_init, |
859 | .fixup = cm_x300_fixup, | 859 | .fixup = cm_x300_fixup, |
860 | .restart = pxa_restart, | 860 | .restart = pxa_restart, |
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c index b2f227d36125..5f9d9303b346 100644 --- a/arch/arm/mach-pxa/colibri-pxa270.c +++ b/arch/arm/mach-pxa/colibri-pxa270.c | |||
@@ -313,7 +313,7 @@ MACHINE_START(COLIBRI, "Toradex Colibri PXA270") | |||
313 | .nr_irqs = PXA_NR_IRQS, | 313 | .nr_irqs = PXA_NR_IRQS, |
314 | .init_irq = pxa27x_init_irq, | 314 | .init_irq = pxa27x_init_irq, |
315 | .handle_irq = pxa27x_handle_irq, | 315 | .handle_irq = pxa27x_handle_irq, |
316 | .timer = &pxa_timer, | 316 | .init_time = pxa_timer_init, |
317 | .restart = pxa_restart, | 317 | .restart = pxa_restart, |
318 | MACHINE_END | 318 | MACHINE_END |
319 | 319 | ||
@@ -324,7 +324,7 @@ MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC") | |||
324 | .nr_irqs = PXA_NR_IRQS, | 324 | .nr_irqs = PXA_NR_IRQS, |
325 | .init_irq = pxa27x_init_irq, | 325 | .init_irq = pxa27x_init_irq, |
326 | .handle_irq = pxa27x_handle_irq, | 326 | .handle_irq = pxa27x_handle_irq, |
327 | .timer = &pxa_timer, | 327 | .init_time = pxa_timer_init, |
328 | .restart = pxa_restart, | 328 | .restart = pxa_restart, |
329 | MACHINE_END | 329 | MACHINE_END |
330 | 330 | ||
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index a9c9c163dd95..f1a1ac1fbd85 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c | |||
@@ -189,7 +189,7 @@ MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") | |||
189 | .nr_irqs = PXA_NR_IRQS, | 189 | .nr_irqs = PXA_NR_IRQS, |
190 | .init_irq = pxa3xx_init_irq, | 190 | .init_irq = pxa3xx_init_irq, |
191 | .handle_irq = pxa3xx_handle_irq, | 191 | .handle_irq = pxa3xx_handle_irq, |
192 | .timer = &pxa_timer, | 192 | .init_time = pxa_timer_init, |
193 | .restart = pxa_restart, | 193 | .restart = pxa_restart, |
194 | MACHINE_END | 194 | MACHINE_END |
195 | 195 | ||
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index 25515cd7e68f..f6cc8b0ab82f 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c | |||
@@ -259,7 +259,7 @@ MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") | |||
259 | .nr_irqs = PXA_NR_IRQS, | 259 | .nr_irqs = PXA_NR_IRQS, |
260 | .init_irq = pxa3xx_init_irq, | 260 | .init_irq = pxa3xx_init_irq, |
261 | .handle_irq = pxa3xx_handle_irq, | 261 | .handle_irq = pxa3xx_handle_irq, |
262 | .timer = &pxa_timer, | 262 | .init_time = pxa_timer_init, |
263 | .restart = pxa_restart, | 263 | .restart = pxa_restart, |
264 | MACHINE_END | 264 | MACHINE_END |
265 | 265 | ||
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 7c83f52c549c..a5b8fead7d61 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -733,7 +733,7 @@ MACHINE_START(CORGI, "SHARP Corgi") | |||
733 | .init_irq = pxa25x_init_irq, | 733 | .init_irq = pxa25x_init_irq, |
734 | .handle_irq = pxa25x_handle_irq, | 734 | .handle_irq = pxa25x_handle_irq, |
735 | .init_machine = corgi_init, | 735 | .init_machine = corgi_init, |
736 | .timer = &pxa_timer, | 736 | .init_time = pxa_timer_init, |
737 | .restart = corgi_restart, | 737 | .restart = corgi_restart, |
738 | MACHINE_END | 738 | MACHINE_END |
739 | #endif | 739 | #endif |
@@ -746,7 +746,7 @@ MACHINE_START(SHEPHERD, "SHARP Shepherd") | |||
746 | .init_irq = pxa25x_init_irq, | 746 | .init_irq = pxa25x_init_irq, |
747 | .handle_irq = pxa25x_handle_irq, | 747 | .handle_irq = pxa25x_handle_irq, |
748 | .init_machine = corgi_init, | 748 | .init_machine = corgi_init, |
749 | .timer = &pxa_timer, | 749 | .init_time = pxa_timer_init, |
750 | .restart = corgi_restart, | 750 | .restart = corgi_restart, |
751 | MACHINE_END | 751 | MACHINE_END |
752 | #endif | 752 | #endif |
@@ -759,7 +759,7 @@ MACHINE_START(HUSKY, "SHARP Husky") | |||
759 | .init_irq = pxa25x_init_irq, | 759 | .init_irq = pxa25x_init_irq, |
760 | .handle_irq = pxa25x_handle_irq, | 760 | .handle_irq = pxa25x_handle_irq, |
761 | .init_machine = corgi_init, | 761 | .init_machine = corgi_init, |
762 | .timer = &pxa_timer, | 762 | .init_time = pxa_timer_init, |
763 | .restart = corgi_restart, | 763 | .restart = corgi_restart, |
764 | MACHINE_END | 764 | MACHINE_END |
765 | #endif | 765 | #endif |
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c index 7039f44b3647..fadfff8feaef 100644 --- a/arch/arm/mach-pxa/csb726.c +++ b/arch/arm/mach-pxa/csb726.c | |||
@@ -278,6 +278,6 @@ MACHINE_START(CSB726, "Cogent CSB726") | |||
278 | .init_irq = pxa27x_init_irq, | 278 | .init_irq = pxa27x_init_irq, |
279 | .handle_irq = pxa27x_handle_irq, | 279 | .handle_irq = pxa27x_handle_irq, |
280 | .init_machine = csb726_init, | 280 | .init_machine = csb726_init, |
281 | .timer = &pxa_timer, | 281 | .init_time = pxa_timer_init, |
282 | .restart = pxa_restart, | 282 | .restart = pxa_restart, |
283 | MACHINE_END | 283 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index 1b6411439ec8..446563a7d1ad 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -1298,7 +1298,7 @@ MACHINE_START(EM_X270, "Compulab EM-X270") | |||
1298 | .nr_irqs = PXA_NR_IRQS, | 1298 | .nr_irqs = PXA_NR_IRQS, |
1299 | .init_irq = pxa27x_init_irq, | 1299 | .init_irq = pxa27x_init_irq, |
1300 | .handle_irq = pxa27x_handle_irq, | 1300 | .handle_irq = pxa27x_handle_irq, |
1301 | .timer = &pxa_timer, | 1301 | .init_time = pxa_timer_init, |
1302 | .init_machine = em_x270_init, | 1302 | .init_machine = em_x270_init, |
1303 | .restart = pxa_restart, | 1303 | .restart = pxa_restart, |
1304 | MACHINE_END | 1304 | MACHINE_END |
@@ -1309,7 +1309,7 @@ MACHINE_START(EXEDA, "Compulab eXeda") | |||
1309 | .nr_irqs = PXA_NR_IRQS, | 1309 | .nr_irqs = PXA_NR_IRQS, |
1310 | .init_irq = pxa27x_init_irq, | 1310 | .init_irq = pxa27x_init_irq, |
1311 | .handle_irq = pxa27x_handle_irq, | 1311 | .handle_irq = pxa27x_handle_irq, |
1312 | .timer = &pxa_timer, | 1312 | .init_time = pxa_timer_init, |
1313 | .init_machine = em_x270_init, | 1313 | .init_machine = em_x270_init, |
1314 | .restart = pxa_restart, | 1314 | .restart = pxa_restart, |
1315 | MACHINE_END | 1315 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index be2ee9bf5c6e..8280ebcaab9f 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c | |||
@@ -195,7 +195,7 @@ MACHINE_START(E330, "Toshiba e330") | |||
195 | .handle_irq = pxa25x_handle_irq, | 195 | .handle_irq = pxa25x_handle_irq, |
196 | .fixup = eseries_fixup, | 196 | .fixup = eseries_fixup, |
197 | .init_machine = e330_init, | 197 | .init_machine = e330_init, |
198 | .timer = &pxa_timer, | 198 | .init_time = pxa_timer_init, |
199 | .restart = pxa_restart, | 199 | .restart = pxa_restart, |
200 | MACHINE_END | 200 | MACHINE_END |
201 | #endif | 201 | #endif |
@@ -246,7 +246,7 @@ MACHINE_START(E350, "Toshiba e350") | |||
246 | .handle_irq = pxa25x_handle_irq, | 246 | .handle_irq = pxa25x_handle_irq, |
247 | .fixup = eseries_fixup, | 247 | .fixup = eseries_fixup, |
248 | .init_machine = e350_init, | 248 | .init_machine = e350_init, |
249 | .timer = &pxa_timer, | 249 | .init_time = pxa_timer_init, |
250 | .restart = pxa_restart, | 250 | .restart = pxa_restart, |
251 | MACHINE_END | 251 | MACHINE_END |
252 | #endif | 252 | #endif |
@@ -370,7 +370,7 @@ MACHINE_START(E400, "Toshiba e400") | |||
370 | .handle_irq = pxa25x_handle_irq, | 370 | .handle_irq = pxa25x_handle_irq, |
371 | .fixup = eseries_fixup, | 371 | .fixup = eseries_fixup, |
372 | .init_machine = e400_init, | 372 | .init_machine = e400_init, |
373 | .timer = &pxa_timer, | 373 | .init_time = pxa_timer_init, |
374 | .restart = pxa_restart, | 374 | .restart = pxa_restart, |
375 | MACHINE_END | 375 | MACHINE_END |
376 | #endif | 376 | #endif |
@@ -566,7 +566,7 @@ MACHINE_START(E740, "Toshiba e740") | |||
566 | .handle_irq = pxa25x_handle_irq, | 566 | .handle_irq = pxa25x_handle_irq, |
567 | .fixup = eseries_fixup, | 567 | .fixup = eseries_fixup, |
568 | .init_machine = e740_init, | 568 | .init_machine = e740_init, |
569 | .timer = &pxa_timer, | 569 | .init_time = pxa_timer_init, |
570 | .restart = pxa_restart, | 570 | .restart = pxa_restart, |
571 | MACHINE_END | 571 | MACHINE_END |
572 | #endif | 572 | #endif |
@@ -765,7 +765,7 @@ MACHINE_START(E750, "Toshiba e750") | |||
765 | .handle_irq = pxa25x_handle_irq, | 765 | .handle_irq = pxa25x_handle_irq, |
766 | .fixup = eseries_fixup, | 766 | .fixup = eseries_fixup, |
767 | .init_machine = e750_init, | 767 | .init_machine = e750_init, |
768 | .timer = &pxa_timer, | 768 | .init_time = pxa_timer_init, |
769 | .restart = pxa_restart, | 769 | .restart = pxa_restart, |
770 | MACHINE_END | 770 | MACHINE_END |
771 | #endif | 771 | #endif |
@@ -977,7 +977,7 @@ MACHINE_START(E800, "Toshiba e800") | |||
977 | .handle_irq = pxa25x_handle_irq, | 977 | .handle_irq = pxa25x_handle_irq, |
978 | .fixup = eseries_fixup, | 978 | .fixup = eseries_fixup, |
979 | .init_machine = e800_init, | 979 | .init_machine = e800_init, |
980 | .timer = &pxa_timer, | 980 | .init_time = pxa_timer_init, |
981 | .restart = pxa_restart, | 981 | .restart = pxa_restart, |
982 | MACHINE_END | 982 | MACHINE_END |
983 | #endif | 983 | #endif |
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c index dc58fa0edb66..dca10709be8f 100644 --- a/arch/arm/mach-pxa/ezx.c +++ b/arch/arm/mach-pxa/ezx.c | |||
@@ -802,7 +802,7 @@ MACHINE_START(EZX_A780, "Motorola EZX A780") | |||
802 | .nr_irqs = EZX_NR_IRQS, | 802 | .nr_irqs = EZX_NR_IRQS, |
803 | .init_irq = pxa27x_init_irq, | 803 | .init_irq = pxa27x_init_irq, |
804 | .handle_irq = pxa27x_handle_irq, | 804 | .handle_irq = pxa27x_handle_irq, |
805 | .timer = &pxa_timer, | 805 | .init_time = pxa_timer_init, |
806 | .init_machine = a780_init, | 806 | .init_machine = a780_init, |
807 | .restart = pxa_restart, | 807 | .restart = pxa_restart, |
808 | MACHINE_END | 808 | MACHINE_END |
@@ -869,7 +869,7 @@ MACHINE_START(EZX_E680, "Motorola EZX E680") | |||
869 | .nr_irqs = EZX_NR_IRQS, | 869 | .nr_irqs = EZX_NR_IRQS, |
870 | .init_irq = pxa27x_init_irq, | 870 | .init_irq = pxa27x_init_irq, |
871 | .handle_irq = pxa27x_handle_irq, | 871 | .handle_irq = pxa27x_handle_irq, |
872 | .timer = &pxa_timer, | 872 | .init_time = pxa_timer_init, |
873 | .init_machine = e680_init, | 873 | .init_machine = e680_init, |
874 | .restart = pxa_restart, | 874 | .restart = pxa_restart, |
875 | MACHINE_END | 875 | MACHINE_END |
@@ -936,7 +936,7 @@ MACHINE_START(EZX_A1200, "Motorola EZX A1200") | |||
936 | .nr_irqs = EZX_NR_IRQS, | 936 | .nr_irqs = EZX_NR_IRQS, |
937 | .init_irq = pxa27x_init_irq, | 937 | .init_irq = pxa27x_init_irq, |
938 | .handle_irq = pxa27x_handle_irq, | 938 | .handle_irq = pxa27x_handle_irq, |
939 | .timer = &pxa_timer, | 939 | .init_time = pxa_timer_init, |
940 | .init_machine = a1200_init, | 940 | .init_machine = a1200_init, |
941 | .restart = pxa_restart, | 941 | .restart = pxa_restart, |
942 | MACHINE_END | 942 | MACHINE_END |
@@ -1128,7 +1128,7 @@ MACHINE_START(EZX_A910, "Motorola EZX A910") | |||
1128 | .nr_irqs = EZX_NR_IRQS, | 1128 | .nr_irqs = EZX_NR_IRQS, |
1129 | .init_irq = pxa27x_init_irq, | 1129 | .init_irq = pxa27x_init_irq, |
1130 | .handle_irq = pxa27x_handle_irq, | 1130 | .handle_irq = pxa27x_handle_irq, |
1131 | .timer = &pxa_timer, | 1131 | .init_time = pxa_timer_init, |
1132 | .init_machine = a910_init, | 1132 | .init_machine = a910_init, |
1133 | .restart = pxa_restart, | 1133 | .restart = pxa_restart, |
1134 | MACHINE_END | 1134 | MACHINE_END |
@@ -1195,7 +1195,7 @@ MACHINE_START(EZX_E6, "Motorola EZX E6") | |||
1195 | .nr_irqs = EZX_NR_IRQS, | 1195 | .nr_irqs = EZX_NR_IRQS, |
1196 | .init_irq = pxa27x_init_irq, | 1196 | .init_irq = pxa27x_init_irq, |
1197 | .handle_irq = pxa27x_handle_irq, | 1197 | .handle_irq = pxa27x_handle_irq, |
1198 | .timer = &pxa_timer, | 1198 | .init_time = pxa_timer_init, |
1199 | .init_machine = e6_init, | 1199 | .init_machine = e6_init, |
1200 | .restart = pxa_restart, | 1200 | .restart = pxa_restart, |
1201 | MACHINE_END | 1201 | MACHINE_END |
@@ -1236,7 +1236,7 @@ MACHINE_START(EZX_E2, "Motorola EZX E2") | |||
1236 | .nr_irqs = EZX_NR_IRQS, | 1236 | .nr_irqs = EZX_NR_IRQS, |
1237 | .init_irq = pxa27x_init_irq, | 1237 | .init_irq = pxa27x_init_irq, |
1238 | .handle_irq = pxa27x_handle_irq, | 1238 | .handle_irq = pxa27x_handle_irq, |
1239 | .timer = &pxa_timer, | 1239 | .init_time = pxa_timer_init, |
1240 | .init_machine = e2_init, | 1240 | .init_machine = e2_init, |
1241 | .restart = pxa_restart, | 1241 | .restart = pxa_restart, |
1242 | MACHINE_END | 1242 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index 42d5cca66257..fd7ea39b78c0 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h | |||
@@ -10,9 +10,8 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | struct irq_data; | 12 | struct irq_data; |
13 | struct sys_timer; | ||
14 | 13 | ||
15 | extern struct sys_timer pxa_timer; | 14 | extern void pxa_timer_init(void); |
16 | 15 | ||
17 | extern void __init pxa_map_io(void); | 16 | extern void __init pxa_map_io(void); |
18 | 17 | ||
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c index 60755a6bb1c6..00b92dad7b81 100644 --- a/arch/arm/mach-pxa/gumstix.c +++ b/arch/arm/mach-pxa/gumstix.c | |||
@@ -238,7 +238,7 @@ MACHINE_START(GUMSTIX, "Gumstix") | |||
238 | .nr_irqs = PXA_NR_IRQS, | 238 | .nr_irqs = PXA_NR_IRQS, |
239 | .init_irq = pxa25x_init_irq, | 239 | .init_irq = pxa25x_init_irq, |
240 | .handle_irq = pxa25x_handle_irq, | 240 | .handle_irq = pxa25x_handle_irq, |
241 | .timer = &pxa_timer, | 241 | .init_time = pxa_timer_init, |
242 | .init_machine = gumstix_init, | 242 | .init_machine = gumstix_init, |
243 | .restart = pxa_restart, | 243 | .restart = pxa_restart, |
244 | MACHINE_END | 244 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c index e7dec589f014..875ec3351499 100644 --- a/arch/arm/mach-pxa/h5000.c +++ b/arch/arm/mach-pxa/h5000.c | |||
@@ -208,7 +208,7 @@ MACHINE_START(H5400, "HP iPAQ H5000") | |||
208 | .nr_irqs = PXA_NR_IRQS, | 208 | .nr_irqs = PXA_NR_IRQS, |
209 | .init_irq = pxa25x_init_irq, | 209 | .init_irq = pxa25x_init_irq, |
210 | .handle_irq = pxa25x_handle_irq, | 210 | .handle_irq = pxa25x_handle_irq, |
211 | .timer = &pxa_timer, | 211 | .init_time = pxa_timer_init, |
212 | .init_machine = h5000_init, | 212 | .init_machine = h5000_init, |
213 | .restart = pxa_restart, | 213 | .restart = pxa_restart, |
214 | MACHINE_END | 214 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c index 2962de898da9..7a8d749a07b8 100644 --- a/arch/arm/mach-pxa/himalaya.c +++ b/arch/arm/mach-pxa/himalaya.c | |||
@@ -164,6 +164,6 @@ MACHINE_START(HIMALAYA, "HTC Himalaya") | |||
164 | .init_irq = pxa25x_init_irq, | 164 | .init_irq = pxa25x_init_irq, |
165 | .handle_irq = pxa25x_handle_irq, | 165 | .handle_irq = pxa25x_handle_irq, |
166 | .init_machine = himalaya_init, | 166 | .init_machine = himalaya_init, |
167 | .timer = &pxa_timer, | 167 | .init_time = pxa_timer_init, |
168 | .restart = pxa_restart, | 168 | .restart = pxa_restart, |
169 | MACHINE_END | 169 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index e2c6391863fe..133109ec7332 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c | |||
@@ -900,6 +900,6 @@ MACHINE_START(H4700, "HP iPAQ HX4700") | |||
900 | .init_irq = pxa27x_init_irq, | 900 | .init_irq = pxa27x_init_irq, |
901 | .handle_irq = pxa27x_handle_irq, | 901 | .handle_irq = pxa27x_handle_irq, |
902 | .init_machine = hx4700_init, | 902 | .init_machine = hx4700_init, |
903 | .timer = &pxa_timer, | 903 | .init_time = pxa_timer_init, |
904 | .restart = pxa_restart, | 904 | .restart = pxa_restart, |
905 | MACHINE_END | 905 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c index 1d02eabc9c65..fe31bfcbb8df 100644 --- a/arch/arm/mach-pxa/icontrol.c +++ b/arch/arm/mach-pxa/icontrol.c | |||
@@ -196,7 +196,7 @@ MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM") | |||
196 | .nr_irqs = PXA_NR_IRQS, | 196 | .nr_irqs = PXA_NR_IRQS, |
197 | .init_irq = pxa3xx_init_irq, | 197 | .init_irq = pxa3xx_init_irq, |
198 | .handle_irq = pxa3xx_handle_irq, | 198 | .handle_irq = pxa3xx_handle_irq, |
199 | .timer = &pxa_timer, | 199 | .init_time = pxa_timer_init, |
200 | .init_machine = icontrol_init, | 200 | .init_machine = icontrol_init, |
201 | .restart = pxa_restart, | 201 | .restart = pxa_restart, |
202 | MACHINE_END | 202 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c index 64507cdd2e8f..343c4e3a7c5d 100644 --- a/arch/arm/mach-pxa/idp.c +++ b/arch/arm/mach-pxa/idp.c | |||
@@ -279,7 +279,7 @@ MACHINE_START(PXA_IDP, "Vibren PXA255 IDP") | |||
279 | .nr_irqs = PXA_NR_IRQS, | 279 | .nr_irqs = PXA_NR_IRQS, |
280 | .init_irq = pxa25x_init_irq, | 280 | .init_irq = pxa25x_init_irq, |
281 | .handle_irq = pxa25x_handle_irq, | 281 | .handle_irq = pxa25x_handle_irq, |
282 | .timer = &pxa_timer, | 282 | .init_time = pxa_timer_init, |
283 | .init_machine = idp_init, | 283 | .init_machine = idp_init, |
284 | .restart = pxa_restart, | 284 | .restart = pxa_restart, |
285 | MACHINE_END | 285 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c index 402874f9021f..e848c4607baf 100644 --- a/arch/arm/mach-pxa/littleton.c +++ b/arch/arm/mach-pxa/littleton.c | |||
@@ -443,7 +443,7 @@ MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleto | |||
443 | .nr_irqs = LITTLETON_NR_IRQS, | 443 | .nr_irqs = LITTLETON_NR_IRQS, |
444 | .init_irq = pxa3xx_init_irq, | 444 | .init_irq = pxa3xx_init_irq, |
445 | .handle_irq = pxa3xx_handle_irq, | 445 | .handle_irq = pxa3xx_handle_irq, |
446 | .timer = &pxa_timer, | 446 | .init_time = pxa_timer_init, |
447 | .init_machine = littleton_init, | 447 | .init_machine = littleton_init, |
448 | .restart = pxa_restart, | 448 | .restart = pxa_restart, |
449 | MACHINE_END | 449 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index 1a63eaa89867..1255ee00f3d1 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c | |||
@@ -503,7 +503,7 @@ MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine") | |||
503 | .nr_irqs = LPD270_NR_IRQS, | 503 | .nr_irqs = LPD270_NR_IRQS, |
504 | .init_irq = lpd270_init_irq, | 504 | .init_irq = lpd270_init_irq, |
505 | .handle_irq = pxa27x_handle_irq, | 505 | .handle_irq = pxa27x_handle_irq, |
506 | .timer = &pxa_timer, | 506 | .init_time = pxa_timer_init, |
507 | .init_machine = lpd270_init, | 507 | .init_machine = lpd270_init, |
508 | .restart = pxa_restart, | 508 | .restart = pxa_restart, |
509 | MACHINE_END | 509 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 553056d9a3c5..d8a1be619f21 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -650,7 +650,7 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)") | |||
650 | .nr_irqs = LUBBOCK_NR_IRQS, | 650 | .nr_irqs = LUBBOCK_NR_IRQS, |
651 | .init_irq = lubbock_init_irq, | 651 | .init_irq = lubbock_init_irq, |
652 | .handle_irq = pxa25x_handle_irq, | 652 | .handle_irq = pxa25x_handle_irq, |
653 | .timer = &pxa_timer, | 653 | .init_time = pxa_timer_init, |
654 | .init_machine = lubbock_init, | 654 | .init_machine = lubbock_init, |
655 | .restart = pxa_restart, | 655 | .restart = pxa_restart, |
656 | MACHINE_END | 656 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c index f7922404d941..f44532fc648b 100644 --- a/arch/arm/mach-pxa/magician.c +++ b/arch/arm/mach-pxa/magician.c | |||
@@ -774,6 +774,6 @@ MACHINE_START(MAGICIAN, "HTC Magician") | |||
774 | .init_irq = pxa27x_init_irq, | 774 | .init_irq = pxa27x_init_irq, |
775 | .handle_irq = pxa27x_handle_irq, | 775 | .handle_irq = pxa27x_handle_irq, |
776 | .init_machine = magician_init, | 776 | .init_machine = magician_init, |
777 | .timer = &pxa_timer, | 777 | .init_time = pxa_timer_init, |
778 | .restart = pxa_restart, | 778 | .restart = pxa_restart, |
779 | MACHINE_END | 779 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index f27a61ee7ac7..7a12c1ba90ff 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -714,7 +714,7 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") | |||
714 | .nr_irqs = MAINSTONE_NR_IRQS, | 714 | .nr_irqs = MAINSTONE_NR_IRQS, |
715 | .init_irq = mainstone_init_irq, | 715 | .init_irq = mainstone_init_irq, |
716 | .handle_irq = pxa27x_handle_irq, | 716 | .handle_irq = pxa27x_handle_irq, |
717 | .timer = &pxa_timer, | 717 | .init_time = pxa_timer_init, |
718 | .init_machine = mainstone_init, | 718 | .init_machine = mainstone_init, |
719 | .restart = pxa_restart, | 719 | .restart = pxa_restart, |
720 | MACHINE_END | 720 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 2831308dba68..f8979b943cbf 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -762,6 +762,6 @@ MACHINE_START(MIOA701, "MIO A701") | |||
762 | .init_irq = &pxa27x_init_irq, | 762 | .init_irq = &pxa27x_init_irq, |
763 | .handle_irq = &pxa27x_handle_irq, | 763 | .handle_irq = &pxa27x_handle_irq, |
764 | .init_machine = mioa701_machine_init, | 764 | .init_machine = mioa701_machine_init, |
765 | .timer = &pxa_timer, | 765 | .init_time = pxa_timer_init, |
766 | .restart = mioa701_restart, | 766 | .restart = mioa701_restart, |
767 | MACHINE_END | 767 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c index 152efbf093f6..854f1f562d6b 100644 --- a/arch/arm/mach-pxa/mp900.c +++ b/arch/arm/mach-pxa/mp900.c | |||
@@ -93,7 +93,7 @@ static void __init mp900c_init(void) | |||
93 | /* Maintainer - Michael Petchkovsky <mkpetch@internode.on.net> */ | 93 | /* Maintainer - Michael Petchkovsky <mkpetch@internode.on.net> */ |
94 | MACHINE_START(NEC_MP900, "MobilePro900/C") | 94 | MACHINE_START(NEC_MP900, "MobilePro900/C") |
95 | .atag_offset = 0x220100, | 95 | .atag_offset = 0x220100, |
96 | .timer = &pxa_timer, | 96 | .init_time = pxa_timer_init, |
97 | .map_io = pxa25x_map_io, | 97 | .map_io = pxa25x_map_io, |
98 | .nr_irqs = PXA_NR_IRQS, | 98 | .nr_irqs = PXA_NR_IRQS, |
99 | .init_irq = pxa25x_init_irq, | 99 | .init_irq = pxa25x_init_irq, |
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index 8bcc96e3b0db..909b713e5789 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c | |||
@@ -347,7 +347,7 @@ MACHINE_START(PALMLD, "Palm LifeDrive") | |||
347 | .nr_irqs = PXA_NR_IRQS, | 347 | .nr_irqs = PXA_NR_IRQS, |
348 | .init_irq = pxa27x_init_irq, | 348 | .init_irq = pxa27x_init_irq, |
349 | .handle_irq = pxa27x_handle_irq, | 349 | .handle_irq = pxa27x_handle_irq, |
350 | .timer = &pxa_timer, | 350 | .init_time = pxa_timer_init, |
351 | .init_machine = palmld_init, | 351 | .init_machine = palmld_init, |
352 | .restart = pxa_restart, | 352 | .restart = pxa_restart, |
353 | MACHINE_END | 353 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c index 5ca7b904a30e..5033fd07968f 100644 --- a/arch/arm/mach-pxa/palmt5.c +++ b/arch/arm/mach-pxa/palmt5.c | |||
@@ -208,7 +208,7 @@ MACHINE_START(PALMT5, "Palm Tungsten|T5") | |||
208 | .nr_irqs = PXA_NR_IRQS, | 208 | .nr_irqs = PXA_NR_IRQS, |
209 | .init_irq = pxa27x_init_irq, | 209 | .init_irq = pxa27x_init_irq, |
210 | .handle_irq = pxa27x_handle_irq, | 210 | .handle_irq = pxa27x_handle_irq, |
211 | .timer = &pxa_timer, | 211 | .init_time = pxa_timer_init, |
212 | .init_machine = palmt5_init, | 212 | .init_machine = palmt5_init, |
213 | .restart = pxa_restart, | 213 | .restart = pxa_restart, |
214 | MACHINE_END | 214 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c index ca924cfedfc0..100b176f7e88 100644 --- a/arch/arm/mach-pxa/palmtc.c +++ b/arch/arm/mach-pxa/palmtc.c | |||
@@ -542,7 +542,7 @@ MACHINE_START(PALMTC, "Palm Tungsten|C") | |||
542 | .nr_irqs = PXA_NR_IRQS, | 542 | .nr_irqs = PXA_NR_IRQS, |
543 | .init_irq = pxa25x_init_irq, | 543 | .init_irq = pxa25x_init_irq, |
544 | .handle_irq = pxa25x_handle_irq, | 544 | .handle_irq = pxa25x_handle_irq, |
545 | .timer = &pxa_timer, | 545 | .init_time = pxa_timer_init, |
546 | .init_machine = palmtc_init, | 546 | .init_machine = palmtc_init, |
547 | .restart = pxa_restart, | 547 | .restart = pxa_restart, |
548 | MACHINE_END | 548 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c index 32e0d7998355..0742721ced2d 100644 --- a/arch/arm/mach-pxa/palmte2.c +++ b/arch/arm/mach-pxa/palmte2.c | |||
@@ -363,7 +363,7 @@ MACHINE_START(PALMTE2, "Palm Tungsten|E2") | |||
363 | .nr_irqs = PXA_NR_IRQS, | 363 | .nr_irqs = PXA_NR_IRQS, |
364 | .init_irq = pxa25x_init_irq, | 364 | .init_irq = pxa25x_init_irq, |
365 | .handle_irq = pxa25x_handle_irq, | 365 | .handle_irq = pxa25x_handle_irq, |
366 | .timer = &pxa_timer, | 366 | .init_time = pxa_timer_init, |
367 | .init_machine = palmte2_init, | 367 | .init_machine = palmte2_init, |
368 | .restart = pxa_restart, | 368 | .restart = pxa_restart, |
369 | MACHINE_END | 369 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index 3f3c48f2f7ce..d17bda278782 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c | |||
@@ -451,7 +451,7 @@ MACHINE_START(TREO680, "Palm Treo 680") | |||
451 | .nr_irqs = PXA_NR_IRQS, | 451 | .nr_irqs = PXA_NR_IRQS, |
452 | .init_irq = pxa27x_init_irq, | 452 | .init_irq = pxa27x_init_irq, |
453 | .handle_irq = pxa27x_handle_irq, | 453 | .handle_irq = pxa27x_handle_irq, |
454 | .timer = &pxa_timer, | 454 | .init_time = pxa_timer_init, |
455 | .init_machine = treo680_init, | 455 | .init_machine = treo680_init, |
456 | .restart = pxa_restart, | 456 | .restart = pxa_restart, |
457 | MACHINE_END | 457 | MACHINE_END |
@@ -465,7 +465,7 @@ MACHINE_START(CENTRO, "Palm Centro 685") | |||
465 | .nr_irqs = PXA_NR_IRQS, | 465 | .nr_irqs = PXA_NR_IRQS, |
466 | .init_irq = pxa27x_init_irq, | 466 | .init_irq = pxa27x_init_irq, |
467 | .handle_irq = pxa27x_handle_irq, | 467 | .handle_irq = pxa27x_handle_irq, |
468 | .timer = &pxa_timer, | 468 | .init_time = pxa_timer_init, |
469 | .init_machine = centro_init, | 469 | .init_machine = centro_init, |
470 | .restart = pxa_restart, | 470 | .restart = pxa_restart, |
471 | MACHINE_END | 471 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index 8b4366628a12..627c93a7364c 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c | |||
@@ -366,7 +366,7 @@ MACHINE_START(PALMTX, "Palm T|X") | |||
366 | .nr_irqs = PXA_NR_IRQS, | 366 | .nr_irqs = PXA_NR_IRQS, |
367 | .init_irq = pxa27x_init_irq, | 367 | .init_irq = pxa27x_init_irq, |
368 | .handle_irq = pxa27x_handle_irq, | 368 | .handle_irq = pxa27x_handle_irq, |
369 | .timer = &pxa_timer, | 369 | .init_time = pxa_timer_init, |
370 | .init_machine = palmtx_init, | 370 | .init_machine = palmtx_init, |
371 | .restart = pxa_restart, | 371 | .restart = pxa_restart, |
372 | MACHINE_END | 372 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c index 8cdd4f58e253..18b7fcd98592 100644 --- a/arch/arm/mach-pxa/palmz72.c +++ b/arch/arm/mach-pxa/palmz72.c | |||
@@ -404,7 +404,7 @@ MACHINE_START(PALMZ72, "Palm Zire72") | |||
404 | .nr_irqs = PXA_NR_IRQS, | 404 | .nr_irqs = PXA_NR_IRQS, |
405 | .init_irq = pxa27x_init_irq, | 405 | .init_irq = pxa27x_init_irq, |
406 | .handle_irq = pxa27x_handle_irq, | 406 | .handle_irq = pxa27x_handle_irq, |
407 | .timer = &pxa_timer, | 407 | .init_time = pxa_timer_init, |
408 | .init_machine = palmz72_init, | 408 | .init_machine = palmz72_init, |
409 | .restart = pxa_restart, | 409 | .restart = pxa_restart, |
410 | MACHINE_END | 410 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c index fe9054435b6f..69918c7e3f1f 100644 --- a/arch/arm/mach-pxa/pcm027.c +++ b/arch/arm/mach-pxa/pcm027.c | |||
@@ -263,7 +263,7 @@ MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270") | |||
263 | .nr_irqs = PCM027_NR_IRQS, | 263 | .nr_irqs = PCM027_NR_IRQS, |
264 | .init_irq = pxa27x_init_irq, | 264 | .init_irq = pxa27x_init_irq, |
265 | .handle_irq = pxa27x_handle_irq, | 265 | .handle_irq = pxa27x_handle_irq, |
266 | .timer = &pxa_timer, | 266 | .init_time = pxa_timer_init, |
267 | .init_machine = pcm027_init, | 267 | .init_machine = pcm027_init, |
268 | .restart = pxa_restart, | 268 | .restart = pxa_restart, |
269 | MACHINE_END | 269 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 2910bb935c75..50ccd5f1d560 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -469,7 +469,7 @@ MACHINE_START(POODLE, "SHARP Poodle") | |||
469 | .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */ | 469 | .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */ |
470 | .init_irq = pxa25x_init_irq, | 470 | .init_irq = pxa25x_init_irq, |
471 | .handle_irq = pxa25x_handle_irq, | 471 | .handle_irq = pxa25x_handle_irq, |
472 | .timer = &pxa_timer, | 472 | .init_time = pxa_timer_init, |
473 | .init_machine = poodle_init, | 473 | .init_machine = poodle_init, |
474 | .restart = pxa_restart, | 474 | .restart = pxa_restart, |
475 | MACHINE_END | 475 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/pxa-dt.c b/arch/arm/mach-pxa/pxa-dt.c index c9192cea0033..3835979a0dd3 100644 --- a/arch/arm/mach-pxa/pxa-dt.c +++ b/arch/arm/mach-pxa/pxa-dt.c | |||
@@ -55,7 +55,7 @@ DT_MACHINE_START(PXA_DT, "Marvell PXA3xx (Device Tree Support)") | |||
55 | .map_io = pxa3xx_map_io, | 55 | .map_io = pxa3xx_map_io, |
56 | .init_irq = pxa3xx_dt_init_irq, | 56 | .init_irq = pxa3xx_dt_init_irq, |
57 | .handle_irq = pxa3xx_handle_irq, | 57 | .handle_irq = pxa3xx_handle_irq, |
58 | .timer = &pxa_timer, | 58 | .init_time = pxa_timer_init, |
59 | .restart = pxa_restart, | 59 | .restart = pxa_restart, |
60 | .init_machine = pxa3xx_dt_init, | 60 | .init_machine = pxa3xx_dt_init, |
61 | .dt_compat = pxa3xx_dt_board_compat, | 61 | .dt_compat = pxa3xx_dt_board_compat, |
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index 25b08bfa997b..af41888acbd6 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c | |||
@@ -1095,7 +1095,7 @@ MACHINE_START(RAUMFELD_RC, "Raumfeld Controller") | |||
1095 | .nr_irqs = PXA_NR_IRQS, | 1095 | .nr_irqs = PXA_NR_IRQS, |
1096 | .init_irq = pxa3xx_init_irq, | 1096 | .init_irq = pxa3xx_init_irq, |
1097 | .handle_irq = pxa3xx_handle_irq, | 1097 | .handle_irq = pxa3xx_handle_irq, |
1098 | .timer = &pxa_timer, | 1098 | .init_time = pxa_timer_init, |
1099 | .restart = pxa_restart, | 1099 | .restart = pxa_restart, |
1100 | MACHINE_END | 1100 | MACHINE_END |
1101 | #endif | 1101 | #endif |
@@ -1108,7 +1108,7 @@ MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector") | |||
1108 | .nr_irqs = PXA_NR_IRQS, | 1108 | .nr_irqs = PXA_NR_IRQS, |
1109 | .init_irq = pxa3xx_init_irq, | 1109 | .init_irq = pxa3xx_init_irq, |
1110 | .handle_irq = pxa3xx_handle_irq, | 1110 | .handle_irq = pxa3xx_handle_irq, |
1111 | .timer = &pxa_timer, | 1111 | .init_time = pxa_timer_init, |
1112 | .restart = pxa_restart, | 1112 | .restart = pxa_restart, |
1113 | MACHINE_END | 1113 | MACHINE_END |
1114 | #endif | 1114 | #endif |
@@ -1121,7 +1121,7 @@ MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker") | |||
1121 | .nr_irqs = PXA_NR_IRQS, | 1121 | .nr_irqs = PXA_NR_IRQS, |
1122 | .init_irq = pxa3xx_init_irq, | 1122 | .init_irq = pxa3xx_init_irq, |
1123 | .handle_irq = pxa3xx_handle_irq, | 1123 | .handle_irq = pxa3xx_handle_irq, |
1124 | .timer = &pxa_timer, | 1124 | .init_time = pxa_timer_init, |
1125 | .restart = pxa_restart, | 1125 | .restart = pxa_restart, |
1126 | MACHINE_END | 1126 | MACHINE_END |
1127 | #endif | 1127 | #endif |
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c index 08d87a5d2639..710c493eac89 100644 --- a/arch/arm/mach-pxa/saar.c +++ b/arch/arm/mach-pxa/saar.c | |||
@@ -601,7 +601,7 @@ MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)") | |||
601 | .nr_irqs = PXA_NR_IRQS, | 601 | .nr_irqs = PXA_NR_IRQS, |
602 | .init_irq = pxa3xx_init_irq, | 602 | .init_irq = pxa3xx_init_irq, |
603 | .handle_irq = pxa3xx_handle_irq, | 603 | .handle_irq = pxa3xx_handle_irq, |
604 | .timer = &pxa_timer, | 604 | .init_time = pxa_timer_init, |
605 | .init_machine = saar_init, | 605 | .init_machine = saar_init, |
606 | .restart = pxa_restart, | 606 | .restart = pxa_restart, |
607 | MACHINE_END | 607 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 2073f0e6db0d..f90aa27ad599 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -986,7 +986,7 @@ MACHINE_START(SPITZ, "SHARP Spitz") | |||
986 | .init_irq = pxa27x_init_irq, | 986 | .init_irq = pxa27x_init_irq, |
987 | .handle_irq = pxa27x_handle_irq, | 987 | .handle_irq = pxa27x_handle_irq, |
988 | .init_machine = spitz_init, | 988 | .init_machine = spitz_init, |
989 | .timer = &pxa_timer, | 989 | .init_time = pxa_timer_init, |
990 | .restart = spitz_restart, | 990 | .restart = spitz_restart, |
991 | MACHINE_END | 991 | MACHINE_END |
992 | #endif | 992 | #endif |
@@ -1000,7 +1000,7 @@ MACHINE_START(BORZOI, "SHARP Borzoi") | |||
1000 | .init_irq = pxa27x_init_irq, | 1000 | .init_irq = pxa27x_init_irq, |
1001 | .handle_irq = pxa27x_handle_irq, | 1001 | .handle_irq = pxa27x_handle_irq, |
1002 | .init_machine = spitz_init, | 1002 | .init_machine = spitz_init, |
1003 | .timer = &pxa_timer, | 1003 | .init_time = pxa_timer_init, |
1004 | .restart = spitz_restart, | 1004 | .restart = spitz_restart, |
1005 | MACHINE_END | 1005 | MACHINE_END |
1006 | #endif | 1006 | #endif |
@@ -1014,7 +1014,7 @@ MACHINE_START(AKITA, "SHARP Akita") | |||
1014 | .init_irq = pxa27x_init_irq, | 1014 | .init_irq = pxa27x_init_irq, |
1015 | .handle_irq = pxa27x_handle_irq, | 1015 | .handle_irq = pxa27x_handle_irq, |
1016 | .init_machine = spitz_init, | 1016 | .init_machine = spitz_init, |
1017 | .timer = &pxa_timer, | 1017 | .init_time = pxa_timer_init, |
1018 | .restart = spitz_restart, | 1018 | .restart = spitz_restart, |
1019 | MACHINE_END | 1019 | MACHINE_END |
1020 | #endif | 1020 | #endif |
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c index 456560b5aad4..88fde43c948c 100644 --- a/arch/arm/mach-pxa/stargate2.c +++ b/arch/arm/mach-pxa/stargate2.c | |||
@@ -1006,7 +1006,7 @@ MACHINE_START(INTELMOTE2, "IMOTE 2") | |||
1006 | .nr_irqs = PXA_NR_IRQS, | 1006 | .nr_irqs = PXA_NR_IRQS, |
1007 | .init_irq = pxa27x_init_irq, | 1007 | .init_irq = pxa27x_init_irq, |
1008 | .handle_irq = pxa27x_handle_irq, | 1008 | .handle_irq = pxa27x_handle_irq, |
1009 | .timer = &pxa_timer, | 1009 | .init_time = pxa_timer_init, |
1010 | .init_machine = imote2_init, | 1010 | .init_machine = imote2_init, |
1011 | .atag_offset = 0x100, | 1011 | .atag_offset = 0x100, |
1012 | .restart = pxa_restart, | 1012 | .restart = pxa_restart, |
@@ -1019,7 +1019,7 @@ MACHINE_START(STARGATE2, "Stargate 2") | |||
1019 | .nr_irqs = STARGATE_NR_IRQS, | 1019 | .nr_irqs = STARGATE_NR_IRQS, |
1020 | .init_irq = pxa27x_init_irq, | 1020 | .init_irq = pxa27x_init_irq, |
1021 | .handle_irq = pxa27x_handle_irq, | 1021 | .handle_irq = pxa27x_handle_irq, |
1022 | .timer = &pxa_timer, | 1022 | .init_time = pxa_timer_init, |
1023 | .init_machine = stargate2_init, | 1023 | .init_machine = stargate2_init, |
1024 | .atag_offset = 0x100, | 1024 | .atag_offset = 0x100, |
1025 | .restart = pxa_restart, | 1025 | .restart = pxa_restart, |
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c index 1a25f8a7b0ce..f55979c09a5f 100644 --- a/arch/arm/mach-pxa/tavorevb.c +++ b/arch/arm/mach-pxa/tavorevb.c | |||
@@ -494,7 +494,7 @@ MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)") | |||
494 | .nr_irqs = PXA_NR_IRQS, | 494 | .nr_irqs = PXA_NR_IRQS, |
495 | .init_irq = pxa3xx_init_irq, | 495 | .init_irq = pxa3xx_init_irq, |
496 | .handle_irq = pxa3xx_handle_irq, | 496 | .handle_irq = pxa3xx_handle_irq, |
497 | .timer = &pxa_timer, | 497 | .init_time = pxa_timer_init, |
498 | .init_machine = tavorevb_init, | 498 | .init_machine = tavorevb_init, |
499 | .restart = pxa_restart, | 499 | .restart = pxa_restart, |
500 | MACHINE_END | 500 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index 4bc47d63698b..8f1ee92aea30 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c | |||
@@ -89,48 +89,10 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) | |||
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
92 | static struct clock_event_device ckevt_pxa_osmr0 = { | ||
93 | .name = "osmr0", | ||
94 | .features = CLOCK_EVT_FEAT_ONESHOT, | ||
95 | .rating = 200, | ||
96 | .set_next_event = pxa_osmr0_set_next_event, | ||
97 | .set_mode = pxa_osmr0_set_mode, | ||
98 | }; | ||
99 | |||
100 | static struct irqaction pxa_ost0_irq = { | ||
101 | .name = "ost0", | ||
102 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
103 | .handler = pxa_ost0_interrupt, | ||
104 | .dev_id = &ckevt_pxa_osmr0, | ||
105 | }; | ||
106 | |||
107 | static void __init pxa_timer_init(void) | ||
108 | { | ||
109 | unsigned long clock_tick_rate = get_clock_tick_rate(); | ||
110 | |||
111 | writel_relaxed(0, OIER); | ||
112 | writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR); | ||
113 | |||
114 | setup_sched_clock(pxa_read_sched_clock, 32, clock_tick_rate); | ||
115 | |||
116 | clockevents_calc_mult_shift(&ckevt_pxa_osmr0, clock_tick_rate, 4); | ||
117 | ckevt_pxa_osmr0.max_delta_ns = | ||
118 | clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0); | ||
119 | ckevt_pxa_osmr0.min_delta_ns = | ||
120 | clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1; | ||
121 | ckevt_pxa_osmr0.cpumask = cpumask_of(0); | ||
122 | |||
123 | setup_irq(IRQ_OST0, &pxa_ost0_irq); | ||
124 | |||
125 | clocksource_mmio_init(OSCR, "oscr0", clock_tick_rate, 200, 32, | ||
126 | clocksource_mmio_readl_up); | ||
127 | clockevents_register_device(&ckevt_pxa_osmr0); | ||
128 | } | ||
129 | |||
130 | #ifdef CONFIG_PM | 92 | #ifdef CONFIG_PM |
131 | static unsigned long osmr[4], oier, oscr; | 93 | static unsigned long osmr[4], oier, oscr; |
132 | 94 | ||
133 | static void pxa_timer_suspend(void) | 95 | static void pxa_timer_suspend(struct clock_event_device *cedev) |
134 | { | 96 | { |
135 | osmr[0] = readl_relaxed(OSMR0); | 97 | osmr[0] = readl_relaxed(OSMR0); |
136 | osmr[1] = readl_relaxed(OSMR1); | 98 | osmr[1] = readl_relaxed(OSMR1); |
@@ -140,7 +102,7 @@ static void pxa_timer_suspend(void) | |||
140 | oscr = readl_relaxed(OSCR); | 102 | oscr = readl_relaxed(OSCR); |
141 | } | 103 | } |
142 | 104 | ||
143 | static void pxa_timer_resume(void) | 105 | static void pxa_timer_resume(struct clock_event_device *cedev) |
144 | { | 106 | { |
145 | /* | 107 | /* |
146 | * Ensure that we have at least MIN_OSCR_DELTA between match | 108 | * Ensure that we have at least MIN_OSCR_DELTA between match |
@@ -163,8 +125,38 @@ static void pxa_timer_resume(void) | |||
163 | #define pxa_timer_resume NULL | 125 | #define pxa_timer_resume NULL |
164 | #endif | 126 | #endif |
165 | 127 | ||
166 | struct sys_timer pxa_timer = { | 128 | static struct clock_event_device ckevt_pxa_osmr0 = { |
167 | .init = pxa_timer_init, | 129 | .name = "osmr0", |
130 | .features = CLOCK_EVT_FEAT_ONESHOT, | ||
131 | .rating = 200, | ||
132 | .set_next_event = pxa_osmr0_set_next_event, | ||
133 | .set_mode = pxa_osmr0_set_mode, | ||
168 | .suspend = pxa_timer_suspend, | 134 | .suspend = pxa_timer_suspend, |
169 | .resume = pxa_timer_resume, | 135 | .resume = pxa_timer_resume, |
170 | }; | 136 | }; |
137 | |||
138 | static struct irqaction pxa_ost0_irq = { | ||
139 | .name = "ost0", | ||
140 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
141 | .handler = pxa_ost0_interrupt, | ||
142 | .dev_id = &ckevt_pxa_osmr0, | ||
143 | }; | ||
144 | |||
145 | void __init pxa_timer_init(void) | ||
146 | { | ||
147 | unsigned long clock_tick_rate = get_clock_tick_rate(); | ||
148 | |||
149 | writel_relaxed(0, OIER); | ||
150 | writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR); | ||
151 | |||
152 | setup_sched_clock(pxa_read_sched_clock, 32, clock_tick_rate); | ||
153 | |||
154 | ckevt_pxa_osmr0.cpumask = cpumask_of(0); | ||
155 | |||
156 | setup_irq(IRQ_OST0, &pxa_ost0_irq); | ||
157 | |||
158 | clocksource_mmio_init(OSCR, "oscr0", clock_tick_rate, 200, 32, | ||
159 | clocksource_mmio_readl_up); | ||
160 | clockevents_config_and_register(&ckevt_pxa_osmr0, clock_tick_rate, | ||
161 | MIN_OSCR_DELTA * 2, 0x7fffffff); | ||
162 | } | ||
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 233629edf7ee..9e7998d3635f 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -982,6 +982,6 @@ MACHINE_START(TOSA, "SHARP Tosa") | |||
982 | .init_irq = pxa25x_init_irq, | 982 | .init_irq = pxa25x_init_irq, |
983 | .handle_irq = pxa25x_handle_irq, | 983 | .handle_irq = pxa25x_handle_irq, |
984 | .init_machine = tosa_init, | 984 | .init_machine = tosa_init, |
985 | .timer = &pxa_timer, | 985 | .init_time = pxa_timer_init, |
986 | .restart = tosa_restart, | 986 | .restart = tosa_restart, |
987 | MACHINE_END | 987 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c index fbbcbed4d1d4..c58043462acd 100644 --- a/arch/arm/mach-pxa/trizeps4.c +++ b/arch/arm/mach-pxa/trizeps4.c | |||
@@ -561,7 +561,7 @@ MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module") | |||
561 | .nr_irqs = PXA_NR_IRQS, | 561 | .nr_irqs = PXA_NR_IRQS, |
562 | .init_irq = pxa27x_init_irq, | 562 | .init_irq = pxa27x_init_irq, |
563 | .handle_irq = pxa27x_handle_irq, | 563 | .handle_irq = pxa27x_handle_irq, |
564 | .timer = &pxa_timer, | 564 | .init_time = pxa_timer_init, |
565 | .restart = pxa_restart, | 565 | .restart = pxa_restart, |
566 | MACHINE_END | 566 | MACHINE_END |
567 | 567 | ||
@@ -573,6 +573,6 @@ MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module") | |||
573 | .nr_irqs = PXA_NR_IRQS, | 573 | .nr_irqs = PXA_NR_IRQS, |
574 | .init_irq = pxa27x_init_irq, | 574 | .init_irq = pxa27x_init_irq, |
575 | .handle_irq = pxa27x_handle_irq, | 575 | .handle_irq = pxa27x_handle_irq, |
576 | .timer = &pxa_timer, | 576 | .init_time = pxa_timer_init, |
577 | .restart = pxa_restart, | 577 | .restart = pxa_restart, |
578 | MACHINE_END | 578 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index c773e4dded64..9c363c081d3f 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c | |||
@@ -997,7 +997,7 @@ MACHINE_START(VIPER, "Arcom/Eurotech VIPER SBC") | |||
997 | .nr_irqs = PXA_NR_IRQS, | 997 | .nr_irqs = PXA_NR_IRQS, |
998 | .init_irq = viper_init_irq, | 998 | .init_irq = viper_init_irq, |
999 | .handle_irq = pxa25x_handle_irq, | 999 | .handle_irq = pxa25x_handle_irq, |
1000 | .timer = &pxa_timer, | 1000 | .init_time = pxa_timer_init, |
1001 | .init_machine = viper_init, | 1001 | .init_machine = viper_init, |
1002 | .restart = pxa_restart, | 1002 | .restart = pxa_restart, |
1003 | MACHINE_END | 1003 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index 491b6c9a2a9b..aa89488f961e 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c | |||
@@ -719,7 +719,7 @@ MACHINE_START(VPAC270, "Voipac PXA270") | |||
719 | .nr_irqs = PXA_NR_IRQS, | 719 | .nr_irqs = PXA_NR_IRQS, |
720 | .init_irq = pxa27x_init_irq, | 720 | .init_irq = pxa27x_init_irq, |
721 | .handle_irq = pxa27x_handle_irq, | 721 | .handle_irq = pxa27x_handle_irq, |
722 | .timer = &pxa_timer, | 722 | .init_time = pxa_timer_init, |
723 | .init_machine = vpac270_init, | 723 | .init_machine = vpac270_init, |
724 | .restart = pxa_restart, | 724 | .restart = pxa_restart, |
725 | MACHINE_END | 725 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c index 4275713ccd10..13b1d4586d7d 100644 --- a/arch/arm/mach-pxa/xcep.c +++ b/arch/arm/mach-pxa/xcep.c | |||
@@ -185,7 +185,7 @@ MACHINE_START(XCEP, "Iskratel XCEP") | |||
185 | .nr_irqs = PXA_NR_IRQS, | 185 | .nr_irqs = PXA_NR_IRQS, |
186 | .init_irq = pxa25x_init_irq, | 186 | .init_irq = pxa25x_init_irq, |
187 | .handle_irq = pxa25x_handle_irq, | 187 | .handle_irq = pxa25x_handle_irq, |
188 | .timer = &pxa_timer, | 188 | .init_time = pxa_timer_init, |
189 | .restart = pxa_restart, | 189 | .restart = pxa_restart, |
190 | MACHINE_END | 190 | MACHINE_END |
191 | 191 | ||
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 97529face7aa..989903a7e467 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c | |||
@@ -722,7 +722,7 @@ MACHINE_START(ZIPIT2, "Zipit Z2") | |||
722 | .nr_irqs = PXA_NR_IRQS, | 722 | .nr_irqs = PXA_NR_IRQS, |
723 | .init_irq = pxa27x_init_irq, | 723 | .init_irq = pxa27x_init_irq, |
724 | .handle_irq = pxa27x_handle_irq, | 724 | .handle_irq = pxa27x_handle_irq, |
725 | .timer = &pxa_timer, | 725 | .init_time = pxa_timer_init, |
726 | .init_machine = z2_init, | 726 | .init_machine = z2_init, |
727 | .restart = pxa_restart, | 727 | .restart = pxa_restart, |
728 | MACHINE_END | 728 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index abd3aa145083..f5d436434566 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c | |||
@@ -910,7 +910,7 @@ MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS") | |||
910 | .nr_irqs = ZEUS_NR_IRQS, | 910 | .nr_irqs = ZEUS_NR_IRQS, |
911 | .init_irq = zeus_init_irq, | 911 | .init_irq = zeus_init_irq, |
912 | .handle_irq = pxa27x_handle_irq, | 912 | .handle_irq = pxa27x_handle_irq, |
913 | .timer = &pxa_timer, | 913 | .init_time = pxa_timer_init, |
914 | .init_machine = zeus_init, | 914 | .init_machine = zeus_init, |
915 | .restart = pxa_restart, | 915 | .restart = pxa_restart, |
916 | MACHINE_END | 916 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 226279fac9d4..1f00d650ac27 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c | |||
@@ -428,7 +428,7 @@ MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") | |||
428 | .nr_irqs = ZYLONITE_NR_IRQS, | 428 | .nr_irqs = ZYLONITE_NR_IRQS, |
429 | .init_irq = pxa3xx_init_irq, | 429 | .init_irq = pxa3xx_init_irq, |
430 | .handle_irq = pxa3xx_handle_irq, | 430 | .handle_irq = pxa3xx_handle_irq, |
431 | .timer = &pxa_timer, | 431 | .init_time = pxa_timer_init, |
432 | .init_machine = zylonite_init, | 432 | .init_machine = zylonite_init, |
433 | .restart = pxa_restart, | 433 | .restart = pxa_restart, |
434 | MACHINE_END | 434 | MACHINE_END |
diff --git a/arch/arm/mach-realview/include/mach/irqs-eb.h b/arch/arm/mach-realview/include/mach/irqs-eb.h index d6b5073692d2..44754230fdcc 100644 --- a/arch/arm/mach-realview/include/mach/irqs-eb.h +++ b/arch/arm/mach-realview/include/mach/irqs-eb.h | |||
@@ -115,7 +115,7 @@ | |||
115 | /* | 115 | /* |
116 | * Only define NR_IRQS if less than NR_IRQS_EB | 116 | * Only define NR_IRQS if less than NR_IRQS_EB |
117 | */ | 117 | */ |
118 | #define NR_IRQS_EB (IRQ_EB_GIC_START + 96) | 118 | #define NR_IRQS_EB (IRQ_EB_GIC_START + 128) |
119 | 119 | ||
120 | #if defined(CONFIG_MACH_REALVIEW_EB) \ | 120 | #if defined(CONFIG_MACH_REALVIEW_EB) \ |
121 | && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB)) | 121 | && (!defined(NR_IRQS) || (NR_IRQS < NR_IRQS_EB)) |
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index 728587c60770..5b1c8bfe6fa9 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -418,10 +418,6 @@ static void __init realview_eb_timer_init(void) | |||
418 | realview_eb_twd_init(); | 418 | realview_eb_twd_init(); |
419 | } | 419 | } |
420 | 420 | ||
421 | static struct sys_timer realview_eb_timer = { | ||
422 | .init = realview_eb_timer_init, | ||
423 | }; | ||
424 | |||
425 | static void realview_eb_restart(char mode, const char *cmd) | 421 | static void realview_eb_restart(char mode, const char *cmd) |
426 | { | 422 | { |
427 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); | 423 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); |
@@ -472,7 +468,7 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB") | |||
472 | .map_io = realview_eb_map_io, | 468 | .map_io = realview_eb_map_io, |
473 | .init_early = realview_init_early, | 469 | .init_early = realview_init_early, |
474 | .init_irq = gic_init_irq, | 470 | .init_irq = gic_init_irq, |
475 | .timer = &realview_eb_timer, | 471 | .init_time = realview_eb_timer_init, |
476 | .init_machine = realview_eb_init, | 472 | .init_machine = realview_eb_init, |
477 | #ifdef CONFIG_ZONE_DMA | 473 | #ifdef CONFIG_ZONE_DMA |
478 | .dma_zone_size = SZ_256M, | 474 | .dma_zone_size = SZ_256M, |
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index 3d116c44c0d4..d5e83a1f6982 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -329,10 +329,6 @@ static void __init realview_pb1176_timer_init(void) | |||
329 | realview_timer_init(IRQ_DC1176_TIMER0); | 329 | realview_timer_init(IRQ_DC1176_TIMER0); |
330 | } | 330 | } |
331 | 331 | ||
332 | static struct sys_timer realview_pb1176_timer = { | ||
333 | .init = realview_pb1176_timer_init, | ||
334 | }; | ||
335 | |||
336 | static void realview_pb1176_restart(char mode, const char *cmd) | 332 | static void realview_pb1176_restart(char mode, const char *cmd) |
337 | { | 333 | { |
338 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); | 334 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); |
@@ -384,7 +380,7 @@ MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176") | |||
384 | .map_io = realview_pb1176_map_io, | 380 | .map_io = realview_pb1176_map_io, |
385 | .init_early = realview_init_early, | 381 | .init_early = realview_init_early, |
386 | .init_irq = gic_init_irq, | 382 | .init_irq = gic_init_irq, |
387 | .timer = &realview_pb1176_timer, | 383 | .init_time = realview_pb1176_timer_init, |
388 | .init_machine = realview_pb1176_init, | 384 | .init_machine = realview_pb1176_init, |
389 | #ifdef CONFIG_ZONE_DMA | 385 | #ifdef CONFIG_ZONE_DMA |
390 | .dma_zone_size = SZ_256M, | 386 | .dma_zone_size = SZ_256M, |
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index e1b8efdf35b6..c3cfe213b5e6 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -316,10 +316,6 @@ static void __init realview_pb11mp_timer_init(void) | |||
316 | realview_pb11mp_twd_init(); | 316 | realview_pb11mp_twd_init(); |
317 | } | 317 | } |
318 | 318 | ||
319 | static struct sys_timer realview_pb11mp_timer = { | ||
320 | .init = realview_pb11mp_timer_init, | ||
321 | }; | ||
322 | |||
323 | static void realview_pb11mp_restart(char mode, const char *cmd) | 319 | static void realview_pb11mp_restart(char mode, const char *cmd) |
324 | { | 320 | { |
325 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); | 321 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); |
@@ -367,7 +363,7 @@ MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore") | |||
367 | .map_io = realview_pb11mp_map_io, | 363 | .map_io = realview_pb11mp_map_io, |
368 | .init_early = realview_init_early, | 364 | .init_early = realview_init_early, |
369 | .init_irq = gic_init_irq, | 365 | .init_irq = gic_init_irq, |
370 | .timer = &realview_pb11mp_timer, | 366 | .init_time = realview_pb11mp_timer_init, |
371 | .init_machine = realview_pb11mp_init, | 367 | .init_machine = realview_pb11mp_init, |
372 | #ifdef CONFIG_ZONE_DMA | 368 | #ifdef CONFIG_ZONE_DMA |
373 | .dma_zone_size = SZ_256M, | 369 | .dma_zone_size = SZ_256M, |
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index 0b037f23b0f6..dde652a59620 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
@@ -264,10 +264,6 @@ static void __init realview_pba8_timer_init(void) | |||
264 | realview_timer_init(IRQ_PBA8_TIMER0_1); | 264 | realview_timer_init(IRQ_PBA8_TIMER0_1); |
265 | } | 265 | } |
266 | 266 | ||
267 | static struct sys_timer realview_pba8_timer = { | ||
268 | .init = realview_pba8_timer_init, | ||
269 | }; | ||
270 | |||
271 | static void realview_pba8_restart(char mode, const char *cmd) | 267 | static void realview_pba8_restart(char mode, const char *cmd) |
272 | { | 268 | { |
273 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); | 269 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); |
@@ -308,7 +304,7 @@ MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8") | |||
308 | .map_io = realview_pba8_map_io, | 304 | .map_io = realview_pba8_map_io, |
309 | .init_early = realview_init_early, | 305 | .init_early = realview_init_early, |
310 | .init_irq = gic_init_irq, | 306 | .init_irq = gic_init_irq, |
311 | .timer = &realview_pba8_timer, | 307 | .init_time = realview_pba8_timer_init, |
312 | .init_machine = realview_pba8_init, | 308 | .init_machine = realview_pba8_init, |
313 | #ifdef CONFIG_ZONE_DMA | 309 | #ifdef CONFIG_ZONE_DMA |
314 | .dma_zone_size = SZ_256M, | 310 | .dma_zone_size = SZ_256M, |
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index a1f1ef557c67..54f0185b01e3 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c | |||
@@ -324,10 +324,6 @@ static void __init realview_pbx_timer_init(void) | |||
324 | realview_pbx_twd_init(); | 324 | realview_pbx_twd_init(); |
325 | } | 325 | } |
326 | 326 | ||
327 | static struct sys_timer realview_pbx_timer = { | ||
328 | .init = realview_pbx_timer_init, | ||
329 | }; | ||
330 | |||
331 | static void realview_pbx_fixup(struct tag *tags, char **from, | 327 | static void realview_pbx_fixup(struct tag *tags, char **from, |
332 | struct meminfo *meminfo) | 328 | struct meminfo *meminfo) |
333 | { | 329 | { |
@@ -404,7 +400,7 @@ MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") | |||
404 | .map_io = realview_pbx_map_io, | 400 | .map_io = realview_pbx_map_io, |
405 | .init_early = realview_init_early, | 401 | .init_early = realview_init_early, |
406 | .init_irq = gic_init_irq, | 402 | .init_irq = gic_init_irq, |
407 | .timer = &realview_pbx_timer, | 403 | .init_time = realview_pbx_timer_init, |
408 | .init_machine = realview_pbx_init, | 404 | .init_machine = realview_pbx_init, |
409 | #ifdef CONFIG_ZONE_DMA | 405 | #ifdef CONFIG_ZONE_DMA |
410 | .dma_zone_size = SZ_256M, | 406 | .dma_zone_size = SZ_256M, |
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c index f3fa259ce01f..a302cf5e0fc7 100644 --- a/arch/arm/mach-rpc/riscpc.c +++ b/arch/arm/mach-rpc/riscpc.c | |||
@@ -211,7 +211,7 @@ static void rpc_restart(char mode, const char *cmd) | |||
211 | soft_restart(0); | 211 | soft_restart(0); |
212 | } | 212 | } |
213 | 213 | ||
214 | extern struct sys_timer ioc_timer; | 214 | void ioc_timer_init(void); |
215 | 215 | ||
216 | MACHINE_START(RISCPC, "Acorn-RiscPC") | 216 | MACHINE_START(RISCPC, "Acorn-RiscPC") |
217 | /* Maintainer: Russell King */ | 217 | /* Maintainer: Russell King */ |
@@ -220,6 +220,6 @@ MACHINE_START(RISCPC, "Acorn-RiscPC") | |||
220 | .reserve_lp1 = 1, | 220 | .reserve_lp1 = 1, |
221 | .map_io = rpc_map_io, | 221 | .map_io = rpc_map_io, |
222 | .init_irq = rpc_init_irq, | 222 | .init_irq = rpc_init_irq, |
223 | .timer = &ioc_timer, | 223 | .init_time = ioc_timer_init, |
224 | .restart = rpc_restart, | 224 | .restart = rpc_restart, |
225 | MACHINE_END | 225 | MACHINE_END |
diff --git a/arch/arm/mach-rpc/time.c b/arch/arm/mach-rpc/time.c index 581fca934bb3..9a6def14df01 100644 --- a/arch/arm/mach-rpc/time.c +++ b/arch/arm/mach-rpc/time.c | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include <asm/mach/time.h> | 25 | #include <asm/mach/time.h> |
26 | 26 | ||
27 | unsigned long ioc_timer_gettimeoffset(void) | 27 | static u32 ioc_timer_gettimeoffset(void) |
28 | { | 28 | { |
29 | unsigned int count1, count2, status; | 29 | unsigned int count1, count2, status; |
30 | long offset; | 30 | long offset; |
@@ -56,7 +56,7 @@ unsigned long ioc_timer_gettimeoffset(void) | |||
56 | } | 56 | } |
57 | 57 | ||
58 | offset = (LATCH - offset) * (tick_nsec / 1000); | 58 | offset = (LATCH - offset) * (tick_nsec / 1000); |
59 | return (offset + LATCH/2) / LATCH; | 59 | return ((offset + LATCH/2) / LATCH) * 1000; |
60 | } | 60 | } |
61 | 61 | ||
62 | void __init ioctime_init(void) | 62 | void __init ioctime_init(void) |
@@ -82,14 +82,9 @@ static struct irqaction ioc_timer_irq = { | |||
82 | /* | 82 | /* |
83 | * Set up timer interrupt. | 83 | * Set up timer interrupt. |
84 | */ | 84 | */ |
85 | static void __init ioc_timer_init(void) | 85 | void __init ioc_timer_init(void) |
86 | { | 86 | { |
87 | arch_gettimeoffset = ioc_timer_gettimeoffset; | ||
87 | ioctime_init(); | 88 | ioctime_init(); |
88 | setup_irq(IRQ_TIMER0, &ioc_timer_irq); | 89 | setup_irq(IRQ_TIMER0, &ioc_timer_irq); |
89 | } | 90 | } |
90 | |||
91 | struct sys_timer ioc_timer = { | ||
92 | .init = ioc_timer_init, | ||
93 | .offset = ioc_timer_gettimeoffset, | ||
94 | }; | ||
95 | |||
diff --git a/arch/arm/mach-s3c24xx/mach-amlm5900.c b/arch/arm/mach-s3c24xx/mach-amlm5900.c index f4ad99c1e476..0e0279e79150 100644 --- a/arch/arm/mach-s3c24xx/mach-amlm5900.c +++ b/arch/arm/mach-s3c24xx/mach-amlm5900.c | |||
@@ -237,6 +237,6 @@ MACHINE_START(AML_M5900, "AML_M5900") | |||
237 | .map_io = amlm5900_map_io, | 237 | .map_io = amlm5900_map_io, |
238 | .init_irq = s3c24xx_init_irq, | 238 | .init_irq = s3c24xx_init_irq, |
239 | .init_machine = amlm5900_init, | 239 | .init_machine = amlm5900_init, |
240 | .timer = &s3c24xx_timer, | 240 | .init_time = s3c24xx_timer_init, |
241 | .restart = s3c2410_restart, | 241 | .restart = s3c2410_restart, |
242 | MACHINE_END | 242 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c index 1ee8c4638743..85eefab881af 100644 --- a/arch/arm/mach-s3c24xx/mach-anubis.c +++ b/arch/arm/mach-s3c24xx/mach-anubis.c | |||
@@ -448,6 +448,6 @@ MACHINE_START(ANUBIS, "Simtec-Anubis") | |||
448 | .map_io = anubis_map_io, | 448 | .map_io = anubis_map_io, |
449 | .init_machine = anubis_init, | 449 | .init_machine = anubis_init, |
450 | .init_irq = s3c24xx_init_irq, | 450 | .init_irq = s3c24xx_init_irq, |
451 | .timer = &s3c24xx_timer, | 451 | .init_time = s3c24xx_timer_init, |
452 | .restart = s3c244x_restart, | 452 | .restart = s3c244x_restart, |
453 | MACHINE_END | 453 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c index 00381fe5de32..b31c4aa724f2 100644 --- a/arch/arm/mach-s3c24xx/mach-at2440evb.c +++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c | |||
@@ -210,6 +210,6 @@ MACHINE_START(AT2440EVB, "AT2440EVB") | |||
210 | .map_io = at2440evb_map_io, | 210 | .map_io = at2440evb_map_io, |
211 | .init_machine = at2440evb_init, | 211 | .init_machine = at2440evb_init, |
212 | .init_irq = s3c24xx_init_irq, | 212 | .init_irq = s3c24xx_init_irq, |
213 | .timer = &s3c24xx_timer, | 213 | .init_time = s3c24xx_timer_init, |
214 | .restart = s3c244x_restart, | 214 | .restart = s3c244x_restart, |
215 | MACHINE_END | 215 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c index 6a30ce7e4aa7..526964c19dd8 100644 --- a/arch/arm/mach-s3c24xx/mach-bast.c +++ b/arch/arm/mach-s3c24xx/mach-bast.c | |||
@@ -612,6 +612,6 @@ MACHINE_START(BAST, "Simtec-BAST") | |||
612 | .map_io = bast_map_io, | 612 | .map_io = bast_map_io, |
613 | .init_irq = s3c24xx_init_irq, | 613 | .init_irq = s3c24xx_init_irq, |
614 | .init_machine = bast_init, | 614 | .init_machine = bast_init, |
615 | .timer = &s3c24xx_timer, | 615 | .init_time = s3c24xx_timer_init, |
616 | .restart = s3c2410_restart, | 616 | .restart = s3c2410_restart, |
617 | MACHINE_END | 617 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c index 973b87ca87f4..fb5d3b3b53db 100644 --- a/arch/arm/mach-s3c24xx/mach-gta02.c +++ b/arch/arm/mach-s3c24xx/mach-gta02.c | |||
@@ -595,6 +595,6 @@ MACHINE_START(NEO1973_GTA02, "GTA02") | |||
595 | .map_io = gta02_map_io, | 595 | .map_io = gta02_map_io, |
596 | .init_irq = s3c24xx_init_irq, | 596 | .init_irq = s3c24xx_init_irq, |
597 | .init_machine = gta02_machine_init, | 597 | .init_machine = gta02_machine_init, |
598 | .timer = &s3c24xx_timer, | 598 | .init_time = s3c24xx_timer_init, |
599 | .restart = s3c244x_restart, | 599 | .restart = s3c244x_restart, |
600 | MACHINE_END | 600 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c index b23dd1b106e8..2eb09e27c13c 100644 --- a/arch/arm/mach-s3c24xx/mach-h1940.c +++ b/arch/arm/mach-s3c24xx/mach-h1940.c | |||
@@ -746,6 +746,6 @@ MACHINE_START(H1940, "IPAQ-H1940") | |||
746 | .reserve = h1940_reserve, | 746 | .reserve = h1940_reserve, |
747 | .init_irq = h1940_init_irq, | 747 | .init_irq = h1940_init_irq, |
748 | .init_machine = h1940_init, | 748 | .init_machine = h1940_init, |
749 | .timer = &s3c24xx_timer, | 749 | .init_time = s3c24xx_timer_init, |
750 | .restart = s3c2410_restart, | 750 | .restart = s3c2410_restart, |
751 | MACHINE_END | 751 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c index c9954e26b492..d7a172555238 100644 --- a/arch/arm/mach-s3c24xx/mach-jive.c +++ b/arch/arm/mach-s3c24xx/mach-jive.c | |||
@@ -661,6 +661,6 @@ MACHINE_START(JIVE, "JIVE") | |||
661 | .init_irq = s3c24xx_init_irq, | 661 | .init_irq = s3c24xx_init_irq, |
662 | .map_io = jive_map_io, | 662 | .map_io = jive_map_io, |
663 | .init_machine = jive_machine_init, | 663 | .init_machine = jive_machine_init, |
664 | .timer = &s3c24xx_timer, | 664 | .init_time = s3c24xx_timer_init, |
665 | .restart = s3c2412_restart, | 665 | .restart = s3c2412_restart, |
666 | MACHINE_END | 666 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c index a31d5b83e5f7..2db09ade9b50 100644 --- a/arch/arm/mach-s3c24xx/mach-mini2440.c +++ b/arch/arm/mach-s3c24xx/mach-mini2440.c | |||
@@ -688,6 +688,6 @@ MACHINE_START(MINI2440, "MINI2440") | |||
688 | .map_io = mini2440_map_io, | 688 | .map_io = mini2440_map_io, |
689 | .init_machine = mini2440_init, | 689 | .init_machine = mini2440_init, |
690 | .init_irq = s3c24xx_init_irq, | 690 | .init_irq = s3c24xx_init_irq, |
691 | .timer = &s3c24xx_timer, | 691 | .init_time = s3c24xx_timer_init, |
692 | .restart = s3c244x_restart, | 692 | .restart = s3c244x_restart, |
693 | MACHINE_END | 693 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c index c53a9bfe1417..d9d04b240295 100644 --- a/arch/arm/mach-s3c24xx/mach-n30.c +++ b/arch/arm/mach-s3c24xx/mach-n30.c | |||
@@ -589,7 +589,7 @@ MACHINE_START(N30, "Acer-N30") | |||
589 | Ben Dooks <ben-linux@fluff.org> | 589 | Ben Dooks <ben-linux@fluff.org> |
590 | */ | 590 | */ |
591 | .atag_offset = 0x100, | 591 | .atag_offset = 0x100, |
592 | .timer = &s3c24xx_timer, | 592 | .init_time = s3c24xx_timer_init, |
593 | .init_machine = n30_init, | 593 | .init_machine = n30_init, |
594 | .init_irq = s3c24xx_init_irq, | 594 | .init_irq = s3c24xx_init_irq, |
595 | .map_io = n30_map_io, | 595 | .map_io = n30_map_io, |
@@ -600,7 +600,7 @@ MACHINE_START(N35, "Acer-N35") | |||
600 | /* Maintainer: Christer Weinigel <christer@weinigel.se> | 600 | /* Maintainer: Christer Weinigel <christer@weinigel.se> |
601 | */ | 601 | */ |
602 | .atag_offset = 0x100, | 602 | .atag_offset = 0x100, |
603 | .timer = &s3c24xx_timer, | 603 | .init_time = s3c24xx_timer_init, |
604 | .init_machine = n30_init, | 604 | .init_machine = n30_init, |
605 | .init_irq = s3c24xx_init_irq, | 605 | .init_irq = s3c24xx_init_irq, |
606 | .map_io = n30_map_io, | 606 | .map_io = n30_map_io, |
diff --git a/arch/arm/mach-s3c24xx/mach-nexcoder.c b/arch/arm/mach-s3c24xx/mach-nexcoder.c index a2b92b0898e2..a454e2461860 100644 --- a/arch/arm/mach-s3c24xx/mach-nexcoder.c +++ b/arch/arm/mach-s3c24xx/mach-nexcoder.c | |||
@@ -153,6 +153,6 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") | |||
153 | .map_io = nexcoder_map_io, | 153 | .map_io = nexcoder_map_io, |
154 | .init_machine = nexcoder_init, | 154 | .init_machine = nexcoder_init, |
155 | .init_irq = s3c24xx_init_irq, | 155 | .init_irq = s3c24xx_init_irq, |
156 | .timer = &s3c24xx_timer, | 156 | .init_time = s3c24xx_timer_init, |
157 | .restart = s3c244x_restart, | 157 | .restart = s3c244x_restart, |
158 | MACHINE_END | 158 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c index bb36d832bd3d..ba0f5b5ec19e 100644 --- a/arch/arm/mach-s3c24xx/mach-osiris.c +++ b/arch/arm/mach-s3c24xx/mach-osiris.c | |||
@@ -428,6 +428,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS") | |||
428 | .map_io = osiris_map_io, | 428 | .map_io = osiris_map_io, |
429 | .init_irq = s3c24xx_init_irq, | 429 | .init_irq = s3c24xx_init_irq, |
430 | .init_machine = osiris_init, | 430 | .init_machine = osiris_init, |
431 | .timer = &s3c24xx_timer, | 431 | .init_time = s3c24xx_timer_init, |
432 | .restart = s3c244x_restart, | 432 | .restart = s3c244x_restart, |
433 | MACHINE_END | 433 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-otom.c b/arch/arm/mach-s3c24xx/mach-otom.c index bca39f0232b3..e0fdae93aa7b 100644 --- a/arch/arm/mach-s3c24xx/mach-otom.c +++ b/arch/arm/mach-s3c24xx/mach-otom.c | |||
@@ -118,6 +118,6 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1") | |||
118 | .map_io = otom11_map_io, | 118 | .map_io = otom11_map_io, |
119 | .init_machine = otom11_init, | 119 | .init_machine = otom11_init, |
120 | .init_irq = s3c24xx_init_irq, | 120 | .init_irq = s3c24xx_init_irq, |
121 | .timer = &s3c24xx_timer, | 121 | .init_time = s3c24xx_timer_init, |
122 | .restart = s3c2410_restart, | 122 | .restart = s3c2410_restart, |
123 | MACHINE_END | 123 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c index 7b6ba13d7285..56175f0941b1 100644 --- a/arch/arm/mach-s3c24xx/mach-qt2410.c +++ b/arch/arm/mach-s3c24xx/mach-qt2410.c | |||
@@ -343,6 +343,6 @@ MACHINE_START(QT2410, "QT2410") | |||
343 | .map_io = qt2410_map_io, | 343 | .map_io = qt2410_map_io, |
344 | .init_irq = s3c24xx_init_irq, | 344 | .init_irq = s3c24xx_init_irq, |
345 | .init_machine = qt2410_machine_init, | 345 | .init_machine = qt2410_machine_init, |
346 | .timer = &s3c24xx_timer, | 346 | .init_time = s3c24xx_timer_init, |
347 | .restart = s3c2410_restart, | 347 | .restart = s3c2410_restart, |
348 | MACHINE_END | 348 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c index 0606f2faaa5c..e14ec7105a6d 100644 --- a/arch/arm/mach-s3c24xx/mach-rx1950.c +++ b/arch/arm/mach-s3c24xx/mach-rx1950.c | |||
@@ -814,6 +814,6 @@ MACHINE_START(RX1950, "HP iPAQ RX1950") | |||
814 | .reserve = rx1950_reserve, | 814 | .reserve = rx1950_reserve, |
815 | .init_irq = s3c24xx_init_irq, | 815 | .init_irq = s3c24xx_init_irq, |
816 | .init_machine = rx1950_init_machine, | 816 | .init_machine = rx1950_init_machine, |
817 | .timer = &s3c24xx_timer, | 817 | .init_time = s3c24xx_timer_init, |
818 | .restart = s3c244x_restart, | 818 | .restart = s3c244x_restart, |
819 | MACHINE_END | 819 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-rx3715.c b/arch/arm/mach-s3c24xx/mach-rx3715.c index dacbb9a2122a..d00caa8de922 100644 --- a/arch/arm/mach-s3c24xx/mach-rx3715.c +++ b/arch/arm/mach-s3c24xx/mach-rx3715.c | |||
@@ -212,6 +212,6 @@ MACHINE_START(RX3715, "IPAQ-RX3715") | |||
212 | .reserve = rx3715_reserve, | 212 | .reserve = rx3715_reserve, |
213 | .init_irq = rx3715_init_irq, | 213 | .init_irq = rx3715_init_irq, |
214 | .init_machine = rx3715_init_machine, | 214 | .init_machine = rx3715_init_machine, |
215 | .timer = &s3c24xx_timer, | 215 | .init_time = s3c24xx_timer_init, |
216 | .restart = s3c244x_restart, | 216 | .restart = s3c244x_restart, |
217 | MACHINE_END | 217 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2410.c b/arch/arm/mach-s3c24xx/mach-smdk2410.c index 82796b97cb04..e184bfa9613a 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2410.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2410.c | |||
@@ -117,6 +117,6 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc | |||
117 | .map_io = smdk2410_map_io, | 117 | .map_io = smdk2410_map_io, |
118 | .init_irq = s3c24xx_init_irq, | 118 | .init_irq = s3c24xx_init_irq, |
119 | .init_machine = smdk2410_init, | 119 | .init_machine = smdk2410_init, |
120 | .timer = &s3c24xx_timer, | 120 | .init_time = s3c24xx_timer_init, |
121 | .restart = s3c2410_restart, | 121 | .restart = s3c2410_restart, |
122 | MACHINE_END | 122 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c index ce99fd8bbbc5..69f356e83790 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2413.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c | |||
@@ -133,7 +133,7 @@ MACHINE_START(S3C2413, "S3C2413") | |||
133 | .init_irq = s3c24xx_init_irq, | 133 | .init_irq = s3c24xx_init_irq, |
134 | .map_io = smdk2413_map_io, | 134 | .map_io = smdk2413_map_io, |
135 | .init_machine = smdk2413_machine_init, | 135 | .init_machine = smdk2413_machine_init, |
136 | .timer = &s3c24xx_timer, | 136 | .init_time = s3c24xx_timer_init, |
137 | .restart = s3c2412_restart, | 137 | .restart = s3c2412_restart, |
138 | MACHINE_END | 138 | MACHINE_END |
139 | 139 | ||
@@ -145,7 +145,7 @@ MACHINE_START(SMDK2412, "SMDK2412") | |||
145 | .init_irq = s3c24xx_init_irq, | 145 | .init_irq = s3c24xx_init_irq, |
146 | .map_io = smdk2413_map_io, | 146 | .map_io = smdk2413_map_io, |
147 | .init_machine = smdk2413_machine_init, | 147 | .init_machine = smdk2413_machine_init, |
148 | .timer = &s3c24xx_timer, | 148 | .init_time = s3c24xx_timer_init, |
149 | .restart = s3c2412_restart, | 149 | .restart = s3c2412_restart, |
150 | MACHINE_END | 150 | MACHINE_END |
151 | 151 | ||
@@ -157,6 +157,6 @@ MACHINE_START(SMDK2413, "SMDK2413") | |||
157 | .init_irq = s3c24xx_init_irq, | 157 | .init_irq = s3c24xx_init_irq, |
158 | .map_io = smdk2413_map_io, | 158 | .map_io = smdk2413_map_io, |
159 | .init_machine = smdk2413_machine_init, | 159 | .init_machine = smdk2413_machine_init, |
160 | .timer = &s3c24xx_timer, | 160 | .init_time = s3c24xx_timer_init, |
161 | .restart = s3c2412_restart, | 161 | .restart = s3c2412_restart, |
162 | MACHINE_END | 162 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2416.c b/arch/arm/mach-s3c24xx/mach-smdk2416.c index f30d7fccbfee..fe160c7f4b0a 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2416.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c | |||
@@ -254,6 +254,6 @@ MACHINE_START(SMDK2416, "SMDK2416") | |||
254 | .init_irq = s3c24xx_init_irq, | 254 | .init_irq = s3c24xx_init_irq, |
255 | .map_io = smdk2416_map_io, | 255 | .map_io = smdk2416_map_io, |
256 | .init_machine = smdk2416_machine_init, | 256 | .init_machine = smdk2416_machine_init, |
257 | .timer = &s3c24xx_timer, | 257 | .init_time = s3c24xx_timer_init, |
258 | .restart = s3c2416_restart, | 258 | .restart = s3c2416_restart, |
259 | MACHINE_END | 259 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c index b7ff882c6ce6..a8fdafedc4c1 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2440.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c | |||
@@ -182,6 +182,6 @@ MACHINE_START(S3C2440, "SMDK2440") | |||
182 | .init_irq = s3c24xx_init_irq, | 182 | .init_irq = s3c24xx_init_irq, |
183 | .map_io = smdk2440_map_io, | 183 | .map_io = smdk2440_map_io, |
184 | .init_machine = smdk2440_machine_init, | 184 | .init_machine = smdk2440_machine_init, |
185 | .timer = &s3c24xx_timer, | 185 | .init_time = s3c24xx_timer_init, |
186 | .restart = s3c244x_restart, | 186 | .restart = s3c244x_restart, |
187 | MACHINE_END | 187 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c index 2568656f046f..7830d7004306 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2443.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c | |||
@@ -144,6 +144,6 @@ MACHINE_START(SMDK2443, "SMDK2443") | |||
144 | .init_irq = s3c24xx_init_irq, | 144 | .init_irq = s3c24xx_init_irq, |
145 | .map_io = smdk2443_map_io, | 145 | .map_io = smdk2443_map_io, |
146 | .init_machine = smdk2443_machine_init, | 146 | .init_machine = smdk2443_machine_init, |
147 | .timer = &s3c24xx_timer, | 147 | .init_time = s3c24xx_timer_init, |
148 | .restart = s3c2443_restart, | 148 | .restart = s3c2443_restart, |
149 | MACHINE_END | 149 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-tct_hammer.c b/arch/arm/mach-s3c24xx/mach-tct_hammer.c index 495bf5cf52e9..24b3d79e7b2c 100644 --- a/arch/arm/mach-s3c24xx/mach-tct_hammer.c +++ b/arch/arm/mach-s3c24xx/mach-tct_hammer.c | |||
@@ -149,6 +149,6 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER") | |||
149 | .map_io = tct_hammer_map_io, | 149 | .map_io = tct_hammer_map_io, |
150 | .init_irq = s3c24xx_init_irq, | 150 | .init_irq = s3c24xx_init_irq, |
151 | .init_machine = tct_hammer_init, | 151 | .init_machine = tct_hammer_init, |
152 | .timer = &s3c24xx_timer, | 152 | .init_time = s3c24xx_timer_init, |
153 | .restart = s3c2410_restart, | 153 | .restart = s3c2410_restart, |
154 | MACHINE_END | 154 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-vr1000.c b/arch/arm/mach-s3c24xx/mach-vr1000.c index 14d5b12e388c..dda21a01e3cc 100644 --- a/arch/arm/mach-s3c24xx/mach-vr1000.c +++ b/arch/arm/mach-s3c24xx/mach-vr1000.c | |||
@@ -357,6 +357,6 @@ MACHINE_START(VR1000, "Thorcom-VR1000") | |||
357 | .map_io = vr1000_map_io, | 357 | .map_io = vr1000_map_io, |
358 | .init_machine = vr1000_init, | 358 | .init_machine = vr1000_init, |
359 | .init_irq = s3c24xx_init_irq, | 359 | .init_irq = s3c24xx_init_irq, |
360 | .timer = &s3c24xx_timer, | 360 | .init_time = s3c24xx_timer_init, |
361 | .restart = s3c2410_restart, | 361 | .restart = s3c2410_restart, |
362 | MACHINE_END | 362 | MACHINE_END |
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c index f1d44ae11833..7fe7d4f60419 100644 --- a/arch/arm/mach-s3c24xx/mach-vstms.c +++ b/arch/arm/mach-s3c24xx/mach-vstms.c | |||
@@ -161,6 +161,6 @@ MACHINE_START(VSTMS, "VSTMS") | |||
161 | .init_irq = s3c24xx_init_irq, | 161 | .init_irq = s3c24xx_init_irq, |
162 | .init_machine = vstms_init, | 162 | .init_machine = vstms_init, |
163 | .map_io = vstms_map_io, | 163 | .map_io = vstms_map_io, |
164 | .timer = &s3c24xx_timer, | 164 | .init_time = s3c24xx_timer_init, |
165 | .restart = s3c2412_restart, | 165 | .restart = s3c2412_restart, |
166 | MACHINE_END | 166 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c index fa570c2e9381..afeae0b5bb28 100644 --- a/arch/arm/mach-s3c64xx/mach-anw6410.c +++ b/arch/arm/mach-s3c64xx/mach-anw6410.c | |||
@@ -232,6 +232,6 @@ MACHINE_START(ANW6410, "A&W6410") | |||
232 | .map_io = anw6410_map_io, | 232 | .map_io = anw6410_map_io, |
233 | .init_machine = anw6410_machine_init, | 233 | .init_machine = anw6410_machine_init, |
234 | .init_late = s3c64xx_init_late, | 234 | .init_late = s3c64xx_init_late, |
235 | .timer = &s3c24xx_timer, | 235 | .init_time = s3c24xx_timer_init, |
236 | .restart = s3c64xx_restart, | 236 | .restart = s3c64xx_restart, |
237 | MACHINE_END | 237 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c index 3185f82a0c84..5b6adc7f1d39 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c | |||
@@ -869,6 +869,6 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410") | |||
869 | .map_io = crag6410_map_io, | 869 | .map_io = crag6410_map_io, |
870 | .init_machine = crag6410_machine_init, | 870 | .init_machine = crag6410_machine_init, |
871 | .init_late = s3c64xx_init_late, | 871 | .init_late = s3c64xx_init_late, |
872 | .timer = &s3c24xx_timer, | 872 | .init_time = s3c24xx_timer_init, |
873 | .restart = s3c64xx_restart, | 873 | .restart = s3c64xx_restart, |
874 | MACHINE_END | 874 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c index 2c81bf15f02b..7212eb9cfeb9 100644 --- a/arch/arm/mach-s3c64xx/mach-hmt.c +++ b/arch/arm/mach-s3c64xx/mach-hmt.c | |||
@@ -275,6 +275,6 @@ MACHINE_START(HMT, "Airgoo-HMT") | |||
275 | .map_io = hmt_map_io, | 275 | .map_io = hmt_map_io, |
276 | .init_machine = hmt_machine_init, | 276 | .init_machine = hmt_machine_init, |
277 | .init_late = s3c64xx_init_late, | 277 | .init_late = s3c64xx_init_late, |
278 | .timer = &s3c24xx_timer, | 278 | .init_time = s3c24xx_timer_init, |
279 | .restart = s3c64xx_restart, | 279 | .restart = s3c64xx_restart, |
280 | MACHINE_END | 280 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c index 3f1e0102f09c..e173e6e98228 100644 --- a/arch/arm/mach-s3c64xx/mach-mini6410.c +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c | |||
@@ -354,6 +354,6 @@ MACHINE_START(MINI6410, "MINI6410") | |||
354 | .map_io = mini6410_map_io, | 354 | .map_io = mini6410_map_io, |
355 | .init_machine = mini6410_machine_init, | 355 | .init_machine = mini6410_machine_init, |
356 | .init_late = s3c64xx_init_late, | 356 | .init_late = s3c64xx_init_late, |
357 | .timer = &s3c24xx_timer, | 357 | .init_time = s3c24xx_timer_init, |
358 | .restart = s3c64xx_restart, | 358 | .restart = s3c64xx_restart, |
359 | MACHINE_END | 359 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c index 73caf9fdf5f7..8d3cedd995ff 100644 --- a/arch/arm/mach-s3c64xx/mach-ncp.c +++ b/arch/arm/mach-s3c64xx/mach-ncp.c | |||
@@ -103,6 +103,6 @@ MACHINE_START(NCP, "NCP") | |||
103 | .map_io = ncp_map_io, | 103 | .map_io = ncp_map_io, |
104 | .init_machine = ncp_machine_init, | 104 | .init_machine = ncp_machine_init, |
105 | .init_late = s3c64xx_init_late, | 105 | .init_late = s3c64xx_init_late, |
106 | .timer = &s3c24xx_timer, | 106 | .init_time = s3c24xx_timer_init, |
107 | .restart = s3c64xx_restart, | 107 | .restart = s3c64xx_restart, |
108 | MACHINE_END | 108 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c index 4f8129d09ba7..4d0d47a66930 100644 --- a/arch/arm/mach-s3c64xx/mach-real6410.c +++ b/arch/arm/mach-s3c64xx/mach-real6410.c | |||
@@ -333,6 +333,6 @@ MACHINE_START(REAL6410, "REAL6410") | |||
333 | .map_io = real6410_map_io, | 333 | .map_io = real6410_map_io, |
334 | .init_machine = real6410_machine_init, | 334 | .init_machine = real6410_machine_init, |
335 | .init_late = s3c64xx_init_late, | 335 | .init_late = s3c64xx_init_late, |
336 | .timer = &s3c24xx_timer, | 336 | .init_time = s3c24xx_timer_init, |
337 | .restart = s3c64xx_restart, | 337 | .restart = s3c64xx_restart, |
338 | MACHINE_END | 338 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c index 323399b3d110..ca2afcfce573 100644 --- a/arch/arm/mach-s3c64xx/mach-smartq5.c +++ b/arch/arm/mach-s3c64xx/mach-smartq5.c | |||
@@ -155,6 +155,6 @@ MACHINE_START(SMARTQ5, "SmartQ 5") | |||
155 | .map_io = smartq_map_io, | 155 | .map_io = smartq_map_io, |
156 | .init_machine = smartq5_machine_init, | 156 | .init_machine = smartq5_machine_init, |
157 | .init_late = s3c64xx_init_late, | 157 | .init_late = s3c64xx_init_late, |
158 | .timer = &s3c24xx_timer, | 158 | .init_time = s3c24xx_timer_init, |
159 | .restart = s3c64xx_restart, | 159 | .restart = s3c64xx_restart, |
160 | MACHINE_END | 160 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c index 9077b85785ca..37bb0c632a5e 100644 --- a/arch/arm/mach-s3c64xx/mach-smartq7.c +++ b/arch/arm/mach-s3c64xx/mach-smartq7.c | |||
@@ -171,6 +171,6 @@ MACHINE_START(SMARTQ7, "SmartQ 7") | |||
171 | .map_io = smartq_map_io, | 171 | .map_io = smartq_map_io, |
172 | .init_machine = smartq7_machine_init, | 172 | .init_machine = smartq7_machine_init, |
173 | .init_late = s3c64xx_init_late, | 173 | .init_late = s3c64xx_init_late, |
174 | .timer = &s3c24xx_timer, | 174 | .init_time = s3c24xx_timer_init, |
175 | .restart = s3c64xx_restart, | 175 | .restart = s3c64xx_restart, |
176 | MACHINE_END | 176 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c index 7df76e482b41..a392869c8342 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6400.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c | |||
@@ -92,6 +92,6 @@ MACHINE_START(SMDK6400, "SMDK6400") | |||
92 | .map_io = smdk6400_map_io, | 92 | .map_io = smdk6400_map_io, |
93 | .init_machine = smdk6400_machine_init, | 93 | .init_machine = smdk6400_machine_init, |
94 | .init_late = s3c64xx_init_late, | 94 | .init_late = s3c64xx_init_late, |
95 | .timer = &s3c24xx_timer, | 95 | .init_time = s3c24xx_timer_init, |
96 | .restart = s3c64xx_restart, | 96 | .restart = s3c64xx_restart, |
97 | MACHINE_END | 97 | MACHINE_END |
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index ad5142ab7756..1663d10ba02a 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c | |||
@@ -702,6 +702,6 @@ MACHINE_START(SMDK6410, "SMDK6410") | |||
702 | .map_io = smdk6410_map_io, | 702 | .map_io = smdk6410_map_io, |
703 | .init_machine = smdk6410_machine_init, | 703 | .init_machine = smdk6410_machine_init, |
704 | .init_late = s3c64xx_init_late, | 704 | .init_late = s3c64xx_init_late, |
705 | .timer = &s3c24xx_timer, | 705 | .init_time = s3c24xx_timer_init, |
706 | .restart = s3c64xx_restart, | 706 | .restart = s3c64xx_restart, |
707 | MACHINE_END | 707 | MACHINE_END |
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c index e2419296a9e2..a40d5eb38124 100644 --- a/arch/arm/mach-s5p64x0/mach-smdk6440.c +++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c | |||
@@ -273,6 +273,6 @@ MACHINE_START(SMDK6440, "SMDK6440") | |||
273 | .init_irq = s5p6440_init_irq, | 273 | .init_irq = s5p6440_init_irq, |
274 | .map_io = smdk6440_map_io, | 274 | .map_io = smdk6440_map_io, |
275 | .init_machine = smdk6440_machine_init, | 275 | .init_machine = smdk6440_machine_init, |
276 | .timer = &s5p_timer, | 276 | .init_time = s5p_timer_init, |
277 | .restart = s5p64x0_restart, | 277 | .restart = s5p64x0_restart, |
278 | MACHINE_END | 278 | MACHINE_END |
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c index 999273107fa9..703e576a26e0 100644 --- a/arch/arm/mach-s5p64x0/mach-smdk6450.c +++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c | |||
@@ -292,6 +292,6 @@ MACHINE_START(SMDK6450, "SMDK6450") | |||
292 | .init_irq = s5p6450_init_irq, | 292 | .init_irq = s5p6450_init_irq, |
293 | .map_io = smdk6450_map_io, | 293 | .map_io = smdk6450_map_io, |
294 | .init_machine = smdk6450_machine_init, | 294 | .init_machine = smdk6450_machine_init, |
295 | .timer = &s5p_timer, | 295 | .init_time = s5p_timer_init, |
296 | .restart = s5p64x0_restart, | 296 | .restart = s5p64x0_restart, |
297 | MACHINE_END | 297 | MACHINE_END |
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c index c3f30953df21..185a19583898 100644 --- a/arch/arm/mach-s5pc100/mach-smdkc100.c +++ b/arch/arm/mach-s5pc100/mach-smdkc100.c | |||
@@ -255,6 +255,6 @@ MACHINE_START(SMDKC100, "SMDKC100") | |||
255 | .init_irq = s5pc100_init_irq, | 255 | .init_irq = s5pc100_init_irq, |
256 | .map_io = smdkc100_map_io, | 256 | .map_io = smdkc100_map_io, |
257 | .init_machine = smdkc100_machine_init, | 257 | .init_machine = smdkc100_machine_init, |
258 | .timer = &s3c24xx_timer, | 258 | .init_time = s3c24xx_timer_init, |
259 | .restart = s5pc100_restart, | 259 | .restart = s5pc100_restart, |
260 | MACHINE_END | 260 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c index 45eb0a8244c4..11900a8e88a3 100644 --- a/arch/arm/mach-s5pv210/mach-aquila.c +++ b/arch/arm/mach-s5pv210/mach-aquila.c | |||
@@ -686,6 +686,6 @@ MACHINE_START(AQUILA, "Aquila") | |||
686 | .init_irq = s5pv210_init_irq, | 686 | .init_irq = s5pv210_init_irq, |
687 | .map_io = aquila_map_io, | 687 | .map_io = aquila_map_io, |
688 | .init_machine = aquila_machine_init, | 688 | .init_machine = aquila_machine_init, |
689 | .timer = &s5p_timer, | 689 | .init_time = s5p_timer_init, |
690 | .restart = s5pv210_restart, | 690 | .restart = s5pv210_restart, |
691 | MACHINE_END | 691 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c index 9f7f1607c547..570481591746 100644 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ b/arch/arm/mach-s5pv210/mach-goni.c | |||
@@ -973,7 +973,7 @@ MACHINE_START(GONI, "GONI") | |||
973 | .init_irq = s5pv210_init_irq, | 973 | .init_irq = s5pv210_init_irq, |
974 | .map_io = goni_map_io, | 974 | .map_io = goni_map_io, |
975 | .init_machine = goni_machine_init, | 975 | .init_machine = goni_machine_init, |
976 | .timer = &s5p_timer, | 976 | .init_time = s5p_timer_init, |
977 | .reserve = &goni_reserve, | 977 | .reserve = &goni_reserve, |
978 | .restart = s5pv210_restart, | 978 | .restart = s5pv210_restart, |
979 | MACHINE_END | 979 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c index 2f152f919769..28bd0248a3e2 100644 --- a/arch/arm/mach-s5pv210/mach-smdkc110.c +++ b/arch/arm/mach-s5pv210/mach-smdkc110.c | |||
@@ -153,7 +153,7 @@ MACHINE_START(SMDKC110, "SMDKC110") | |||
153 | .init_irq = s5pv210_init_irq, | 153 | .init_irq = s5pv210_init_irq, |
154 | .map_io = smdkc110_map_io, | 154 | .map_io = smdkc110_map_io, |
155 | .init_machine = smdkc110_machine_init, | 155 | .init_machine = smdkc110_machine_init, |
156 | .timer = &s5p_timer, | 156 | .init_time = s5p_timer_init, |
157 | .restart = s5pv210_restart, | 157 | .restart = s5pv210_restart, |
158 | .reserve = &smdkc110_reserve, | 158 | .reserve = &smdkc110_reserve, |
159 | MACHINE_END | 159 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c index 721967bc3927..3c73f36869bb 100644 --- a/arch/arm/mach-s5pv210/mach-smdkv210.c +++ b/arch/arm/mach-s5pv210/mach-smdkv210.c | |||
@@ -329,7 +329,7 @@ MACHINE_START(SMDKV210, "SMDKV210") | |||
329 | .init_irq = s5pv210_init_irq, | 329 | .init_irq = s5pv210_init_irq, |
330 | .map_io = smdkv210_map_io, | 330 | .map_io = smdkv210_map_io, |
331 | .init_machine = smdkv210_machine_init, | 331 | .init_machine = smdkv210_machine_init, |
332 | .timer = &s5p_timer, | 332 | .init_time = s5p_timer_init, |
333 | .restart = s5pv210_restart, | 333 | .restart = s5pv210_restart, |
334 | .reserve = &smdkv210_reserve, | 334 | .reserve = &smdkv210_reserve, |
335 | MACHINE_END | 335 | MACHINE_END |
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c index 0ed270f8b0a8..2d4c5531819c 100644 --- a/arch/arm/mach-s5pv210/mach-torbreck.c +++ b/arch/arm/mach-s5pv210/mach-torbreck.c | |||
@@ -130,6 +130,6 @@ MACHINE_START(TORBRECK, "TORBRECK") | |||
130 | .init_irq = s5pv210_init_irq, | 130 | .init_irq = s5pv210_init_irq, |
131 | .map_io = torbreck_map_io, | 131 | .map_io = torbreck_map_io, |
132 | .init_machine = torbreck_machine_init, | 132 | .init_machine = torbreck_machine_init, |
133 | .timer = &s5p_timer, | 133 | .init_time = s5p_timer_init, |
134 | .restart = s5pv210_restart, | 134 | .restart = s5pv210_restart, |
135 | MACHINE_END | 135 | MACHINE_END |
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index 9a23739f7026..b38d2525d5db 100644 --- a/arch/arm/mach-sa1100/assabet.c +++ b/arch/arm/mach-sa1100/assabet.c | |||
@@ -621,7 +621,7 @@ MACHINE_START(ASSABET, "Intel-Assabet") | |||
621 | .map_io = assabet_map_io, | 621 | .map_io = assabet_map_io, |
622 | .nr_irqs = SA1100_NR_IRQS, | 622 | .nr_irqs = SA1100_NR_IRQS, |
623 | .init_irq = sa1100_init_irq, | 623 | .init_irq = sa1100_init_irq, |
624 | .timer = &sa1100_timer, | 624 | .init_time = sa1100_timer_init, |
625 | .init_machine = assabet_init, | 625 | .init_machine = assabet_init, |
626 | .init_late = sa11x0_init_late, | 626 | .init_late = sa11x0_init_late, |
627 | #ifdef CONFIG_SA1111 | 627 | #ifdef CONFIG_SA1111 |
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c index b2dadf3ea3df..63361b6d04e9 100644 --- a/arch/arm/mach-sa1100/badge4.c +++ b/arch/arm/mach-sa1100/badge4.c | |||
@@ -336,7 +336,7 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4") | |||
336 | .nr_irqs = SA1100_NR_IRQS, | 336 | .nr_irqs = SA1100_NR_IRQS, |
337 | .init_irq = sa1100_init_irq, | 337 | .init_irq = sa1100_init_irq, |
338 | .init_late = sa11x0_init_late, | 338 | .init_late = sa11x0_init_late, |
339 | .timer = &sa1100_timer, | 339 | .init_time = sa1100_timer_init, |
340 | #ifdef CONFIG_SA1111 | 340 | #ifdef CONFIG_SA1111 |
341 | .dma_zone_size = SZ_1M, | 341 | .dma_zone_size = SZ_1M, |
342 | #endif | 342 | #endif |
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c index 304bca4a07c0..2d25ececb415 100644 --- a/arch/arm/mach-sa1100/cerf.c +++ b/arch/arm/mach-sa1100/cerf.c | |||
@@ -174,7 +174,7 @@ MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") | |||
174 | .map_io = cerf_map_io, | 174 | .map_io = cerf_map_io, |
175 | .nr_irqs = SA1100_NR_IRQS, | 175 | .nr_irqs = SA1100_NR_IRQS, |
176 | .init_irq = cerf_init_irq, | 176 | .init_irq = cerf_init_irq, |
177 | .timer = &sa1100_timer, | 177 | .init_time = sa1100_timer_init, |
178 | .init_machine = cerf_init, | 178 | .init_machine = cerf_init, |
179 | .init_late = sa11x0_init_late, | 179 | .init_late = sa11x0_init_late, |
180 | .restart = sa11x0_restart, | 180 | .restart = sa11x0_restart, |
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index 45f424f5fca6..612a45689770 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c | |||
@@ -399,7 +399,7 @@ MACHINE_START(COLLIE, "Sharp-Collie") | |||
399 | .map_io = collie_map_io, | 399 | .map_io = collie_map_io, |
400 | .nr_irqs = SA1100_NR_IRQS, | 400 | .nr_irqs = SA1100_NR_IRQS, |
401 | .init_irq = sa1100_init_irq, | 401 | .init_irq = sa1100_init_irq, |
402 | .timer = &sa1100_timer, | 402 | .init_time = sa1100_timer_init, |
403 | .init_machine = collie_init, | 403 | .init_machine = collie_init, |
404 | .init_late = sa11x0_init_late, | 404 | .init_late = sa11x0_init_late, |
405 | .restart = sa11x0_restart, | 405 | .restart = sa11x0_restart, |
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h index a5b7c13da3e3..2abc6a1f6e86 100644 --- a/arch/arm/mach-sa1100/generic.h +++ b/arch/arm/mach-sa1100/generic.h | |||
@@ -4,9 +4,7 @@ | |||
4 | * Author: Nicolas Pitre | 4 | * Author: Nicolas Pitre |
5 | */ | 5 | */ |
6 | 6 | ||
7 | struct sys_timer; | 7 | extern void sa1100_timer_init(void); |
8 | |||
9 | extern struct sys_timer sa1100_timer; | ||
10 | extern void __init sa1100_map_io(void); | 8 | extern void __init sa1100_map_io(void); |
11 | extern void __init sa1100_init_irq(void); | 9 | extern void __init sa1100_init_irq(void); |
12 | extern void __init sa1100_init_gpio(void); | 10 | extern void __init sa1100_init_gpio(void); |
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c index e1571eab08ae..b8f2b151539b 100644 --- a/arch/arm/mach-sa1100/h3100.c +++ b/arch/arm/mach-sa1100/h3100.c | |||
@@ -108,7 +108,7 @@ MACHINE_START(H3100, "Compaq iPAQ H3100") | |||
108 | .map_io = h3100_map_io, | 108 | .map_io = h3100_map_io, |
109 | .nr_irqs = SA1100_NR_IRQS, | 109 | .nr_irqs = SA1100_NR_IRQS, |
110 | .init_irq = sa1100_init_irq, | 110 | .init_irq = sa1100_init_irq, |
111 | .timer = &sa1100_timer, | 111 | .init_time = sa1100_timer_init, |
112 | .init_machine = h3100_mach_init, | 112 | .init_machine = h3100_mach_init, |
113 | .init_late = sa11x0_init_late, | 113 | .init_late = sa11x0_init_late, |
114 | .restart = sa11x0_restart, | 114 | .restart = sa11x0_restart, |
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index ba7a2901ab88..b8dc5bd22623 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c | |||
@@ -158,7 +158,7 @@ MACHINE_START(H3600, "Compaq iPAQ H3600") | |||
158 | .map_io = h3600_map_io, | 158 | .map_io = h3600_map_io, |
159 | .nr_irqs = SA1100_NR_IRQS, | 159 | .nr_irqs = SA1100_NR_IRQS, |
160 | .init_irq = sa1100_init_irq, | 160 | .init_irq = sa1100_init_irq, |
161 | .timer = &sa1100_timer, | 161 | .init_time = sa1100_timer_init, |
162 | .init_machine = h3600_mach_init, | 162 | .init_machine = h3600_mach_init, |
163 | .init_late = sa11x0_init_late, | 163 | .init_late = sa11x0_init_late, |
164 | .restart = sa11x0_restart, | 164 | .restart = sa11x0_restart, |
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c index d005939c41fc..643d5f2d9af9 100644 --- a/arch/arm/mach-sa1100/hackkit.c +++ b/arch/arm/mach-sa1100/hackkit.c | |||
@@ -229,7 +229,7 @@ MACHINE_START(HACKKIT, "HackKit Cpu Board") | |||
229 | .map_io = hackkit_map_io, | 229 | .map_io = hackkit_map_io, |
230 | .nr_irqs = SA1100_NR_IRQS, | 230 | .nr_irqs = SA1100_NR_IRQS, |
231 | .init_irq = sa1100_init_irq, | 231 | .init_irq = sa1100_init_irq, |
232 | .timer = &sa1100_timer, | 232 | .init_time = sa1100_timer_init, |
233 | .init_machine = hackkit_init, | 233 | .init_machine = hackkit_init, |
234 | .init_late = sa11x0_init_late, | 234 | .init_late = sa11x0_init_late, |
235 | .restart = sa11x0_restart, | 235 | .restart = sa11x0_restart, |
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c index 35cfc428b4d4..c0b1f5bafae4 100644 --- a/arch/arm/mach-sa1100/jornada720.c +++ b/arch/arm/mach-sa1100/jornada720.c | |||
@@ -346,7 +346,7 @@ MACHINE_START(JORNADA720, "HP Jornada 720") | |||
346 | .map_io = jornada720_map_io, | 346 | .map_io = jornada720_map_io, |
347 | .nr_irqs = SA1100_NR_IRQS, | 347 | .nr_irqs = SA1100_NR_IRQS, |
348 | .init_irq = sa1100_init_irq, | 348 | .init_irq = sa1100_init_irq, |
349 | .timer = &sa1100_timer, | 349 | .init_time = sa1100_timer_init, |
350 | .init_machine = jornada720_mach_init, | 350 | .init_machine = jornada720_mach_init, |
351 | .init_late = sa11x0_init_late, | 351 | .init_late = sa11x0_init_late, |
352 | #ifdef CONFIG_SA1111 | 352 | #ifdef CONFIG_SA1111 |
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c index f69f78fc3ddd..a89917653884 100644 --- a/arch/arm/mach-sa1100/lart.c +++ b/arch/arm/mach-sa1100/lart.c | |||
@@ -174,6 +174,6 @@ MACHINE_START(LART, "LART") | |||
174 | .init_irq = sa1100_init_irq, | 174 | .init_irq = sa1100_init_irq, |
175 | .init_machine = lart_init, | 175 | .init_machine = lart_init, |
176 | .init_late = sa11x0_init_late, | 176 | .init_late = sa11x0_init_late, |
177 | .timer = &sa1100_timer, | 177 | .init_time = sa1100_timer_init, |
178 | .restart = sa11x0_restart, | 178 | .restart = sa11x0_restart, |
179 | MACHINE_END | 179 | MACHINE_END |
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c index 102e08f7b109..f1cb3784d525 100644 --- a/arch/arm/mach-sa1100/nanoengine.c +++ b/arch/arm/mach-sa1100/nanoengine.c | |||
@@ -110,7 +110,7 @@ MACHINE_START(NANOENGINE, "BSE nanoEngine") | |||
110 | .map_io = nanoengine_map_io, | 110 | .map_io = nanoengine_map_io, |
111 | .nr_irqs = SA1100_NR_IRQS, | 111 | .nr_irqs = SA1100_NR_IRQS, |
112 | .init_irq = sa1100_init_irq, | 112 | .init_irq = sa1100_init_irq, |
113 | .timer = &sa1100_timer, | 113 | .init_time = sa1100_timer_init, |
114 | .init_machine = nanoengine_init, | 114 | .init_machine = nanoengine_init, |
115 | .init_late = sa11x0_init_late, | 115 | .init_late = sa11x0_init_late, |
116 | .restart = sa11x0_restart, | 116 | .restart = sa11x0_restart, |
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c index c51bb63f90fb..091261878eff 100644 --- a/arch/arm/mach-sa1100/pleb.c +++ b/arch/arm/mach-sa1100/pleb.c | |||
@@ -133,7 +133,7 @@ MACHINE_START(PLEB, "PLEB") | |||
133 | .map_io = pleb_map_io, | 133 | .map_io = pleb_map_io, |
134 | .nr_irqs = SA1100_NR_IRQS, | 134 | .nr_irqs = SA1100_NR_IRQS, |
135 | .init_irq = sa1100_init_irq, | 135 | .init_irq = sa1100_init_irq, |
136 | .timer = &sa1100_timer, | 136 | .init_time = sa1100_timer_init, |
137 | .init_machine = pleb_init, | 137 | .init_machine = pleb_init, |
138 | .init_late = sa11x0_init_late, | 138 | .init_late = sa11x0_init_late, |
139 | .restart = sa11x0_restart, | 139 | .restart = sa11x0_restart, |
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c index 6460d25fbb88..c8866bce7386 100644 --- a/arch/arm/mach-sa1100/shannon.c +++ b/arch/arm/mach-sa1100/shannon.c | |||
@@ -102,7 +102,7 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)") | |||
102 | .map_io = shannon_map_io, | 102 | .map_io = shannon_map_io, |
103 | .nr_irqs = SA1100_NR_IRQS, | 103 | .nr_irqs = SA1100_NR_IRQS, |
104 | .init_irq = sa1100_init_irq, | 104 | .init_irq = sa1100_init_irq, |
105 | .timer = &sa1100_timer, | 105 | .init_time = sa1100_timer_init, |
106 | .init_machine = shannon_init, | 106 | .init_machine = shannon_init, |
107 | .init_late = sa11x0_init_late, | 107 | .init_late = sa11x0_init_late, |
108 | .restart = sa11x0_restart, | 108 | .restart = sa11x0_restart, |
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c index 6d65f65fcb23..bcbc94540e45 100644 --- a/arch/arm/mach-sa1100/simpad.c +++ b/arch/arm/mach-sa1100/simpad.c | |||
@@ -396,6 +396,6 @@ MACHINE_START(SIMPAD, "Simpad") | |||
396 | .nr_irqs = SA1100_NR_IRQS, | 396 | .nr_irqs = SA1100_NR_IRQS, |
397 | .init_irq = sa1100_init_irq, | 397 | .init_irq = sa1100_init_irq, |
398 | .init_late = sa11x0_init_late, | 398 | .init_late = sa11x0_init_late, |
399 | .timer = &sa1100_timer, | 399 | .init_time = sa1100_timer_init, |
400 | .restart = sa11x0_restart, | 400 | .restart = sa11x0_restart, |
401 | MACHINE_END | 401 | MACHINE_END |
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c index 80702c9ecc77..a59a13a665a6 100644 --- a/arch/arm/mach-sa1100/time.c +++ b/arch/arm/mach-sa1100/time.c | |||
@@ -69,46 +69,10 @@ sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) | |||
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | static struct clock_event_device ckevt_sa1100_osmr0 = { | ||
73 | .name = "osmr0", | ||
74 | .features = CLOCK_EVT_FEAT_ONESHOT, | ||
75 | .rating = 200, | ||
76 | .set_next_event = sa1100_osmr0_set_next_event, | ||
77 | .set_mode = sa1100_osmr0_set_mode, | ||
78 | }; | ||
79 | |||
80 | static struct irqaction sa1100_timer_irq = { | ||
81 | .name = "ost0", | ||
82 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
83 | .handler = sa1100_ost0_interrupt, | ||
84 | .dev_id = &ckevt_sa1100_osmr0, | ||
85 | }; | ||
86 | |||
87 | static void __init sa1100_timer_init(void) | ||
88 | { | ||
89 | writel_relaxed(0, OIER); | ||
90 | writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR); | ||
91 | |||
92 | setup_sched_clock(sa1100_read_sched_clock, 32, 3686400); | ||
93 | |||
94 | clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4); | ||
95 | ckevt_sa1100_osmr0.max_delta_ns = | ||
96 | clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0); | ||
97 | ckevt_sa1100_osmr0.min_delta_ns = | ||
98 | clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1; | ||
99 | ckevt_sa1100_osmr0.cpumask = cpumask_of(0); | ||
100 | |||
101 | setup_irq(IRQ_OST0, &sa1100_timer_irq); | ||
102 | |||
103 | clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32, | ||
104 | clocksource_mmio_readl_up); | ||
105 | clockevents_register_device(&ckevt_sa1100_osmr0); | ||
106 | } | ||
107 | |||
108 | #ifdef CONFIG_PM | 72 | #ifdef CONFIG_PM |
109 | unsigned long osmr[4], oier; | 73 | unsigned long osmr[4], oier; |
110 | 74 | ||
111 | static void sa1100_timer_suspend(void) | 75 | static void sa1100_timer_suspend(struct clock_event_device *cedev) |
112 | { | 76 | { |
113 | osmr[0] = readl_relaxed(OSMR0); | 77 | osmr[0] = readl_relaxed(OSMR0); |
114 | osmr[1] = readl_relaxed(OSMR1); | 78 | osmr[1] = readl_relaxed(OSMR1); |
@@ -117,7 +81,7 @@ static void sa1100_timer_suspend(void) | |||
117 | oier = readl_relaxed(OIER); | 81 | oier = readl_relaxed(OIER); |
118 | } | 82 | } |
119 | 83 | ||
120 | static void sa1100_timer_resume(void) | 84 | static void sa1100_timer_resume(struct clock_event_device *cedev) |
121 | { | 85 | { |
122 | writel_relaxed(0x0f, OSSR); | 86 | writel_relaxed(0x0f, OSSR); |
123 | writel_relaxed(osmr[0], OSMR0); | 87 | writel_relaxed(osmr[0], OSMR0); |
@@ -136,8 +100,36 @@ static void sa1100_timer_resume(void) | |||
136 | #define sa1100_timer_resume NULL | 100 | #define sa1100_timer_resume NULL |
137 | #endif | 101 | #endif |
138 | 102 | ||
139 | struct sys_timer sa1100_timer = { | 103 | static struct clock_event_device ckevt_sa1100_osmr0 = { |
140 | .init = sa1100_timer_init, | 104 | .name = "osmr0", |
105 | .features = CLOCK_EVT_FEAT_ONESHOT, | ||
106 | .rating = 200, | ||
107 | .set_next_event = sa1100_osmr0_set_next_event, | ||
108 | .set_mode = sa1100_osmr0_set_mode, | ||
141 | .suspend = sa1100_timer_suspend, | 109 | .suspend = sa1100_timer_suspend, |
142 | .resume = sa1100_timer_resume, | 110 | .resume = sa1100_timer_resume, |
143 | }; | 111 | }; |
112 | |||
113 | static struct irqaction sa1100_timer_irq = { | ||
114 | .name = "ost0", | ||
115 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
116 | .handler = sa1100_ost0_interrupt, | ||
117 | .dev_id = &ckevt_sa1100_osmr0, | ||
118 | }; | ||
119 | |||
120 | void __init sa1100_timer_init(void) | ||
121 | { | ||
122 | writel_relaxed(0, OIER); | ||
123 | writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR); | ||
124 | |||
125 | setup_sched_clock(sa1100_read_sched_clock, 32, 3686400); | ||
126 | |||
127 | ckevt_sa1100_osmr0.cpumask = cpumask_of(0); | ||
128 | |||
129 | setup_irq(IRQ_OST0, &sa1100_timer_irq); | ||
130 | |||
131 | clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32, | ||
132 | clocksource_mmio_readl_up); | ||
133 | clockevents_config_and_register(&ckevt_sa1100_osmr0, 3686400, | ||
134 | MIN_OSCR_DELTA * 2, 0x7fffffff); | ||
135 | } | ||
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c index 9ad2e9737fb5..b63dec848195 100644 --- a/arch/arm/mach-shark/core.c +++ b/arch/arm/mach-shark/core.c | |||
@@ -128,10 +128,6 @@ static void __init shark_timer_init(void) | |||
128 | setup_irq(IRQ_TIMER, &shark_timer_irq); | 128 | setup_irq(IRQ_TIMER, &shark_timer_irq); |
129 | } | 129 | } |
130 | 130 | ||
131 | static struct sys_timer shark_timer = { | ||
132 | .init = shark_timer_init, | ||
133 | }; | ||
134 | |||
135 | static void shark_init_early(void) | 131 | static void shark_init_early(void) |
136 | { | 132 | { |
137 | disable_hlt(); | 133 | disable_hlt(); |
@@ -142,7 +138,7 @@ MACHINE_START(SHARK, "Shark") | |||
142 | .atag_offset = 0x3000, | 138 | .atag_offset = 0x3000, |
143 | .init_early = shark_init_early, | 139 | .init_early = shark_init_early, |
144 | .init_irq = shark_init_irq, | 140 | .init_irq = shark_init_irq, |
145 | .timer = &shark_timer, | 141 | .init_time = shark_timer_init, |
146 | .dma_zone_size = SZ_4M, | 142 | .dma_zone_size = SZ_4M, |
147 | .restart = shark_restart, | 143 | .restart = shark_restart, |
148 | MACHINE_END | 144 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c index fd28358e2abe..705bc63c7984 100644 --- a/arch/arm/mach-shmobile/board-ag5evm.c +++ b/arch/arm/mach-shmobile/board-ag5evm.c | |||
@@ -670,5 +670,5 @@ MACHINE_START(AG5EVM, "ag5evm") | |||
670 | .init_irq = sh73a0_init_irq, | 670 | .init_irq = sh73a0_init_irq, |
671 | .init_machine = ag5evm_init, | 671 | .init_machine = ag5evm_init, |
672 | .init_late = shmobile_init_late, | 672 | .init_late = shmobile_init_late, |
673 | .timer = &shmobile_timer, | 673 | .init_time = sh73a0_earlytimer_init, |
674 | MACHINE_END | 674 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 99ef190d0909..c1d4ab630214 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -1350,5 +1350,5 @@ MACHINE_START(AP4EVB, "ap4evb") | |||
1350 | .handle_irq = shmobile_handle_irq_intc, | 1350 | .handle_irq = shmobile_handle_irq_intc, |
1351 | .init_machine = ap4evb_init, | 1351 | .init_machine = ap4evb_init, |
1352 | .init_late = sh7372_pm_init_late, | 1352 | .init_late = sh7372_pm_init_late, |
1353 | .timer = &shmobile_timer, | 1353 | .init_time = sh7372_earlytimer_init, |
1354 | MACHINE_END | 1354 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 5353adf6b828..e7912447ad50 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c | |||
@@ -1192,9 +1192,6 @@ static void __init eva_earlytimer_init(void) | |||
1192 | static void __init eva_add_early_devices(void) | 1192 | static void __init eva_add_early_devices(void) |
1193 | { | 1193 | { |
1194 | r8a7740_add_early_devices(); | 1194 | r8a7740_add_early_devices(); |
1195 | |||
1196 | /* override timer setup with board-specific code */ | ||
1197 | shmobile_timer.init = eva_earlytimer_init; | ||
1198 | } | 1195 | } |
1199 | 1196 | ||
1200 | #define RESCNT2 IOMEM(0xe6188020) | 1197 | #define RESCNT2 IOMEM(0xe6188020) |
@@ -1216,7 +1213,7 @@ DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva") | |||
1216 | .handle_irq = shmobile_handle_irq_intc, | 1213 | .handle_irq = shmobile_handle_irq_intc, |
1217 | .init_machine = eva_init, | 1214 | .init_machine = eva_init, |
1218 | .init_late = shmobile_init_late, | 1215 | .init_late = shmobile_init_late, |
1219 | .timer = &shmobile_timer, | 1216 | .init_time = eva_earlytimer_init, |
1220 | .dt_compat = eva_boards_compat_dt, | 1217 | .dt_compat = eva_boards_compat_dt, |
1221 | .restart = eva_restart, | 1218 | .restart = eva_restart, |
1222 | MACHINE_END | 1219 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c index cb8c994e1430..331b7ce4edd8 100644 --- a/arch/arm/mach-shmobile/board-bonito.c +++ b/arch/arm/mach-shmobile/board-bonito.c | |||
@@ -499,9 +499,6 @@ static void __init bonito_earlytimer_init(void) | |||
499 | static void __init bonito_add_early_devices(void) | 499 | static void __init bonito_add_early_devices(void) |
500 | { | 500 | { |
501 | r8a7740_add_early_devices(); | 501 | r8a7740_add_early_devices(); |
502 | |||
503 | /* override timer setup with board-specific code */ | ||
504 | shmobile_timer.init = bonito_earlytimer_init; | ||
505 | } | 502 | } |
506 | 503 | ||
507 | MACHINE_START(BONITO, "bonito") | 504 | MACHINE_START(BONITO, "bonito") |
@@ -511,5 +508,5 @@ MACHINE_START(BONITO, "bonito") | |||
511 | .handle_irq = shmobile_handle_irq_intc, | 508 | .handle_irq = shmobile_handle_irq_intc, |
512 | .init_machine = bonito_init, | 509 | .init_machine = bonito_init, |
513 | .init_late = shmobile_init_late, | 510 | .init_late = shmobile_init_late, |
514 | .timer = &shmobile_timer, | 511 | .init_time = bonito_earlytimer_init, |
515 | MACHINE_END | 512 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c index a1d315fc329a..d759a9c2b9e8 100644 --- a/arch/arm/mach-shmobile/board-kota2.c +++ b/arch/arm/mach-shmobile/board-kota2.c | |||
@@ -552,5 +552,5 @@ MACHINE_START(KOTA2, "kota2") | |||
552 | .init_irq = sh73a0_init_irq, | 552 | .init_irq = sh73a0_init_irq, |
553 | .init_machine = kota2_init, | 553 | .init_machine = kota2_init, |
554 | .init_late = shmobile_init_late, | 554 | .init_late = shmobile_init_late, |
555 | .timer = &shmobile_timer, | 555 | .init_time = sh73a0_earlytimer_init, |
556 | MACHINE_END | 556 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-kzm9d.c b/arch/arm/mach-shmobile/board-kzm9d.c index f3f180dc23e5..c254782aa727 100644 --- a/arch/arm/mach-shmobile/board-kzm9d.c +++ b/arch/arm/mach-shmobile/board-kzm9d.c | |||
@@ -90,6 +90,6 @@ DT_MACHINE_START(KZM9D_DT, "kzm9d") | |||
90 | .init_irq = emev2_init_irq, | 90 | .init_irq = emev2_init_irq, |
91 | .init_machine = kzm9d_add_standard_devices, | 91 | .init_machine = kzm9d_add_standard_devices, |
92 | .init_late = shmobile_init_late, | 92 | .init_late = shmobile_init_late, |
93 | .timer = &shmobile_timer, | 93 | .init_time = shmobile_timer_init, |
94 | .dt_compat = kzm9d_boards_compat_dt, | 94 | .dt_compat = kzm9d_boards_compat_dt, |
95 | MACHINE_END | 95 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c index 278c8f26f22e..ac9428530d7b 100644 --- a/arch/arm/mach-shmobile/board-kzm9g.c +++ b/arch/arm/mach-shmobile/board-kzm9g.c | |||
@@ -794,7 +794,7 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g") | |||
794 | .init_irq = sh73a0_init_irq, | 794 | .init_irq = sh73a0_init_irq, |
795 | .init_machine = kzm_init, | 795 | .init_machine = kzm_init, |
796 | .init_late = shmobile_init_late, | 796 | .init_late = shmobile_init_late, |
797 | .timer = &shmobile_timer, | 797 | .init_time = sh73a0_earlytimer_init, |
798 | .restart = kzm9g_restart, | 798 | .restart = kzm9g_restart, |
799 | .dt_compat = kzm9g_boards_compat_dt, | 799 | .dt_compat = kzm9g_boards_compat_dt, |
800 | MACHINE_END | 800 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 2fed62f66045..fe4917f2c1a2 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -1593,6 +1593,6 @@ DT_MACHINE_START(MACKEREL_DT, "mackerel") | |||
1593 | .handle_irq = shmobile_handle_irq_intc, | 1593 | .handle_irq = shmobile_handle_irq_intc, |
1594 | .init_machine = mackerel_init, | 1594 | .init_machine = mackerel_init, |
1595 | .init_late = sh7372_pm_init_late, | 1595 | .init_late = sh7372_pm_init_late, |
1596 | .timer = &shmobile_timer, | 1596 | .init_time = sh7372_earlytimer_init, |
1597 | .dt_compat = mackerel_boards_compat_dt, | 1597 | .dt_compat = mackerel_boards_compat_dt, |
1598 | MACHINE_END | 1598 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index fad8db103e9c..cdcb799e802f 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c | |||
@@ -383,5 +383,5 @@ MACHINE_START(MARZEN, "marzen") | |||
383 | .init_irq = r8a7779_init_irq, | 383 | .init_irq = r8a7779_init_irq, |
384 | .init_machine = marzen_init, | 384 | .init_machine = marzen_init, |
385 | .init_late = marzen_init_late, | 385 | .init_late = marzen_init_late, |
386 | .timer = &shmobile_timer, | 386 | .init_time = r8a7779_earlytimer_init, |
387 | MACHINE_END | 387 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index dfeca79e9e96..a57439eec11a 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __ARCH_MACH_COMMON_H | 2 | #define __ARCH_MACH_COMMON_H |
3 | 3 | ||
4 | extern void shmobile_earlytimer_init(void); | 4 | extern void shmobile_earlytimer_init(void); |
5 | extern struct sys_timer shmobile_timer; | 5 | extern void shmobile_timer_init(void); |
6 | extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz, | 6 | extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz, |
7 | unsigned int mult, unsigned int div); | 7 | unsigned int mult, unsigned int div); |
8 | struct twd_local_timer; | 8 | struct twd_local_timer; |
@@ -20,6 +20,7 @@ extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv); | |||
20 | 20 | ||
21 | extern void sh7372_init_irq(void); | 21 | extern void sh7372_init_irq(void); |
22 | extern void sh7372_map_io(void); | 22 | extern void sh7372_map_io(void); |
23 | extern void sh7372_earlytimer_init(void); | ||
23 | extern void sh7372_add_early_devices(void); | 24 | extern void sh7372_add_early_devices(void); |
24 | extern void sh7372_add_standard_devices(void); | 25 | extern void sh7372_add_standard_devices(void); |
25 | extern void sh7372_clock_init(void); | 26 | extern void sh7372_clock_init(void); |
@@ -32,6 +33,7 @@ extern struct clk sh7372_extal2_clk; | |||
32 | 33 | ||
33 | extern void sh73a0_init_irq(void); | 34 | extern void sh73a0_init_irq(void); |
34 | extern void sh73a0_map_io(void); | 35 | extern void sh73a0_map_io(void); |
36 | extern void sh73a0_earlytimer_init(void); | ||
35 | extern void sh73a0_add_early_devices(void); | 37 | extern void sh73a0_add_early_devices(void); |
36 | extern void sh73a0_add_standard_devices(void); | 38 | extern void sh73a0_add_standard_devices(void); |
37 | extern void sh73a0_clock_init(void); | 39 | extern void sh73a0_clock_init(void); |
@@ -50,6 +52,7 @@ extern void r8a7740_pinmux_init(void); | |||
50 | 52 | ||
51 | extern void r8a7779_init_irq(void); | 53 | extern void r8a7779_init_irq(void); |
52 | extern void r8a7779_map_io(void); | 54 | extern void r8a7779_map_io(void); |
55 | extern void r8a7779_earlytimer_init(void); | ||
53 | extern void r8a7779_add_early_devices(void); | 56 | extern void r8a7779_add_early_devices(void); |
54 | extern void r8a7779_add_standard_devices(void); | 57 | extern void r8a7779_add_standard_devices(void); |
55 | extern void r8a7779_clock_init(void); | 58 | extern void r8a7779_clock_init(void); |
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index 646d61b22153..47662a581c0a 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c | |||
@@ -456,7 +456,7 @@ DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") | |||
456 | .nr_irqs = NR_IRQS_LEGACY, | 456 | .nr_irqs = NR_IRQS_LEGACY, |
457 | .init_irq = irqchip_init, | 457 | .init_irq = irqchip_init, |
458 | .init_machine = emev2_add_standard_devices_dt, | 458 | .init_machine = emev2_add_standard_devices_dt, |
459 | .timer = &shmobile_timer, | 459 | .init_time = shmobile_timer_init, |
460 | .dt_compat = emev2_boards_compat_dt, | 460 | .dt_compat = emev2_boards_compat_dt, |
461 | MACHINE_END | 461 | MACHINE_END |
462 | 462 | ||
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index 095222469d03..03c69f9979aa 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c | |||
@@ -705,12 +705,6 @@ void __init r8a7740_add_standard_devices(void) | |||
705 | rmobile_add_device_to_domain("A3SP", &i2c1_device); | 705 | rmobile_add_device_to_domain("A3SP", &i2c1_device); |
706 | } | 706 | } |
707 | 707 | ||
708 | static void __init r8a7740_earlytimer_init(void) | ||
709 | { | ||
710 | r8a7740_clock_init(0); | ||
711 | shmobile_earlytimer_init(); | ||
712 | } | ||
713 | |||
714 | void __init r8a7740_add_early_devices(void) | 708 | void __init r8a7740_add_early_devices(void) |
715 | { | 709 | { |
716 | early_platform_add_devices(r8a7740_early_devices, | 710 | early_platform_add_devices(r8a7740_early_devices, |
@@ -718,9 +712,6 @@ void __init r8a7740_add_early_devices(void) | |||
718 | 712 | ||
719 | /* setup early console here as well */ | 713 | /* setup early console here as well */ |
720 | shmobile_setup_console(); | 714 | shmobile_setup_console(); |
721 | |||
722 | /* override timer setup with soc-specific code */ | ||
723 | shmobile_timer.init = r8a7740_earlytimer_init; | ||
724 | } | 715 | } |
725 | 716 | ||
726 | #ifdef CONFIG_USE_OF | 717 | #ifdef CONFIG_USE_OF |
@@ -763,7 +754,7 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)") | |||
763 | .init_irq = r8a7740_init_irq, | 754 | .init_irq = r8a7740_init_irq, |
764 | .handle_irq = shmobile_handle_irq_intc, | 755 | .handle_irq = shmobile_handle_irq_intc, |
765 | .init_machine = r8a7740_add_standard_devices_dt, | 756 | .init_machine = r8a7740_add_standard_devices_dt, |
766 | .timer = &shmobile_timer, | 757 | .init_time = shmobile_timer_init, |
767 | .dt_compat = r8a7740_boards_compat_dt, | 758 | .dt_compat = r8a7740_boards_compat_dt, |
768 | MACHINE_END | 759 | MACHINE_END |
769 | 760 | ||
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 7a1ad4f38539..a181ced09e45 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c | |||
@@ -339,7 +339,7 @@ void __init r8a7779_add_standard_devices(void) | |||
339 | /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ | 339 | /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ |
340 | void __init __weak r8a7779_register_twd(void) { } | 340 | void __init __weak r8a7779_register_twd(void) { } |
341 | 341 | ||
342 | static void __init r8a7779_earlytimer_init(void) | 342 | void __init r8a7779_earlytimer_init(void) |
343 | { | 343 | { |
344 | r8a7779_clock_init(); | 344 | r8a7779_clock_init(); |
345 | shmobile_earlytimer_init(); | 345 | shmobile_earlytimer_init(); |
@@ -366,7 +366,4 @@ void __init r8a7779_add_early_devices(void) | |||
366 | * As a final step pass earlyprint=sh-sci.2,115200 on the kernel | 366 | * As a final step pass earlyprint=sh-sci.2,115200 on the kernel |
367 | * command line in case of the marzen board. | 367 | * command line in case of the marzen board. |
368 | */ | 368 | */ |
369 | |||
370 | /* override timer setup with soc-specific code */ | ||
371 | shmobile_timer.init = r8a7779_earlytimer_init; | ||
372 | } | 369 | } |
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index c917882424a7..191ae72e21ba 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c | |||
@@ -1054,7 +1054,7 @@ void __init sh7372_add_standard_devices(void) | |||
1054 | ARRAY_SIZE(domain_devices)); | 1054 | ARRAY_SIZE(domain_devices)); |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | static void __init sh7372_earlytimer_init(void) | 1057 | void __init sh7372_earlytimer_init(void) |
1058 | { | 1058 | { |
1059 | sh7372_clock_init(); | 1059 | sh7372_clock_init(); |
1060 | shmobile_earlytimer_init(); | 1060 | shmobile_earlytimer_init(); |
@@ -1067,9 +1067,6 @@ void __init sh7372_add_early_devices(void) | |||
1067 | 1067 | ||
1068 | /* setup early console here as well */ | 1068 | /* setup early console here as well */ |
1069 | shmobile_setup_console(); | 1069 | shmobile_setup_console(); |
1070 | |||
1071 | /* override timer setup with soc-specific code */ | ||
1072 | shmobile_timer.init = sh7372_earlytimer_init; | ||
1073 | } | 1070 | } |
1074 | 1071 | ||
1075 | #ifdef CONFIG_USE_OF | 1072 | #ifdef CONFIG_USE_OF |
@@ -1113,7 +1110,7 @@ DT_MACHINE_START(SH7372_DT, "Generic SH7372 (Flattened Device Tree)") | |||
1113 | .init_irq = sh7372_init_irq, | 1110 | .init_irq = sh7372_init_irq, |
1114 | .handle_irq = shmobile_handle_irq_intc, | 1111 | .handle_irq = shmobile_handle_irq_intc, |
1115 | .init_machine = sh7372_add_standard_devices_dt, | 1112 | .init_machine = sh7372_add_standard_devices_dt, |
1116 | .timer = &shmobile_timer, | 1113 | .init_time = shmobile_timer_init, |
1117 | .dt_compat = sh7372_boards_compat_dt, | 1114 | .dt_compat = sh7372_boards_compat_dt, |
1118 | MACHINE_END | 1115 | MACHINE_END |
1119 | 1116 | ||
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index db99a4ade80c..8c2d6424f470 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c | |||
@@ -796,7 +796,7 @@ void __init sh73a0_add_standard_devices(void) | |||
796 | /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ | 796 | /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ |
797 | void __init __weak sh73a0_register_twd(void) { } | 797 | void __init __weak sh73a0_register_twd(void) { } |
798 | 798 | ||
799 | static void __init sh73a0_earlytimer_init(void) | 799 | void __init sh73a0_earlytimer_init(void) |
800 | { | 800 | { |
801 | sh73a0_clock_init(); | 801 | sh73a0_clock_init(); |
802 | shmobile_earlytimer_init(); | 802 | shmobile_earlytimer_init(); |
@@ -810,7 +810,4 @@ void __init sh73a0_add_early_devices(void) | |||
810 | 810 | ||
811 | /* setup early console here as well */ | 811 | /* setup early console here as well */ |
812 | shmobile_setup_console(); | 812 | shmobile_setup_console(); |
813 | |||
814 | /* override timer setup with soc-specific code */ | ||
815 | shmobile_timer.init = sh73a0_earlytimer_init; | ||
816 | } | 813 | } |
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c index a68919727e24..fdbe54a11555 100644 --- a/arch/arm/mach-shmobile/timer.c +++ b/arch/arm/mach-shmobile/timer.c | |||
@@ -60,10 +60,6 @@ void __init shmobile_earlytimer_init(void) | |||
60 | late_time_init = shmobile_late_time_init; | 60 | late_time_init = shmobile_late_time_init; |
61 | } | 61 | } |
62 | 62 | ||
63 | static void __init shmobile_timer_init(void) | 63 | void __init shmobile_timer_init(void) |
64 | { | 64 | { |
65 | } | 65 | } |
66 | |||
67 | struct sys_timer shmobile_timer = { | ||
68 | .init = shmobile_timer_init, | ||
69 | }; | ||
diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c index 7d55febf2368..27d68468a027 100644 --- a/arch/arm/mach-socfpga/socfpga.c +++ b/arch/arm/mach-socfpga/socfpga.c | |||
@@ -101,7 +101,7 @@ DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA") | |||
101 | .smp = smp_ops(socfpga_smp_ops), | 101 | .smp = smp_ops(socfpga_smp_ops), |
102 | .map_io = socfpga_map_io, | 102 | .map_io = socfpga_map_io, |
103 | .init_irq = socfpga_init_irq, | 103 | .init_irq = socfpga_init_irq, |
104 | .timer = &dw_apb_timer, | 104 | .init_time = dw_apb_timer_init, |
105 | .init_machine = socfpga_cyclone5_init, | 105 | .init_machine = socfpga_cyclone5_init, |
106 | .restart = socfpga_cyclone5_restart, | 106 | .restart = socfpga_cyclone5_restart, |
107 | .dt_compat = altera_dt_match, | 107 | .dt_compat = altera_dt_match, |
diff --git a/arch/arm/mach-spear13xx/include/mach/generic.h b/arch/arm/mach-spear13xx/include/mach/generic.h index 510dec798221..633e678e01a3 100644 --- a/arch/arm/mach-spear13xx/include/mach/generic.h +++ b/arch/arm/mach-spear13xx/include/mach/generic.h | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <asm/mach/time.h> | 18 | #include <asm/mach/time.h> |
19 | 19 | ||
20 | /* Add spear13xx structure declarations here */ | 20 | /* Add spear13xx structure declarations here */ |
21 | extern struct sys_timer spear13xx_timer; | 21 | extern void spear13xx_timer_init(void); |
22 | extern struct pl022_ssp_controller pl022_plat_data; | 22 | extern struct pl022_ssp_controller pl022_plat_data; |
23 | extern struct dw_dma_platform_data dmac_plat_data; | 23 | extern struct dw_dma_platform_data dmac_plat_data; |
24 | extern struct dw_dma_slave cf_dma_priv; | 24 | extern struct dw_dma_slave cf_dma_priv; |
diff --git a/arch/arm/mach-spear13xx/spear1310.c b/arch/arm/mach-spear13xx/spear1310.c index 5de3e6f24aad..56214d1076ef 100644 --- a/arch/arm/mach-spear13xx/spear1310.c +++ b/arch/arm/mach-spear13xx/spear1310.c | |||
@@ -91,7 +91,7 @@ DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree") | |||
91 | .smp = smp_ops(spear13xx_smp_ops), | 91 | .smp = smp_ops(spear13xx_smp_ops), |
92 | .map_io = spear1310_map_io, | 92 | .map_io = spear1310_map_io, |
93 | .init_irq = irqchip_init, | 93 | .init_irq = irqchip_init, |
94 | .timer = &spear13xx_timer, | 94 | .init_time = spear13xx_timer_init, |
95 | .init_machine = spear1310_dt_init, | 95 | .init_machine = spear1310_dt_init, |
96 | .restart = spear_restart, | 96 | .restart = spear_restart, |
97 | .dt_compat = spear1310_dt_board_compat, | 97 | .dt_compat = spear1310_dt_board_compat, |
diff --git a/arch/arm/mach-spear13xx/spear1340.c b/arch/arm/mach-spear13xx/spear1340.c index 18331deaed76..9a28beb2a113 100644 --- a/arch/arm/mach-spear13xx/spear1340.c +++ b/arch/arm/mach-spear13xx/spear1340.c | |||
@@ -185,7 +185,7 @@ DT_MACHINE_START(SPEAR1340_DT, "ST SPEAr1340 SoC with Flattened Device Tree") | |||
185 | .smp = smp_ops(spear13xx_smp_ops), | 185 | .smp = smp_ops(spear13xx_smp_ops), |
186 | .map_io = spear13xx_map_io, | 186 | .map_io = spear13xx_map_io, |
187 | .init_irq = irqchip_init, | 187 | .init_irq = irqchip_init, |
188 | .timer = &spear13xx_timer, | 188 | .init_time = spear13xx_timer_init, |
189 | .init_machine = spear1340_dt_init, | 189 | .init_machine = spear1340_dt_init, |
190 | .restart = spear_restart, | 190 | .restart = spear_restart, |
191 | .dt_compat = spear1340_dt_board_compat, | 191 | .dt_compat = spear1340_dt_board_compat, |
diff --git a/arch/arm/mach-spear13xx/spear13xx.c b/arch/arm/mach-spear13xx/spear13xx.c index 22e3cd57e750..c7d2b4a8d8cc 100644 --- a/arch/arm/mach-spear13xx/spear13xx.c +++ b/arch/arm/mach-spear13xx/spear13xx.c | |||
@@ -152,7 +152,7 @@ static void __init spear13xx_clk_init(void) | |||
152 | pr_err("%s: Unknown machine\n", __func__); | 152 | pr_err("%s: Unknown machine\n", __func__); |
153 | } | 153 | } |
154 | 154 | ||
155 | static void __init spear13xx_timer_init(void) | 155 | void __init spear13xx_timer_init(void) |
156 | { | 156 | { |
157 | char pclk_name[] = "osc_24m_clk"; | 157 | char pclk_name[] = "osc_24m_clk"; |
158 | struct clk *gpt_clk, *pclk; | 158 | struct clk *gpt_clk, *pclk; |
@@ -181,7 +181,3 @@ static void __init spear13xx_timer_init(void) | |||
181 | spear_setup_of_timer(); | 181 | spear_setup_of_timer(); |
182 | twd_local_timer_of_register(); | 182 | twd_local_timer_of_register(); |
183 | } | 183 | } |
184 | |||
185 | struct sys_timer spear13xx_timer = { | ||
186 | .init = spear13xx_timer_init, | ||
187 | }; | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h index c26b7a4b1126..df310799e416 100644 --- a/arch/arm/mach-spear3xx/include/mach/generic.h +++ b/arch/arm/mach-spear3xx/include/mach/generic.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <asm/mach/map.h> | 22 | #include <asm/mach/map.h> |
23 | 23 | ||
24 | /* Add spear3xx family device structure declarations here */ | 24 | /* Add spear3xx family device structure declarations here */ |
25 | extern struct sys_timer spear3xx_timer; | 25 | extern void spear3xx_timer_init(void); |
26 | extern struct pl022_ssp_controller pl022_plat_data; | 26 | extern struct pl022_ssp_controller pl022_plat_data; |
27 | extern struct pl08x_platform_data pl080_plat_data; | 27 | extern struct pl08x_platform_data pl080_plat_data; |
28 | 28 | ||
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c index 499479bbbaf9..bbc9b7e9c62c 100644 --- a/arch/arm/mach-spear3xx/spear300.c +++ b/arch/arm/mach-spear3xx/spear300.c | |||
@@ -213,7 +213,7 @@ static void __init spear300_map_io(void) | |||
213 | DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree") | 213 | DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree") |
214 | .map_io = spear300_map_io, | 214 | .map_io = spear300_map_io, |
215 | .init_irq = irqchip_init, | 215 | .init_irq = irqchip_init, |
216 | .timer = &spear3xx_timer, | 216 | .init_time = spear3xx_timer_init, |
217 | .init_machine = spear300_dt_init, | 217 | .init_machine = spear300_dt_init, |
218 | .restart = spear_restart, | 218 | .restart = spear_restart, |
219 | .dt_compat = spear300_dt_board_compat, | 219 | .dt_compat = spear300_dt_board_compat, |
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c index 367d9be40ec1..c13a434a8195 100644 --- a/arch/arm/mach-spear3xx/spear310.c +++ b/arch/arm/mach-spear3xx/spear310.c | |||
@@ -255,7 +255,7 @@ static void __init spear310_map_io(void) | |||
255 | DT_MACHINE_START(SPEAR310_DT, "ST SPEAr310 SoC with Flattened Device Tree") | 255 | DT_MACHINE_START(SPEAR310_DT, "ST SPEAr310 SoC with Flattened Device Tree") |
256 | .map_io = spear310_map_io, | 256 | .map_io = spear310_map_io, |
257 | .init_irq = irqchip_init, | 257 | .init_irq = irqchip_init, |
258 | .timer = &spear3xx_timer, | 258 | .init_time = spear3xx_timer_init, |
259 | .init_machine = spear310_dt_init, | 259 | .init_machine = spear310_dt_init, |
260 | .restart = spear_restart, | 260 | .restart = spear_restart, |
261 | .dt_compat = spear310_dt_board_compat, | 261 | .dt_compat = spear310_dt_board_compat, |
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c index 34c212e6cbf6..e1c77079a3e5 100644 --- a/arch/arm/mach-spear3xx/spear320.c +++ b/arch/arm/mach-spear3xx/spear320.c | |||
@@ -269,7 +269,7 @@ static void __init spear320_map_io(void) | |||
269 | DT_MACHINE_START(SPEAR320_DT, "ST SPEAr320 SoC with Flattened Device Tree") | 269 | DT_MACHINE_START(SPEAR320_DT, "ST SPEAr320 SoC with Flattened Device Tree") |
270 | .map_io = spear320_map_io, | 270 | .map_io = spear320_map_io, |
271 | .init_irq = irqchip_init, | 271 | .init_irq = irqchip_init, |
272 | .timer = &spear3xx_timer, | 272 | .init_time = spear3xx_timer_init, |
273 | .init_machine = spear320_dt_init, | 273 | .init_machine = spear320_dt_init, |
274 | .restart = spear_restart, | 274 | .restart = spear_restart, |
275 | .dt_compat = spear320_dt_board_compat, | 275 | .dt_compat = spear320_dt_board_compat, |
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c index c6003ef0c9f6..b2ba516ca2d4 100644 --- a/arch/arm/mach-spear3xx/spear3xx.c +++ b/arch/arm/mach-spear3xx/spear3xx.c | |||
@@ -84,7 +84,7 @@ void __init spear3xx_map_io(void) | |||
84 | iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc)); | 84 | iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc)); |
85 | } | 85 | } |
86 | 86 | ||
87 | static void __init spear3xx_timer_init(void) | 87 | void __init spear3xx_timer_init(void) |
88 | { | 88 | { |
89 | char pclk_name[] = "pll3_clk"; | 89 | char pclk_name[] = "pll3_clk"; |
90 | struct clk *gpt_clk, *pclk; | 90 | struct clk *gpt_clk, *pclk; |
@@ -112,7 +112,3 @@ static void __init spear3xx_timer_init(void) | |||
112 | 112 | ||
113 | spear_setup_of_timer(); | 113 | spear_setup_of_timer(); |
114 | } | 114 | } |
115 | |||
116 | struct sys_timer spear3xx_timer = { | ||
117 | .init = spear3xx_timer_init, | ||
118 | }; | ||
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c index 3f6fac0fdb71..b8bd33ca88bd 100644 --- a/arch/arm/mach-spear6xx/spear6xx.c +++ b/arch/arm/mach-spear6xx/spear6xx.c | |||
@@ -373,7 +373,7 @@ void __init spear6xx_map_io(void) | |||
373 | iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc)); | 373 | iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc)); |
374 | } | 374 | } |
375 | 375 | ||
376 | static void __init spear6xx_timer_init(void) | 376 | void __init spear6xx_timer_init(void) |
377 | { | 377 | { |
378 | char pclk_name[] = "pll3_clk"; | 378 | char pclk_name[] = "pll3_clk"; |
379 | struct clk *gpt_clk, *pclk; | 379 | struct clk *gpt_clk, *pclk; |
@@ -402,10 +402,6 @@ static void __init spear6xx_timer_init(void) | |||
402 | spear_setup_of_timer(); | 402 | spear_setup_of_timer(); |
403 | } | 403 | } |
404 | 404 | ||
405 | struct sys_timer spear6xx_timer = { | ||
406 | .init = spear6xx_timer_init, | ||
407 | }; | ||
408 | |||
409 | /* Add auxdata to pass platform data */ | 405 | /* Add auxdata to pass platform data */ |
410 | struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = { | 406 | struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = { |
411 | OF_DEV_AUXDATA("arm,pl080", SPEAR6XX_ICM3_DMA_BASE, NULL, | 407 | OF_DEV_AUXDATA("arm,pl080", SPEAR6XX_ICM3_DMA_BASE, NULL, |
@@ -427,7 +423,7 @@ static const char *spear600_dt_board_compat[] = { | |||
427 | DT_MACHINE_START(SPEAR600_DT, "ST SPEAr600 (Flattened Device Tree)") | 423 | DT_MACHINE_START(SPEAR600_DT, "ST SPEAr600 (Flattened Device Tree)") |
428 | .map_io = spear6xx_map_io, | 424 | .map_io = spear6xx_map_io, |
429 | .init_irq = irqchip_init, | 425 | .init_irq = irqchip_init, |
430 | .timer = &spear6xx_timer, | 426 | .init_time = spear6xx_timer_init, |
431 | .init_machine = spear600_dt_init, | 427 | .init_machine = spear600_dt_init, |
432 | .restart = spear_restart, | 428 | .restart = spear_restart, |
433 | .dt_compat = spear600_dt_board_compat, | 429 | .dt_compat = spear600_dt_board_compat, |
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c index 0ff310eecdfd..fb8fbcecb17f 100644 --- a/arch/arm/mach-sunxi/sunxi.c +++ b/arch/arm/mach-sunxi/sunxi.c | |||
@@ -89,6 +89,6 @@ DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)") | |||
89 | .init_irq = sunxi_init_irq, | 89 | .init_irq = sunxi_init_irq, |
90 | .handle_irq = sunxi_handle_irq, | 90 | .handle_irq = sunxi_handle_irq, |
91 | .restart = sunxi_restart, | 91 | .restart = sunxi_restart, |
92 | .timer = &sunxi_timer, | 92 | .init_time = &sunxi_timer_init, |
93 | .dt_compat = sunxi_board_dt_compat, | 93 | .dt_compat = sunxi_board_dt_compat, |
94 | MACHINE_END | 94 | MACHINE_END |
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c index 04008c818535..5ed81bab2d4b 100644 --- a/arch/arm/mach-tegra/board-dt-tegra20.c +++ b/arch/arm/mach-tegra/board-dt-tegra20.c | |||
@@ -200,7 +200,7 @@ DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)") | |||
200 | .smp = smp_ops(tegra_smp_ops), | 200 | .smp = smp_ops(tegra_smp_ops), |
201 | .init_early = tegra20_init_early, | 201 | .init_early = tegra20_init_early, |
202 | .init_irq = tegra_dt_init_irq, | 202 | .init_irq = tegra_dt_init_irq, |
203 | .timer = &tegra_sys_timer, | 203 | .init_time = tegra_init_timer, |
204 | .init_machine = tegra_dt_init, | 204 | .init_machine = tegra_dt_init, |
205 | .init_late = tegra_dt_init_late, | 205 | .init_late = tegra_dt_init_late, |
206 | .restart = tegra_assert_system_reset, | 206 | .restart = tegra_assert_system_reset, |
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c index 672db8abdc38..12dc2ddeca64 100644 --- a/arch/arm/mach-tegra/board-dt-tegra30.c +++ b/arch/arm/mach-tegra/board-dt-tegra30.c | |||
@@ -111,7 +111,7 @@ DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)") | |||
111 | .map_io = tegra_map_common_io, | 111 | .map_io = tegra_map_common_io, |
112 | .init_early = tegra30_init_early, | 112 | .init_early = tegra30_init_early, |
113 | .init_irq = tegra_dt_init_irq, | 113 | .init_irq = tegra_dt_init_irq, |
114 | .timer = &tegra_sys_timer, | 114 | .init_time = tegra_init_timer, |
115 | .init_machine = tegra30_dt_init, | 115 | .init_machine = tegra30_dt_init, |
116 | .init_late = tegra_init_late, | 116 | .init_late = tegra_init_late, |
117 | .restart = tegra_assert_system_reset, | 117 | .restart = tegra_assert_system_reset, |
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index 91fbe733a21e..744cdd246f6a 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h | |||
@@ -55,5 +55,5 @@ static inline int harmony_pcie_init(void) { return 0; } | |||
55 | 55 | ||
56 | void __init tegra_paz00_wifikill_init(void); | 56 | void __init tegra_paz00_wifikill_init(void); |
57 | 57 | ||
58 | extern struct sys_timer tegra_sys_timer; | 58 | extern void tegra_init_timer(void); |
59 | #endif | 59 | #endif |
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c index e4863f3e9ee7..eba0969ded19 100644 --- a/arch/arm/mach-tegra/timer.c +++ b/arch/arm/mach-tegra/timer.c | |||
@@ -168,7 +168,7 @@ static const struct of_device_id rtc_match[] __initconst = { | |||
168 | {} | 168 | {} |
169 | }; | 169 | }; |
170 | 170 | ||
171 | static void __init tegra_init_timer(void) | 171 | void __init tegra_init_timer(void) |
172 | { | 172 | { |
173 | struct device_node *np; | 173 | struct device_node *np; |
174 | struct clk *clk; | 174 | struct clk *clk; |
@@ -259,24 +259,16 @@ static void __init tegra_init_timer(void) | |||
259 | BUG(); | 259 | BUG(); |
260 | } | 260 | } |
261 | 261 | ||
262 | clockevents_calc_mult_shift(&tegra_clockevent, 1000000, 5); | ||
263 | tegra_clockevent.max_delta_ns = | ||
264 | clockevent_delta2ns(0x1fffffff, &tegra_clockevent); | ||
265 | tegra_clockevent.min_delta_ns = | ||
266 | clockevent_delta2ns(0x1, &tegra_clockevent); | ||
267 | tegra_clockevent.cpumask = cpu_all_mask; | 262 | tegra_clockevent.cpumask = cpu_all_mask; |
268 | tegra_clockevent.irq = tegra_timer_irq.irq; | 263 | tegra_clockevent.irq = tegra_timer_irq.irq; |
269 | clockevents_register_device(&tegra_clockevent); | 264 | clockevents_config_and_register(&tegra_clockevent, 1000000, |
265 | 0x1, 0x1fffffff); | ||
270 | #ifdef CONFIG_HAVE_ARM_TWD | 266 | #ifdef CONFIG_HAVE_ARM_TWD |
271 | twd_local_timer_of_register(); | 267 | twd_local_timer_of_register(); |
272 | #endif | 268 | #endif |
273 | register_persistent_clock(NULL, tegra_read_persistent_clock); | 269 | register_persistent_clock(NULL, tegra_read_persistent_clock); |
274 | } | 270 | } |
275 | 271 | ||
276 | struct sys_timer tegra_sys_timer = { | ||
277 | .init = tegra_init_timer, | ||
278 | }; | ||
279 | |||
280 | #ifdef CONFIG_PM | 272 | #ifdef CONFIG_PM |
281 | static u32 usec_config; | 273 | static u32 usec_config; |
282 | 274 | ||
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index 26b48fa9ea62..12060ae4e8f1 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c | |||
@@ -1779,7 +1779,7 @@ MACHINE_START(U300, "Ericsson AB U335 S335/B335 Prototype Board") | |||
1779 | .map_io = u300_map_io, | 1779 | .map_io = u300_map_io, |
1780 | .nr_irqs = 0, | 1780 | .nr_irqs = 0, |
1781 | .init_irq = u300_init_irq, | 1781 | .init_irq = u300_init_irq, |
1782 | .timer = &u300_timer, | 1782 | .init_time = u300_timer_init, |
1783 | .init_machine = u300_init_machine, | 1783 | .init_machine = u300_init_machine, |
1784 | .restart = u300_restart, | 1784 | .restart = u300_restart, |
1785 | MACHINE_END | 1785 | MACHINE_END |
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index 1da10e20e996..d9e73209c9b8 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c | |||
@@ -349,7 +349,7 @@ static u32 notrace u300_read_sched_clock(void) | |||
349 | /* | 349 | /* |
350 | * This sets up the system timers, clock source and clock event. | 350 | * This sets up the system timers, clock source and clock event. |
351 | */ | 351 | */ |
352 | static void __init u300_timer_init(void) | 352 | void __init u300_timer_init(void) |
353 | { | 353 | { |
354 | struct clk *clk; | 354 | struct clk *clk; |
355 | unsigned long rate; | 355 | unsigned long rate; |
@@ -413,11 +413,3 @@ static void __init u300_timer_init(void) | |||
413 | * used by hrtimers! | 413 | * used by hrtimers! |
414 | */ | 414 | */ |
415 | } | 415 | } |
416 | |||
417 | /* | ||
418 | * Very simple system timer that only register the clock event and | ||
419 | * clock source. | ||
420 | */ | ||
421 | struct sys_timer u300_timer = { | ||
422 | .init = u300_timer_init, | ||
423 | }; | ||
diff --git a/arch/arm/mach-u300/timer.h b/arch/arm/mach-u300/timer.h index b5e9791762e0..d34287bc34f5 100644 --- a/arch/arm/mach-u300/timer.h +++ b/arch/arm/mach-u300/timer.h | |||
@@ -1 +1 @@ | |||
extern struct sys_timer u300_timer; | extern void u300_timer_init(void); | ||
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index af406c7b0d70..0e928d281759 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -750,7 +750,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform") | |||
750 | .map_io = u8500_map_io, | 750 | .map_io = u8500_map_io, |
751 | .init_irq = ux500_init_irq, | 751 | .init_irq = ux500_init_irq, |
752 | /* we re-use nomadik timer here */ | 752 | /* we re-use nomadik timer here */ |
753 | .timer = &ux500_timer, | 753 | .init_time = ux500_timer_init, |
754 | .init_machine = mop500_init_machine, | 754 | .init_machine = mop500_init_machine, |
755 | .init_late = ux500_init_late, | 755 | .init_late = ux500_init_late, |
756 | MACHINE_END | 756 | MACHINE_END |
@@ -759,7 +759,7 @@ MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520") | |||
759 | .atag_offset = 0x100, | 759 | .atag_offset = 0x100, |
760 | .map_io = u8500_map_io, | 760 | .map_io = u8500_map_io, |
761 | .init_irq = ux500_init_irq, | 761 | .init_irq = ux500_init_irq, |
762 | .timer = &ux500_timer, | 762 | .init_time = ux500_timer_init, |
763 | .init_machine = mop500_init_machine, | 763 | .init_machine = mop500_init_machine, |
764 | .init_late = ux500_init_late, | 764 | .init_late = ux500_init_late, |
765 | MACHINE_END | 765 | MACHINE_END |
@@ -769,7 +769,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") | |||
769 | .smp = smp_ops(ux500_smp_ops), | 769 | .smp = smp_ops(ux500_smp_ops), |
770 | .map_io = u8500_map_io, | 770 | .map_io = u8500_map_io, |
771 | .init_irq = ux500_init_irq, | 771 | .init_irq = ux500_init_irq, |
772 | .timer = &ux500_timer, | 772 | .init_time = ux500_timer_init, |
773 | .init_machine = hrefv60_init_machine, | 773 | .init_machine = hrefv60_init_machine, |
774 | .init_late = ux500_init_late, | 774 | .init_late = ux500_init_late, |
775 | MACHINE_END | 775 | MACHINE_END |
@@ -780,7 +780,7 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") | |||
780 | .map_io = u8500_map_io, | 780 | .map_io = u8500_map_io, |
781 | .init_irq = ux500_init_irq, | 781 | .init_irq = ux500_init_irq, |
782 | /* we re-use nomadik timer here */ | 782 | /* we re-use nomadik timer here */ |
783 | .timer = &ux500_timer, | 783 | .init_time = ux500_timer_init, |
784 | .init_machine = snowball_init_machine, | 784 | .init_machine = snowball_init_machine, |
785 | .init_late = NULL, | 785 | .init_late = NULL, |
786 | MACHINE_END | 786 | MACHINE_END |
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 4c91d767c99c..218a6b1ada7e 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -340,7 +340,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)") | |||
340 | .map_io = u8500_map_io, | 340 | .map_io = u8500_map_io, |
341 | .init_irq = ux500_init_irq, | 341 | .init_irq = ux500_init_irq, |
342 | /* we re-use nomadik timer here */ | 342 | /* we re-use nomadik timer here */ |
343 | .timer = &ux500_timer, | 343 | .init_time = ux500_timer_init, |
344 | .init_machine = u8500_init_machine, | 344 | .init_machine = u8500_init_machine, |
345 | .init_late = NULL, | 345 | .init_late = NULL, |
346 | .dt_compat = stericsson_dt_platform_compat, | 346 | .dt_compat = stericsson_dt_platform_compat, |
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h index 6be4c4d2ab88..bddce2b49372 100644 --- a/arch/arm/mach-ux500/include/mach/setup.h +++ b/arch/arm/mach-ux500/include/mach/setup.h | |||
@@ -28,8 +28,7 @@ extern struct device *ux500_soc_device_init(const char *soc_id); | |||
28 | struct amba_device; | 28 | struct amba_device; |
29 | extern void __init amba_add_devices(struct amba_device *devs[], int num); | 29 | extern void __init amba_add_devices(struct amba_device *devs[], int num); |
30 | 30 | ||
31 | struct sys_timer; | 31 | extern void ux500_timer_init(void); |
32 | extern struct sys_timer ux500_timer; | ||
33 | 32 | ||
34 | #define __IO_DEV_DESC(x, sz) { \ | 33 | #define __IO_DEV_DESC(x, sz) { \ |
35 | .virtual = IO_ADDRESS(x), \ | 34 | .virtual = IO_ADDRESS(x), \ |
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c index 875309acb022..aa2a78acb59e 100644 --- a/arch/arm/mach-ux500/timer.c +++ b/arch/arm/mach-ux500/timer.c | |||
@@ -46,7 +46,7 @@ const static struct of_device_id prcmu_timer_of_match[] __initconst = { | |||
46 | { }, | 46 | { }, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static void __init ux500_timer_init(void) | 49 | void __init ux500_timer_init(void) |
50 | { | 50 | { |
51 | void __iomem *mtu_timer_base; | 51 | void __iomem *mtu_timer_base; |
52 | void __iomem *prcmu_timer_base; | 52 | void __iomem *prcmu_timer_base; |
@@ -99,14 +99,3 @@ dt_fail: | |||
99 | clksrc_dbx500_prcmu_init(prcmu_timer_base); | 99 | clksrc_dbx500_prcmu_init(prcmu_timer_base); |
100 | ux500_twd_init(); | 100 | ux500_twd_init(); |
101 | } | 101 | } |
102 | |||
103 | static void ux500_timer_reset(void) | ||
104 | { | ||
105 | nmdk_clkevt_reset(); | ||
106 | nmdk_clksrc_reset(); | ||
107 | } | ||
108 | |||
109 | struct sys_timer ux500_timer = { | ||
110 | .init = ux500_timer_init, | ||
111 | .resume = ux500_timer_reset, | ||
112 | }; | ||
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 49ac384d2814..a42b89083eb2 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -770,7 +770,7 @@ void __init versatile_init(void) | |||
770 | /* | 770 | /* |
771 | * Set up timer interrupt, and return the current time in seconds. | 771 | * Set up timer interrupt, and return the current time in seconds. |
772 | */ | 772 | */ |
773 | static void __init versatile_timer_init(void) | 773 | void __init versatile_timer_init(void) |
774 | { | 774 | { |
775 | u32 val; | 775 | u32 val; |
776 | 776 | ||
@@ -797,8 +797,3 @@ static void __init versatile_timer_init(void) | |||
797 | sp804_clocksource_init(TIMER3_VA_BASE, "timer3"); | 797 | sp804_clocksource_init(TIMER3_VA_BASE, "timer3"); |
798 | sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, "timer0"); | 798 | sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, "timer0"); |
799 | } | 799 | } |
800 | |||
801 | struct sys_timer versatile_timer = { | ||
802 | .init = versatile_timer_init, | ||
803 | }; | ||
804 | |||
diff --git a/arch/arm/mach-versatile/core.h b/arch/arm/mach-versatile/core.h index 683e60776a85..5c1b87d1da6b 100644 --- a/arch/arm/mach-versatile/core.h +++ b/arch/arm/mach-versatile/core.h | |||
@@ -29,7 +29,7 @@ extern void __init versatile_init(void); | |||
29 | extern void __init versatile_init_early(void); | 29 | extern void __init versatile_init_early(void); |
30 | extern void __init versatile_init_irq(void); | 30 | extern void __init versatile_init_irq(void); |
31 | extern void __init versatile_map_io(void); | 31 | extern void __init versatile_map_io(void); |
32 | extern struct sys_timer versatile_timer; | 32 | extern void versatile_timer_init(void); |
33 | extern void versatile_restart(char, const char *); | 33 | extern void versatile_restart(char, const char *); |
34 | extern unsigned int mmc_status(struct device *dev); | 34 | extern unsigned int mmc_status(struct device *dev); |
35 | #ifdef CONFIG_OF | 35 | #ifdef CONFIG_OF |
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c index ddeec670d50d..1caef1093793 100644 --- a/arch/arm/mach-versatile/versatile_ab.c +++ b/arch/arm/mach-versatile/versatile_ab.c | |||
@@ -38,7 +38,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB") | |||
38 | .map_io = versatile_map_io, | 38 | .map_io = versatile_map_io, |
39 | .init_early = versatile_init_early, | 39 | .init_early = versatile_init_early, |
40 | .init_irq = versatile_init_irq, | 40 | .init_irq = versatile_init_irq, |
41 | .timer = &versatile_timer, | 41 | .init_time = versatile_timer_init, |
42 | .init_machine = versatile_init, | 42 | .init_machine = versatile_init, |
43 | .restart = versatile_restart, | 43 | .restart = versatile_restart, |
44 | MACHINE_END | 44 | MACHINE_END |
diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c index f48f2e4b667d..2558f2e957c3 100644 --- a/arch/arm/mach-versatile/versatile_dt.c +++ b/arch/arm/mach-versatile/versatile_dt.c | |||
@@ -45,7 +45,7 @@ DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)") | |||
45 | .map_io = versatile_map_io, | 45 | .map_io = versatile_map_io, |
46 | .init_early = versatile_init_early, | 46 | .init_early = versatile_init_early, |
47 | .init_irq = versatile_init_irq, | 47 | .init_irq = versatile_init_irq, |
48 | .timer = &versatile_timer, | 48 | .init_time = versatile_timer_init, |
49 | .init_machine = versatile_dt_init, | 49 | .init_machine = versatile_dt_init, |
50 | .dt_compat = versatile_dt_match, | 50 | .dt_compat = versatile_dt_match, |
51 | .restart = versatile_restart, | 51 | .restart = versatile_restart, |
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c index e52eb23a0a28..611d140c8695 100644 --- a/arch/arm/mach-versatile/versatile_pb.c +++ b/arch/arm/mach-versatile/versatile_pb.c | |||
@@ -106,7 +106,7 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB") | |||
106 | .map_io = versatile_map_io, | 106 | .map_io = versatile_map_io, |
107 | .init_early = versatile_init_early, | 107 | .init_early = versatile_init_early, |
108 | .init_irq = versatile_init_irq, | 108 | .init_irq = versatile_init_irq, |
109 | .timer = &versatile_timer, | 109 | .init_time = versatile_timer_init, |
110 | .init_machine = versatile_pb_init, | 110 | .init_machine = versatile_pb_init, |
111 | .restart = versatile_restart, | 111 | .restart = versatile_restart, |
112 | MACHINE_END | 112 | MACHINE_END |
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 82be02b3ae28..915683cb67d6 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -291,10 +291,6 @@ static void __init v2m_timer_init(void) | |||
291 | v2m_sp804_init(ioremap(V2M_TIMER01, SZ_4K), IRQ_V2M_TIMER0); | 291 | v2m_sp804_init(ioremap(V2M_TIMER01, SZ_4K), IRQ_V2M_TIMER0); |
292 | } | 292 | } |
293 | 293 | ||
294 | static struct sys_timer v2m_timer = { | ||
295 | .init = v2m_timer_init, | ||
296 | }; | ||
297 | |||
298 | static void __init v2m_init_early(void) | 294 | static void __init v2m_init_early(void) |
299 | { | 295 | { |
300 | if (ct_desc->init_early) | 296 | if (ct_desc->init_early) |
@@ -376,7 +372,7 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express") | |||
376 | .map_io = v2m_map_io, | 372 | .map_io = v2m_map_io, |
377 | .init_early = v2m_init_early, | 373 | .init_early = v2m_init_early, |
378 | .init_irq = v2m_init_irq, | 374 | .init_irq = v2m_init_irq, |
379 | .timer = &v2m_timer, | 375 | .init_time = v2m_timer_init, |
380 | .init_machine = v2m_init, | 376 | .init_machine = v2m_init, |
381 | .restart = vexpress_restart, | 377 | .restart = vexpress_restart, |
382 | MACHINE_END | 378 | MACHINE_END |
@@ -457,10 +453,6 @@ static void __init v2m_dt_timer_init(void) | |||
457 | 24000000); | 453 | 24000000); |
458 | } | 454 | } |
459 | 455 | ||
460 | static struct sys_timer v2m_dt_timer = { | ||
461 | .init = v2m_dt_timer_init, | ||
462 | }; | ||
463 | |||
464 | static const struct of_device_id v2m_dt_bus_match[] __initconst = { | 456 | static const struct of_device_id v2m_dt_bus_match[] __initconst = { |
465 | { .compatible = "simple-bus", }, | 457 | { .compatible = "simple-bus", }, |
466 | { .compatible = "arm,amba-bus", }, | 458 | { .compatible = "arm,amba-bus", }, |
@@ -487,7 +479,7 @@ DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express") | |||
487 | .map_io = v2m_dt_map_io, | 479 | .map_io = v2m_dt_map_io, |
488 | .init_early = v2m_dt_init_early, | 480 | .init_early = v2m_dt_init_early, |
489 | .init_irq = irqchip_init, | 481 | .init_irq = irqchip_init, |
490 | .timer = &v2m_dt_timer, | 482 | .init_time = v2m_dt_timer_init, |
491 | .init_machine = v2m_dt_init, | 483 | .init_machine = v2m_dt_init, |
492 | .restart = vexpress_restart, | 484 | .restart = vexpress_restart, |
493 | MACHINE_END | 485 | MACHINE_END |
diff --git a/arch/arm/mach-virt/Kconfig b/arch/arm/mach-virt/Kconfig new file mode 100644 index 000000000000..8958f0d896bc --- /dev/null +++ b/arch/arm/mach-virt/Kconfig | |||
@@ -0,0 +1,10 @@ | |||
1 | config ARCH_VIRT | ||
2 | bool "Dummy Virtual Machine" if ARCH_MULTI_V7 | ||
3 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
4 | select ARM_GIC | ||
5 | select ARM_ARCH_TIMER | ||
6 | select ARM_PSCI | ||
7 | select HAVE_SMP | ||
8 | select CPU_V7 | ||
9 | select SPARSE_IRQ | ||
10 | select USE_OF | ||
diff --git a/arch/arm/mach-virt/Makefile b/arch/arm/mach-virt/Makefile new file mode 100644 index 000000000000..042afc1f8c44 --- /dev/null +++ b/arch/arm/mach-virt/Makefile | |||
@@ -0,0 +1,6 @@ | |||
1 | # | ||
2 | # Makefile for the linux kernel. | ||
3 | # | ||
4 | |||
5 | obj-y := virt.o | ||
6 | obj-$(CONFIG_SMP) += platsmp.o | ||
diff --git a/arch/arm/mach-virt/platsmp.c b/arch/arm/mach-virt/platsmp.c new file mode 100644 index 000000000000..8badaabe70a1 --- /dev/null +++ b/arch/arm/mach-virt/platsmp.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * Dummy Virtual Machine - does what it says on the tin. | ||
3 | * | ||
4 | * Copyright (C) 2012 ARM Ltd | ||
5 | * Author: Will Deacon <will.deacon@arm.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #include <linux/init.h> | ||
21 | #include <linux/smp.h> | ||
22 | #include <linux/of.h> | ||
23 | |||
24 | #include <linux/irqchip/arm-gic.h> | ||
25 | |||
26 | #include <asm/psci.h> | ||
27 | #include <asm/smp_plat.h> | ||
28 | |||
29 | extern void secondary_startup(void); | ||
30 | |||
31 | static void __init virt_smp_init_cpus(void) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | static void __init virt_smp_prepare_cpus(unsigned int max_cpus) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | static int __cpuinit virt_boot_secondary(unsigned int cpu, | ||
40 | struct task_struct *idle) | ||
41 | { | ||
42 | if (psci_ops.cpu_on) | ||
43 | return psci_ops.cpu_on(cpu_logical_map(cpu), | ||
44 | __pa(secondary_startup)); | ||
45 | return -ENODEV; | ||
46 | } | ||
47 | |||
48 | static void __cpuinit virt_secondary_init(unsigned int cpu) | ||
49 | { | ||
50 | gic_secondary_init(0); | ||
51 | } | ||
52 | |||
53 | struct smp_operations __initdata virt_smp_ops = { | ||
54 | .smp_init_cpus = virt_smp_init_cpus, | ||
55 | .smp_prepare_cpus = virt_smp_prepare_cpus, | ||
56 | .smp_secondary_init = virt_secondary_init, | ||
57 | .smp_boot_secondary = virt_boot_secondary, | ||
58 | }; | ||
diff --git a/arch/arm/mach-virt/virt.c b/arch/arm/mach-virt/virt.c new file mode 100644 index 000000000000..31666f6b4373 --- /dev/null +++ b/arch/arm/mach-virt/virt.c | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * Dummy Virtual Machine - does what it says on the tin. | ||
3 | * | ||
4 | * Copyright (C) 2012 ARM Ltd | ||
5 | * Authors: Will Deacon <will.deacon@arm.com>, | ||
6 | * Marc Zyngier <marc.zyngier@arm.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #include <linux/irqchip.h> | ||
22 | #include <linux/of_irq.h> | ||
23 | #include <linux/of_platform.h> | ||
24 | #include <linux/smp.h> | ||
25 | |||
26 | #include <asm/arch_timer.h> | ||
27 | #include <asm/mach/arch.h> | ||
28 | #include <asm/mach/time.h> | ||
29 | |||
30 | static void __init virt_init(void) | ||
31 | { | ||
32 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
33 | } | ||
34 | |||
35 | static void __init virt_timer_init(void) | ||
36 | { | ||
37 | WARN_ON(arch_timer_of_register() != 0); | ||
38 | WARN_ON(arch_timer_sched_clock_init() != 0); | ||
39 | } | ||
40 | |||
41 | static const char *virt_dt_match[] = { | ||
42 | "linux,dummy-virt", | ||
43 | NULL | ||
44 | }; | ||
45 | |||
46 | extern struct smp_operations virt_smp_ops; | ||
47 | |||
48 | DT_MACHINE_START(VIRT, "Dummy Virtual Machine") | ||
49 | .init_irq = irqchip_init, | ||
50 | .init_time = virt_timer_init, | ||
51 | .init_machine = virt_init, | ||
52 | .smp = smp_ops(virt_smp_ops), | ||
53 | .dt_compat = virt_dt_match, | ||
54 | MACHINE_END | ||
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig index 2ed0b7d95db6..570a801fb862 100644 --- a/arch/arm/mach-vt8500/Kconfig +++ b/arch/arm/mach-vt8500/Kconfig | |||
@@ -8,5 +8,6 @@ config ARCH_VT8500 | |||
8 | select GENERIC_CLOCKEVENTS | 8 | select GENERIC_CLOCKEVENTS |
9 | select GENERIC_GPIO | 9 | select GENERIC_GPIO |
10 | select HAVE_CLK | 10 | select HAVE_CLK |
11 | select VT8500_TIMER | ||
11 | help | 12 | help |
12 | Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip. | 13 | Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip. |
diff --git a/arch/arm/mach-vt8500/Makefile b/arch/arm/mach-vt8500/Makefile index e035251cda48..92ceb2436b60 100644 --- a/arch/arm/mach-vt8500/Makefile +++ b/arch/arm/mach-vt8500/Makefile | |||
@@ -1 +1 @@ | |||
obj-$(CONFIG_ARCH_VT8500) += irq.o timer.o vt8500.o | obj-$(CONFIG_ARCH_VT8500) += irq.o vt8500.o | ||
diff --git a/arch/arm/mach-vt8500/common.h b/arch/arm/mach-vt8500/common.h index 6f2b843115db..77611a6968d6 100644 --- a/arch/arm/mach-vt8500/common.h +++ b/arch/arm/mach-vt8500/common.h | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | #include <linux/of.h> | 19 | #include <linux/of.h> |
20 | 20 | ||
21 | void __init vt8500_timer_init(void); | ||
22 | int __init vt8500_irq_init(struct device_node *node, | 21 | int __init vt8500_irq_init(struct device_node *node, |
23 | struct device_node *parent); | 22 | struct device_node *parent); |
24 | 23 | ||
diff --git a/arch/arm/mach-vt8500/vt8500.c b/arch/arm/mach-vt8500/vt8500.c index 3c66d48ea082..b9fd9d3cbfb3 100644 --- a/arch/arm/mach-vt8500/vt8500.c +++ b/arch/arm/mach-vt8500/vt8500.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/pm.h> | 22 | #include <linux/pm.h> |
23 | #include <linux/vt8500_timer.h> | ||
23 | 24 | ||
24 | #include <asm/mach-types.h> | 25 | #include <asm/mach-types.h> |
25 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
@@ -175,10 +176,6 @@ static void __init vt8500_init_irq(void) | |||
175 | of_irq_init(vt8500_irq_match); | 176 | of_irq_init(vt8500_irq_match); |
176 | }; | 177 | }; |
177 | 178 | ||
178 | static struct sys_timer vt8500_timer = { | ||
179 | .init = vt8500_timer_init, | ||
180 | }; | ||
181 | |||
182 | static const char * const vt8500_dt_compat[] = { | 179 | static const char * const vt8500_dt_compat[] = { |
183 | "via,vt8500", | 180 | "via,vt8500", |
184 | "wm,wm8650", | 181 | "wm,wm8650", |
@@ -189,7 +186,7 @@ DT_MACHINE_START(WMT_DT, "VIA/Wondermedia SoC (Device Tree Support)") | |||
189 | .dt_compat = vt8500_dt_compat, | 186 | .dt_compat = vt8500_dt_compat, |
190 | .map_io = vt8500_map_io, | 187 | .map_io = vt8500_map_io, |
191 | .init_irq = vt8500_init_irq, | 188 | .init_irq = vt8500_init_irq, |
192 | .timer = &vt8500_timer, | 189 | .init_time = vt8500_timer_init, |
193 | .init_machine = vt8500_init, | 190 | .init_machine = vt8500_init, |
194 | .restart = vt8500_restart, | 191 | .restart = vt8500_restart, |
195 | .handle_irq = vt8500_handle_irq, | 192 | .handle_irq = vt8500_handle_irq, |
diff --git a/arch/arm/mach-w90x900/mach-nuc910evb.c b/arch/arm/mach-w90x900/mach-nuc910evb.c index b4243e4f1565..92f1c978f35e 100644 --- a/arch/arm/mach-w90x900/mach-nuc910evb.c +++ b/arch/arm/mach-w90x900/mach-nuc910evb.c | |||
@@ -37,6 +37,6 @@ MACHINE_START(W90P910EVB, "W90P910EVB") | |||
37 | .map_io = nuc910evb_map_io, | 37 | .map_io = nuc910evb_map_io, |
38 | .init_irq = nuc900_init_irq, | 38 | .init_irq = nuc900_init_irq, |
39 | .init_machine = nuc910evb_init, | 39 | .init_machine = nuc910evb_init, |
40 | .timer = &nuc900_timer, | 40 | .init_time = nuc900_timer_init, |
41 | .restart = nuc9xx_restart, | 41 | .restart = nuc9xx_restart, |
42 | MACHINE_END | 42 | MACHINE_END |
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c index 500fe5932ce9..26f7189056e3 100644 --- a/arch/arm/mach-w90x900/mach-nuc950evb.c +++ b/arch/arm/mach-w90x900/mach-nuc950evb.c | |||
@@ -40,6 +40,6 @@ MACHINE_START(W90P950EVB, "W90P950EVB") | |||
40 | .map_io = nuc950evb_map_io, | 40 | .map_io = nuc950evb_map_io, |
41 | .init_irq = nuc900_init_irq, | 41 | .init_irq = nuc900_init_irq, |
42 | .init_machine = nuc950evb_init, | 42 | .init_machine = nuc950evb_init, |
43 | .timer = &nuc900_timer, | 43 | .init_time = nuc900_timer_init, |
44 | .restart = nuc9xx_restart, | 44 | .restart = nuc9xx_restart, |
45 | MACHINE_END | 45 | MACHINE_END |
diff --git a/arch/arm/mach-w90x900/mach-nuc960evb.c b/arch/arm/mach-w90x900/mach-nuc960evb.c index cbb3adc3db10..9b4e73fe10e5 100644 --- a/arch/arm/mach-w90x900/mach-nuc960evb.c +++ b/arch/arm/mach-w90x900/mach-nuc960evb.c | |||
@@ -37,6 +37,6 @@ MACHINE_START(W90N960EVB, "W90N960EVB") | |||
37 | .map_io = nuc960evb_map_io, | 37 | .map_io = nuc960evb_map_io, |
38 | .init_irq = nuc900_init_irq, | 38 | .init_irq = nuc900_init_irq, |
39 | .init_machine = nuc960evb_init, | 39 | .init_machine = nuc960evb_init, |
40 | .timer = &nuc900_timer, | 40 | .init_time = nuc900_timer_init, |
41 | .restart = nuc9xx_restart, | 41 | .restart = nuc9xx_restart, |
42 | MACHINE_END | 42 | MACHINE_END |
diff --git a/arch/arm/mach-w90x900/nuc9xx.h b/arch/arm/mach-w90x900/nuc9xx.h index 91acb4047793..88ef4b267089 100644 --- a/arch/arm/mach-w90x900/nuc9xx.h +++ b/arch/arm/mach-w90x900/nuc9xx.h | |||
@@ -15,10 +15,9 @@ | |||
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | struct map_desc; | 17 | struct map_desc; |
18 | struct sys_timer; | ||
19 | 18 | ||
20 | /* core initialisation functions */ | 19 | /* core initialisation functions */ |
21 | 20 | ||
22 | extern void nuc900_init_irq(void); | 21 | extern void nuc900_init_irq(void); |
23 | extern struct sys_timer nuc900_timer; | 22 | extern void nuc900_timer_init(void); |
24 | extern void nuc9xx_restart(char, const char *); | 23 | extern void nuc9xx_restart(char, const char *); |
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c index fa27c498ac09..30fbca844575 100644 --- a/arch/arm/mach-w90x900/time.c +++ b/arch/arm/mach-w90x900/time.c | |||
@@ -91,7 +91,6 @@ static int nuc900_clockevent_setnextevent(unsigned long evt, | |||
91 | 91 | ||
92 | static struct clock_event_device nuc900_clockevent_device = { | 92 | static struct clock_event_device nuc900_clockevent_device = { |
93 | .name = "nuc900-timer0", | 93 | .name = "nuc900-timer0", |
94 | .shift = 32, | ||
95 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 94 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
96 | .set_mode = nuc900_clockevent_setmode, | 95 | .set_mode = nuc900_clockevent_setmode, |
97 | .set_next_event = nuc900_clockevent_setnextevent, | 96 | .set_next_event = nuc900_clockevent_setnextevent, |
@@ -133,15 +132,10 @@ static void __init nuc900_clockevents_init(void) | |||
133 | __raw_writel(RESETINT, REG_TISR); | 132 | __raw_writel(RESETINT, REG_TISR); |
134 | setup_irq(IRQ_TIMER0, &nuc900_timer0_irq); | 133 | setup_irq(IRQ_TIMER0, &nuc900_timer0_irq); |
135 | 134 | ||
136 | nuc900_clockevent_device.mult = div_sc(rate, NSEC_PER_SEC, | ||
137 | nuc900_clockevent_device.shift); | ||
138 | nuc900_clockevent_device.max_delta_ns = clockevent_delta2ns(0xffffffff, | ||
139 | &nuc900_clockevent_device); | ||
140 | nuc900_clockevent_device.min_delta_ns = clockevent_delta2ns(0xf, | ||
141 | &nuc900_clockevent_device); | ||
142 | nuc900_clockevent_device.cpumask = cpumask_of(0); | 135 | nuc900_clockevent_device.cpumask = cpumask_of(0); |
143 | 136 | ||
144 | clockevents_register_device(&nuc900_clockevent_device); | 137 | clockevents_config_and_register(&nuc900_clockevent_device, rate, |
138 | 0xf, 0xffffffff); | ||
145 | } | 139 | } |
146 | 140 | ||
147 | static void __init nuc900_clocksource_init(void) | 141 | static void __init nuc900_clocksource_init(void) |
@@ -167,12 +161,8 @@ static void __init nuc900_clocksource_init(void) | |||
167 | TDR_SHIFT, clocksource_mmio_readl_down); | 161 | TDR_SHIFT, clocksource_mmio_readl_down); |
168 | } | 162 | } |
169 | 163 | ||
170 | static void __init nuc900_timer_init(void) | 164 | void __init nuc900_timer_init(void) |
171 | { | 165 | { |
172 | nuc900_clocksource_init(); | 166 | nuc900_clocksource_init(); |
173 | nuc900_clockevents_init(); | 167 | nuc900_clockevents_init(); |
174 | } | 168 | } |
175 | |||
176 | struct sys_timer nuc900_timer = { | ||
177 | .init = nuc900_timer_init, | ||
178 | }; | ||
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 2d96745dd9ad..6472a69cbfe1 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c | |||
@@ -79,13 +79,6 @@ static void __init xilinx_zynq_timer_init(void) | |||
79 | xttcpss_timer_init(); | 79 | xttcpss_timer_init(); |
80 | } | 80 | } |
81 | 81 | ||
82 | /* | ||
83 | * Instantiate and initialize the system timer structure | ||
84 | */ | ||
85 | static struct sys_timer xttcpss_sys_timer = { | ||
86 | .init = xilinx_zynq_timer_init, | ||
87 | }; | ||
88 | |||
89 | /** | 82 | /** |
90 | * xilinx_map_io() - Create memory mappings needed for early I/O. | 83 | * xilinx_map_io() - Create memory mappings needed for early I/O. |
91 | */ | 84 | */ |
@@ -105,6 +98,6 @@ MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") | |||
105 | .map_io = xilinx_map_io, | 98 | .map_io = xilinx_map_io, |
106 | .init_irq = irqchip_init, | 99 | .init_irq = irqchip_init, |
107 | .init_machine = xilinx_init_machine, | 100 | .init_machine = xilinx_init_machine, |
108 | .timer = &xttcpss_sys_timer, | 101 | .init_time = xilinx_zynq_timer_init, |
109 | .dt_compat = xilinx_dt_match, | 102 | .dt_compat = xilinx_dt_match, |
110 | MACHINE_END | 103 | MACHINE_END |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 076c26d43864..dda3904dc64c 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -640,7 +640,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, | |||
640 | 640 | ||
641 | if (is_coherent || nommu()) | 641 | if (is_coherent || nommu()) |
642 | addr = __alloc_simple_buffer(dev, size, gfp, &page); | 642 | addr = __alloc_simple_buffer(dev, size, gfp, &page); |
643 | else if (gfp & GFP_ATOMIC) | 643 | else if (!(gfp & __GFP_WAIT)) |
644 | addr = __alloc_from_pool(size, &page); | 644 | addr = __alloc_from_pool(size, &page); |
645 | else if (!IS_ENABLED(CONFIG_CMA)) | 645 | else if (!IS_ENABLED(CONFIG_CMA)) |
646 | addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller); | 646 | addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller); |
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c index cbfbbe461788..837a2d52e9db 100644 --- a/arch/arm/plat-iop/time.c +++ b/arch/arm/plat-iop/time.c | |||
@@ -156,14 +156,9 @@ void __init iop_init_time(unsigned long tick_rate) | |||
156 | write_tmr0(timer_ctl & ~IOP_TMR_EN); | 156 | write_tmr0(timer_ctl & ~IOP_TMR_EN); |
157 | write_tisr(1); | 157 | write_tisr(1); |
158 | setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); | 158 | setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); |
159 | clockevents_calc_mult_shift(&iop_clockevent, | ||
160 | tick_rate, IOP_MIN_RANGE); | ||
161 | iop_clockevent.max_delta_ns = | ||
162 | clockevent_delta2ns(0xfffffffe, &iop_clockevent); | ||
163 | iop_clockevent.min_delta_ns = | ||
164 | clockevent_delta2ns(0xf, &iop_clockevent); | ||
165 | iop_clockevent.cpumask = cpumask_of(0); | 159 | iop_clockevent.cpumask = cpumask_of(0); |
166 | clockevents_register_device(&iop_clockevent); | 160 | clockevents_config_and_register(&iop_clockevent, tick_rate, |
161 | 0xf, 0xfffffffe); | ||
167 | 162 | ||
168 | /* | 163 | /* |
169 | * Set up free-running clocksource timer 1. | 164 | * Set up free-running clocksource timer 1. |
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c index 0f4fa863dd55..5d5ac0f05422 100644 --- a/arch/arm/plat-orion/time.c +++ b/arch/arm/plat-orion/time.c | |||
@@ -156,7 +156,6 @@ orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev) | |||
156 | static struct clock_event_device orion_clkevt = { | 156 | static struct clock_event_device orion_clkevt = { |
157 | .name = "orion_tick", | 157 | .name = "orion_tick", |
158 | .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, | 158 | .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, |
159 | .shift = 32, | ||
160 | .rating = 300, | 159 | .rating = 300, |
161 | .set_next_event = orion_clkevt_next_event, | 160 | .set_next_event = orion_clkevt_next_event, |
162 | .set_mode = orion_clkevt_mode, | 161 | .set_mode = orion_clkevt_mode, |
@@ -221,9 +220,6 @@ orion_time_init(void __iomem *_bridge_base, u32 _bridge_timer1_clr_mask, | |||
221 | * Setup clockevent timer (interrupt-driven). | 220 | * Setup clockevent timer (interrupt-driven). |
222 | */ | 221 | */ |
223 | setup_irq(irq, &orion_timer_irq); | 222 | setup_irq(irq, &orion_timer_irq); |
224 | orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift); | ||
225 | orion_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe, &orion_clkevt); | ||
226 | orion_clkevt.min_delta_ns = clockevent_delta2ns(1, &orion_clkevt); | ||
227 | orion_clkevt.cpumask = cpumask_of(0); | 223 | orion_clkevt.cpumask = cpumask_of(0); |
228 | clockevents_register_device(&orion_clkevt); | 224 | clockevents_config_and_register(&orion_clkevt, tclk, 1, 0xfffffffe); |
229 | } | 225 | } |
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index b69e11dc679d..37703ef6dfc7 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h | |||
@@ -194,8 +194,7 @@ extern void s3c24xx_init_uartdevs(char *name, | |||
194 | 194 | ||
195 | /* timer for 2410/2440 */ | 195 | /* timer for 2410/2440 */ |
196 | 196 | ||
197 | struct sys_timer; | 197 | extern void s3c24xx_timer_init(void); |
198 | extern struct sys_timer s3c24xx_timer; | ||
199 | 198 | ||
200 | extern struct syscore_ops s3c2410_pm_syscore_ops; | 199 | extern struct syscore_ops s3c2410_pm_syscore_ops; |
201 | extern struct syscore_ops s3c2412_pm_syscore_ops; | 200 | extern struct syscore_ops s3c2412_pm_syscore_ops; |
diff --git a/arch/arm/plat-samsung/include/plat/s5p-time.h b/arch/arm/plat-samsung/include/plat/s5p-time.h index 3a70aebc9205..9c96f3586ce0 100644 --- a/arch/arm/plat-samsung/include/plat/s5p-time.h +++ b/arch/arm/plat-samsung/include/plat/s5p-time.h | |||
@@ -36,5 +36,5 @@ struct s5p_timer_source { | |||
36 | 36 | ||
37 | extern void __init s5p_set_timer_source(enum s5p_timer_mode event, | 37 | extern void __init s5p_set_timer_source(enum s5p_timer_mode event, |
38 | enum s5p_timer_mode source); | 38 | enum s5p_timer_mode source); |
39 | extern struct sys_timer s5p_timer; | 39 | extern void s5p_timer_init(void); |
40 | #endif /* __ASM_PLAT_S5P_TIME_H */ | 40 | #endif /* __ASM_PLAT_S5P_TIME_H */ |
diff --git a/arch/arm/plat-samsung/s5p-time.c b/arch/arm/plat-samsung/s5p-time.c index 028b6e877eb9..e92510cf82ee 100644 --- a/arch/arm/plat-samsung/s5p-time.c +++ b/arch/arm/plat-samsung/s5p-time.c | |||
@@ -274,15 +274,8 @@ static void __init s5p_clockevent_init(void) | |||
274 | clock_rate = clk_get_rate(tin_event); | 274 | clock_rate = clk_get_rate(tin_event); |
275 | clock_count_per_tick = clock_rate / HZ; | 275 | clock_count_per_tick = clock_rate / HZ; |
276 | 276 | ||
277 | clockevents_calc_mult_shift(&time_event_device, | ||
278 | clock_rate, S5PTIMER_MIN_RANGE); | ||
279 | time_event_device.max_delta_ns = | ||
280 | clockevent_delta2ns(-1, &time_event_device); | ||
281 | time_event_device.min_delta_ns = | ||
282 | clockevent_delta2ns(1, &time_event_device); | ||
283 | |||
284 | time_event_device.cpumask = cpumask_of(0); | 277 | time_event_device.cpumask = cpumask_of(0); |
285 | clockevents_register_device(&time_event_device); | 278 | clockevents_config_and_register(&time_event_device, clock_rate, 1, -1); |
286 | 279 | ||
287 | irq_number = timer_source.event_id + IRQ_TIMER0; | 280 | irq_number = timer_source.event_id + IRQ_TIMER0; |
288 | setup_irq(irq_number, &s5p_clock_event_irq); | 281 | setup_irq(irq_number, &s5p_clock_event_irq); |
@@ -393,13 +386,9 @@ static void __init s5p_timer_resources(void) | |||
393 | clk_enable(tin_source); | 386 | clk_enable(tin_source); |
394 | } | 387 | } |
395 | 388 | ||
396 | static void __init s5p_timer_init(void) | 389 | void __init s5p_timer_init(void) |
397 | { | 390 | { |
398 | s5p_timer_resources(); | 391 | s5p_timer_resources(); |
399 | s5p_clockevent_init(); | 392 | s5p_clockevent_init(); |
400 | s5p_clocksource_init(); | 393 | s5p_clocksource_init(); |
401 | } | 394 | } |
402 | |||
403 | struct sys_timer s5p_timer = { | ||
404 | .init = s5p_timer_init, | ||
405 | }; | ||
diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c index 60552e22f22e..73defd00c3e4 100644 --- a/arch/arm/plat-samsung/time.c +++ b/arch/arm/plat-samsung/time.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | #include <linux/syscore_ops.h> | ||
30 | 31 | ||
31 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
32 | 33 | ||
@@ -95,7 +96,7 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks) | |||
95 | * IRQs are disabled before entering here from do_gettimeofday() | 96 | * IRQs are disabled before entering here from do_gettimeofday() |
96 | */ | 97 | */ |
97 | 98 | ||
98 | static unsigned long s3c2410_gettimeoffset (void) | 99 | static u32 s3c2410_gettimeoffset(void) |
99 | { | 100 | { |
100 | unsigned long tdone; | 101 | unsigned long tdone; |
101 | unsigned long tval; | 102 | unsigned long tval; |
@@ -120,7 +121,7 @@ static unsigned long s3c2410_gettimeoffset (void) | |||
120 | tdone += timer_startval; | 121 | tdone += timer_startval; |
121 | } | 122 | } |
122 | 123 | ||
123 | return timer_ticks_to_usec(tdone); | 124 | return timer_ticks_to_usec(tdone) * 1000; |
124 | } | 125 | } |
125 | 126 | ||
126 | 127 | ||
@@ -271,15 +272,16 @@ static void __init s3c2410_timer_resources(void) | |||
271 | clk_enable(tin); | 272 | clk_enable(tin); |
272 | } | 273 | } |
273 | 274 | ||
274 | static void __init s3c2410_timer_init(void) | 275 | static struct syscore_ops s3c24xx_syscore_ops = { |
276 | .resume = s3c2410_timer_setup, | ||
277 | }; | ||
278 | |||
279 | void __init s3c24xx_timer_init(void) | ||
275 | { | 280 | { |
281 | arch_gettimeoffset = s3c2410_gettimeoffset; | ||
282 | |||
276 | s3c2410_timer_resources(); | 283 | s3c2410_timer_resources(); |
277 | s3c2410_timer_setup(); | 284 | s3c2410_timer_setup(); |
278 | setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); | 285 | setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); |
286 | register_syscore_ops(&s3c24xx_syscore_ops); | ||
279 | } | 287 | } |
280 | |||
281 | struct sys_timer s3c24xx_timer = { | ||
282 | .init = s3c2410_timer_init, | ||
283 | .offset = s3c2410_gettimeoffset, | ||
284 | .resume = s3c2410_timer_setup | ||
285 | }; | ||
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c index 03321af5de9f..bd5c53cd6962 100644 --- a/arch/arm/plat-spear/time.c +++ b/arch/arm/plat-spear/time.c | |||
@@ -186,15 +186,9 @@ static void __init spear_clockevent_init(int irq) | |||
186 | tick_rate = clk_get_rate(gpt_clk); | 186 | tick_rate = clk_get_rate(gpt_clk); |
187 | tick_rate >>= CTRL_PRESCALER16; | 187 | tick_rate >>= CTRL_PRESCALER16; |
188 | 188 | ||
189 | clockevents_calc_mult_shift(&clkevt, tick_rate, SPEAR_MIN_RANGE); | ||
190 | |||
191 | clkevt.max_delta_ns = clockevent_delta2ns(0xfff0, | ||
192 | &clkevt); | ||
193 | clkevt.min_delta_ns = clockevent_delta2ns(3, &clkevt); | ||
194 | |||
195 | clkevt.cpumask = cpumask_of(0); | 189 | clkevt.cpumask = cpumask_of(0); |
196 | 190 | ||
197 | clockevents_register_device(&clkevt); | 191 | clockevents_config_and_register(&clkevt, tick_rate, 3, 0xfff0); |
198 | 192 | ||
199 | setup_irq(irq, &spear_timer_irq); | 193 | setup_irq(irq, &spear_timer_irq); |
200 | } | 194 | } |
diff --git a/arch/avr32/include/asm/dma-mapping.h b/arch/avr32/include/asm/dma-mapping.h index aaf5199d8fcb..b3d18f9f3e8d 100644 --- a/arch/avr32/include/asm/dma-mapping.h +++ b/arch/avr32/include/asm/dma-mapping.h | |||
@@ -336,4 +336,14 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
336 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 336 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
337 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 337 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
338 | 338 | ||
339 | /* drivers/base/dma-mapping.c */ | ||
340 | extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, | ||
341 | void *cpu_addr, dma_addr_t dma_addr, size_t size); | ||
342 | extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
343 | void *cpu_addr, dma_addr_t dma_addr, | ||
344 | size_t size); | ||
345 | |||
346 | #define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s) | ||
347 | #define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s) | ||
348 | |||
339 | #endif /* __ASM_AVR32_DMA_MAPPING_H */ | 349 | #endif /* __ASM_AVR32_DMA_MAPPING_H */ |
diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h index bbf461076a0a..054d9ec57d9d 100644 --- a/arch/blackfin/include/asm/dma-mapping.h +++ b/arch/blackfin/include/asm/dma-mapping.h | |||
@@ -154,4 +154,14 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size, | |||
154 | _dma_sync((dma_addr_t)vaddr, size, dir); | 154 | _dma_sync((dma_addr_t)vaddr, size, dir); |
155 | } | 155 | } |
156 | 156 | ||
157 | /* drivers/base/dma-mapping.c */ | ||
158 | extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, | ||
159 | void *cpu_addr, dma_addr_t dma_addr, size_t size); | ||
160 | extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
161 | void *cpu_addr, dma_addr_t dma_addr, | ||
162 | size_t size); | ||
163 | |||
164 | #define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s) | ||
165 | #define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s) | ||
166 | |||
157 | #endif /* _BLACKFIN_DMA_MAPPING_H */ | 167 | #endif /* _BLACKFIN_DMA_MAPPING_H */ |
diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c index 2310b249675f..3126b920a4a5 100644 --- a/arch/blackfin/kernel/time.c +++ b/arch/blackfin/kernel/time.c | |||
@@ -85,7 +85,7 @@ time_sched_init(irqreturn_t(*timer_routine) (int, void *)) | |||
85 | /* | 85 | /* |
86 | * Should return useconds since last timer tick | 86 | * Should return useconds since last timer tick |
87 | */ | 87 | */ |
88 | u32 arch_gettimeoffset(void) | 88 | static u32 blackfin_gettimeoffset(void) |
89 | { | 89 | { |
90 | unsigned long offset; | 90 | unsigned long offset; |
91 | unsigned long clocks_per_jiffy; | 91 | unsigned long clocks_per_jiffy; |
@@ -141,6 +141,10 @@ void read_persistent_clock(struct timespec *ts) | |||
141 | 141 | ||
142 | void __init time_init(void) | 142 | void __init time_init(void) |
143 | { | 143 | { |
144 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | ||
145 | arch_gettimeoffset = blackfin_gettimeoffset; | ||
146 | #endif | ||
147 | |||
144 | #ifdef CONFIG_RTC_DRV_BFIN | 148 | #ifdef CONFIG_RTC_DRV_BFIN |
145 | /* [#2663] hack to filter junk RTC values that would cause | 149 | /* [#2663] hack to filter junk RTC values that would cause |
146 | * userspace to have to deal with time values greater than | 150 | * userspace to have to deal with time values greater than |
diff --git a/arch/c6x/include/asm/dma-mapping.h b/arch/c6x/include/asm/dma-mapping.h index 3c694065030f..88bd0d899bdb 100644 --- a/arch/c6x/include/asm/dma-mapping.h +++ b/arch/c6x/include/asm/dma-mapping.h | |||
@@ -89,4 +89,19 @@ extern void dma_free_coherent(struct device *, size_t, void *, dma_addr_t); | |||
89 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent((d), (s), (h), (f)) | 89 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent((d), (s), (h), (f)) |
90 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent((d), (s), (v), (h)) | 90 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent((d), (s), (v), (h)) |
91 | 91 | ||
92 | /* Not supported for now */ | ||
93 | static inline int dma_mmap_coherent(struct device *dev, | ||
94 | struct vm_area_struct *vma, void *cpu_addr, | ||
95 | dma_addr_t dma_addr, size_t size) | ||
96 | { | ||
97 | return -EINVAL; | ||
98 | } | ||
99 | |||
100 | static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
101 | void *cpu_addr, dma_addr_t dma_addr, | ||
102 | size_t size) | ||
103 | { | ||
104 | return -EINVAL; | ||
105 | } | ||
106 | |||
92 | #endif /* _ASM_C6X_DMA_MAPPING_H */ | 107 | #endif /* _ASM_C6X_DMA_MAPPING_H */ |
diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c index bcffcb6a9415..fce7c541d70d 100644 --- a/arch/cris/arch-v10/kernel/time.c +++ b/arch/cris/arch-v10/kernel/time.c | |||
@@ -55,9 +55,9 @@ unsigned long get_ns_in_jiffie(void) | |||
55 | return ns; | 55 | return ns; |
56 | } | 56 | } |
57 | 57 | ||
58 | unsigned long do_slow_gettimeoffset(void) | 58 | static u32 cris_v10_gettimeoffset(void) |
59 | { | 59 | { |
60 | unsigned long count; | 60 | u32 count; |
61 | 61 | ||
62 | /* The timer interrupt comes from Etrax timer 0. In order to get | 62 | /* The timer interrupt comes from Etrax timer 0. In order to get |
63 | * better precision, we check the current value. It might have | 63 | * better precision, we check the current value. It might have |
@@ -65,8 +65,8 @@ unsigned long do_slow_gettimeoffset(void) | |||
65 | */ | 65 | */ |
66 | count = *R_TIMER0_DATA; | 66 | count = *R_TIMER0_DATA; |
67 | 67 | ||
68 | /* Convert timer value to usec */ | 68 | /* Convert timer value to nsec */ |
69 | return (TIMER0_DIV - count) * ((NSEC_PER_SEC/1000)/HZ)/TIMER0_DIV; | 69 | return (TIMER0_DIV - count) * (NSEC_PER_SEC/HZ)/TIMER0_DIV; |
70 | } | 70 | } |
71 | 71 | ||
72 | /* Excerpt from the Etrax100 HSDD about the built-in watchdog: | 72 | /* Excerpt from the Etrax100 HSDD about the built-in watchdog: |
@@ -191,6 +191,8 @@ static struct irqaction irq2 = { | |||
191 | void __init | 191 | void __init |
192 | time_init(void) | 192 | time_init(void) |
193 | { | 193 | { |
194 | arch_gettimeoffset = cris_v10_gettimeoffset; | ||
195 | |||
194 | /* probe for the RTC and read it if it exists | 196 | /* probe for the RTC and read it if it exists |
195 | * Before the RTC can be probed the loops_per_usec variable needs | 197 | * Before the RTC can be probed the loops_per_usec variable needs |
196 | * to be initialized to make usleep work. A better value for | 198 | * to be initialized to make usleep work. A better value for |
diff --git a/arch/cris/include/asm/dma-mapping.h b/arch/cris/include/asm/dma-mapping.h index 8588b2ccf854..2f0f654f1b44 100644 --- a/arch/cris/include/asm/dma-mapping.h +++ b/arch/cris/include/asm/dma-mapping.h | |||
@@ -158,5 +158,15 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size, | |||
158 | { | 158 | { |
159 | } | 159 | } |
160 | 160 | ||
161 | /* drivers/base/dma-mapping.c */ | ||
162 | extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, | ||
163 | void *cpu_addr, dma_addr_t dma_addr, size_t size); | ||
164 | extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
165 | void *cpu_addr, dma_addr_t dma_addr, | ||
166 | size_t size); | ||
167 | |||
168 | #define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s) | ||
169 | #define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s) | ||
170 | |||
161 | 171 | ||
162 | #endif | 172 | #endif |
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c index 277ffc459e4b..fe6acdabbc8d 100644 --- a/arch/cris/kernel/time.c +++ b/arch/cris/kernel/time.c | |||
@@ -39,17 +39,6 @@ | |||
39 | extern unsigned long loops_per_jiffy; /* init/main.c */ | 39 | extern unsigned long loops_per_jiffy; /* init/main.c */ |
40 | unsigned long loops_per_usec; | 40 | unsigned long loops_per_usec; |
41 | 41 | ||
42 | |||
43 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | ||
44 | extern unsigned long do_slow_gettimeoffset(void); | ||
45 | static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset; | ||
46 | |||
47 | u32 arch_gettimeoffset(void) | ||
48 | { | ||
49 | return do_gettimeoffset() * 1000; | ||
50 | } | ||
51 | #endif | ||
52 | |||
53 | int set_rtc_mmss(unsigned long nowtime) | 42 | int set_rtc_mmss(unsigned long nowtime) |
54 | { | 43 | { |
55 | D(printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime)); | 44 | D(printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime)); |
diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h index dfb811002c64..1746a2b8e6e7 100644 --- a/arch/frv/include/asm/dma-mapping.h +++ b/arch/frv/include/asm/dma-mapping.h | |||
@@ -132,4 +132,19 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | |||
132 | flush_write_buffers(); | 132 | flush_write_buffers(); |
133 | } | 133 | } |
134 | 134 | ||
135 | /* Not supported for now */ | ||
136 | static inline int dma_mmap_coherent(struct device *dev, | ||
137 | struct vm_area_struct *vma, void *cpu_addr, | ||
138 | dma_addr_t dma_addr, size_t size) | ||
139 | { | ||
140 | return -EINVAL; | ||
141 | } | ||
142 | |||
143 | static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
144 | void *cpu_addr, dma_addr_t dma_addr, | ||
145 | size_t size) | ||
146 | { | ||
147 | return -EINVAL; | ||
148 | } | ||
149 | |||
135 | #endif /* _ASM_DMA_MAPPING_H */ | 150 | #endif /* _ASM_DMA_MAPPING_H */ |
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c index 84dd04048db9..1a15f81ea1bd 100644 --- a/arch/m32r/kernel/time.c +++ b/arch/m32r/kernel/time.c | |||
@@ -57,7 +57,7 @@ extern void smp_local_timer_interrupt(void); | |||
57 | 57 | ||
58 | static unsigned long latch; | 58 | static unsigned long latch; |
59 | 59 | ||
60 | u32 arch_gettimeoffset(void) | 60 | static u32 m32r_gettimeoffset(void) |
61 | { | 61 | { |
62 | unsigned long elapsed_time = 0; /* [us] */ | 62 | unsigned long elapsed_time = 0; /* [us] */ |
63 | 63 | ||
@@ -165,6 +165,8 @@ void read_persistent_clock(struct timespec *ts) | |||
165 | 165 | ||
166 | void __init time_init(void) | 166 | void __init time_init(void) |
167 | { | 167 | { |
168 | arch_gettimeoffset = m32r_gettimeoffset; | ||
169 | |||
168 | #if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \ | 170 | #if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \ |
169 | || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \ | 171 | || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \ |
170 | || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) | 172 | || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) |
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index ee01b7a38e58..b819390e29cd 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c | |||
@@ -95,7 +95,7 @@ static void amiga_sched_init(irq_handler_t handler); | |||
95 | static void amiga_get_model(char *model); | 95 | static void amiga_get_model(char *model); |
96 | static void amiga_get_hardware_list(struct seq_file *m); | 96 | static void amiga_get_hardware_list(struct seq_file *m); |
97 | /* amiga specific timer functions */ | 97 | /* amiga specific timer functions */ |
98 | static unsigned long amiga_gettimeoffset(void); | 98 | static u32 amiga_gettimeoffset(void); |
99 | extern void amiga_mksound(unsigned int count, unsigned int ticks); | 99 | extern void amiga_mksound(unsigned int count, unsigned int ticks); |
100 | static void amiga_reset(void); | 100 | static void amiga_reset(void); |
101 | extern void amiga_init_sound(void); | 101 | extern void amiga_init_sound(void); |
@@ -377,7 +377,7 @@ void __init config_amiga(void) | |||
377 | mach_init_IRQ = amiga_init_IRQ; | 377 | mach_init_IRQ = amiga_init_IRQ; |
378 | mach_get_model = amiga_get_model; | 378 | mach_get_model = amiga_get_model; |
379 | mach_get_hardware_list = amiga_get_hardware_list; | 379 | mach_get_hardware_list = amiga_get_hardware_list; |
380 | mach_gettimeoffset = amiga_gettimeoffset; | 380 | arch_gettimeoffset = amiga_gettimeoffset; |
381 | 381 | ||
382 | /* | 382 | /* |
383 | * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI | 383 | * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI |
@@ -482,10 +482,10 @@ static void __init amiga_sched_init(irq_handler_t timer_routine) | |||
482 | #define TICK_SIZE 10000 | 482 | #define TICK_SIZE 10000 |
483 | 483 | ||
484 | /* This is always executed with interrupts disabled. */ | 484 | /* This is always executed with interrupts disabled. */ |
485 | static unsigned long amiga_gettimeoffset(void) | 485 | static u32 amiga_gettimeoffset(void) |
486 | { | 486 | { |
487 | unsigned short hi, lo, hi2; | 487 | unsigned short hi, lo, hi2; |
488 | unsigned long ticks, offset = 0; | 488 | u32 ticks, offset = 0; |
489 | 489 | ||
490 | /* read CIA B timer A current value */ | 490 | /* read CIA B timer A current value */ |
491 | hi = ciab.tahi; | 491 | hi = ciab.tahi; |
@@ -507,7 +507,7 @@ static unsigned long amiga_gettimeoffset(void) | |||
507 | ticks = jiffy_ticks - ticks; | 507 | ticks = jiffy_ticks - ticks; |
508 | ticks = (10000 * ticks) / jiffy_ticks; | 508 | ticks = (10000 * ticks) / jiffy_ticks; |
509 | 509 | ||
510 | return ticks + offset; | 510 | return (ticks + offset) * 1000; |
511 | } | 511 | } |
512 | 512 | ||
513 | static void amiga_reset(void) __noreturn; | 513 | static void amiga_reset(void) __noreturn; |
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index f5565d6eeb8e..3ea56b90e718 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c | |||
@@ -26,7 +26,7 @@ u_long apollo_model; | |||
26 | 26 | ||
27 | extern void dn_sched_init(irq_handler_t handler); | 27 | extern void dn_sched_init(irq_handler_t handler); |
28 | extern void dn_init_IRQ(void); | 28 | extern void dn_init_IRQ(void); |
29 | extern unsigned long dn_gettimeoffset(void); | 29 | extern u32 dn_gettimeoffset(void); |
30 | extern int dn_dummy_hwclk(int, struct rtc_time *); | 30 | extern int dn_dummy_hwclk(int, struct rtc_time *); |
31 | extern int dn_dummy_set_clock_mmss(unsigned long); | 31 | extern int dn_dummy_set_clock_mmss(unsigned long); |
32 | extern void dn_dummy_reset(void); | 32 | extern void dn_dummy_reset(void); |
@@ -151,7 +151,7 @@ void __init config_apollo(void) | |||
151 | 151 | ||
152 | mach_sched_init=dn_sched_init; /* */ | 152 | mach_sched_init=dn_sched_init; /* */ |
153 | mach_init_IRQ=dn_init_IRQ; | 153 | mach_init_IRQ=dn_init_IRQ; |
154 | mach_gettimeoffset = dn_gettimeoffset; | 154 | arch_gettimeoffset = dn_gettimeoffset; |
155 | mach_max_dma_address = 0xffffffff; | 155 | mach_max_dma_address = 0xffffffff; |
156 | mach_hwclk = dn_dummy_hwclk; /* */ | 156 | mach_hwclk = dn_dummy_hwclk; /* */ |
157 | mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */ | 157 | mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */ |
@@ -203,10 +203,9 @@ void dn_sched_init(irq_handler_t timer_routine) | |||
203 | pr_err("Couldn't register timer interrupt\n"); | 203 | pr_err("Couldn't register timer interrupt\n"); |
204 | } | 204 | } |
205 | 205 | ||
206 | unsigned long dn_gettimeoffset(void) { | 206 | u32 dn_gettimeoffset(void) |
207 | 207 | { | |
208 | return 0xdeadbeef; | 208 | return 0xdeadbeef; |
209 | |||
210 | } | 209 | } |
211 | 210 | ||
212 | int dn_dummy_hwclk(int op, struct rtc_time *t) { | 211 | int dn_dummy_hwclk(int op, struct rtc_time *t) { |
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index d8eb32747ac5..037c11c99331 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c | |||
@@ -74,7 +74,7 @@ static void atari_heartbeat(int on); | |||
74 | 74 | ||
75 | /* atari specific timer functions (in time.c) */ | 75 | /* atari specific timer functions (in time.c) */ |
76 | extern void atari_sched_init(irq_handler_t); | 76 | extern void atari_sched_init(irq_handler_t); |
77 | extern unsigned long atari_gettimeoffset (void); | 77 | extern u32 atari_gettimeoffset(void); |
78 | extern int atari_mste_hwclk (int, struct rtc_time *); | 78 | extern int atari_mste_hwclk (int, struct rtc_time *); |
79 | extern int atari_tt_hwclk (int, struct rtc_time *); | 79 | extern int atari_tt_hwclk (int, struct rtc_time *); |
80 | extern int atari_mste_set_clock_mmss (unsigned long); | 80 | extern int atari_mste_set_clock_mmss (unsigned long); |
@@ -204,7 +204,7 @@ void __init config_atari(void) | |||
204 | mach_init_IRQ = atari_init_IRQ; | 204 | mach_init_IRQ = atari_init_IRQ; |
205 | mach_get_model = atari_get_model; | 205 | mach_get_model = atari_get_model; |
206 | mach_get_hardware_list = atari_get_hardware_list; | 206 | mach_get_hardware_list = atari_get_hardware_list; |
207 | mach_gettimeoffset = atari_gettimeoffset; | 207 | arch_gettimeoffset = atari_gettimeoffset; |
208 | mach_reset = atari_reset; | 208 | mach_reset = atari_reset; |
209 | mach_max_dma_address = 0xffffff; | 209 | mach_max_dma_address = 0xffffff; |
210 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) | 210 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) |
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index c0cc68a2c829..da8f981c36d6 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c | |||
@@ -42,9 +42,9 @@ atari_sched_init(irq_handler_t timer_routine) | |||
42 | #define TICK_SIZE 10000 | 42 | #define TICK_SIZE 10000 |
43 | 43 | ||
44 | /* This is always executed with interrupts disabled. */ | 44 | /* This is always executed with interrupts disabled. */ |
45 | unsigned long atari_gettimeoffset (void) | 45 | u32 atari_gettimeoffset(void) |
46 | { | 46 | { |
47 | unsigned long ticks, offset = 0; | 47 | u32 ticks, offset = 0; |
48 | 48 | ||
49 | /* read MFP timer C current value */ | 49 | /* read MFP timer C current value */ |
50 | ticks = st_mfp.tim_dt_c; | 50 | ticks = st_mfp.tim_dt_c; |
@@ -57,7 +57,7 @@ unsigned long atari_gettimeoffset (void) | |||
57 | ticks = INT_TICKS - ticks; | 57 | ticks = INT_TICKS - ticks; |
58 | ticks = ticks * 10000L / INT_TICKS; | 58 | ticks = ticks * 10000L / INT_TICKS; |
59 | 59 | ||
60 | return ticks + offset; | 60 | return (ticks + offset) * 1000; |
61 | } | 61 | } |
62 | 62 | ||
63 | 63 | ||
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index 0bf850a20ea2..8943aa4c18e6 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | static void bvme6000_get_model(char *model); | 39 | static void bvme6000_get_model(char *model); |
40 | extern void bvme6000_sched_init(irq_handler_t handler); | 40 | extern void bvme6000_sched_init(irq_handler_t handler); |
41 | extern unsigned long bvme6000_gettimeoffset (void); | 41 | extern u32 bvme6000_gettimeoffset(void); |
42 | extern int bvme6000_hwclk (int, struct rtc_time *); | 42 | extern int bvme6000_hwclk (int, struct rtc_time *); |
43 | extern int bvme6000_set_clock_mmss (unsigned long); | 43 | extern int bvme6000_set_clock_mmss (unsigned long); |
44 | extern void bvme6000_reset (void); | 44 | extern void bvme6000_reset (void); |
@@ -110,7 +110,7 @@ void __init config_bvme6000(void) | |||
110 | mach_max_dma_address = 0xffffffff; | 110 | mach_max_dma_address = 0xffffffff; |
111 | mach_sched_init = bvme6000_sched_init; | 111 | mach_sched_init = bvme6000_sched_init; |
112 | mach_init_IRQ = bvme6000_init_IRQ; | 112 | mach_init_IRQ = bvme6000_init_IRQ; |
113 | mach_gettimeoffset = bvme6000_gettimeoffset; | 113 | arch_gettimeoffset = bvme6000_gettimeoffset; |
114 | mach_hwclk = bvme6000_hwclk; | 114 | mach_hwclk = bvme6000_hwclk; |
115 | mach_set_clock_mmss = bvme6000_set_clock_mmss; | 115 | mach_set_clock_mmss = bvme6000_set_clock_mmss; |
116 | mach_reset = bvme6000_reset; | 116 | mach_reset = bvme6000_reset; |
@@ -216,13 +216,13 @@ void bvme6000_sched_init (irq_handler_t timer_routine) | |||
216 | * results... | 216 | * results... |
217 | */ | 217 | */ |
218 | 218 | ||
219 | unsigned long bvme6000_gettimeoffset (void) | 219 | u32 bvme6000_gettimeoffset(void) |
220 | { | 220 | { |
221 | volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; | 221 | volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; |
222 | volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE; | 222 | volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE; |
223 | unsigned char msr = rtc->msr & 0xc0; | 223 | unsigned char msr = rtc->msr & 0xc0; |
224 | unsigned char t1int, t1op; | 224 | unsigned char t1int, t1op; |
225 | unsigned long v = 800000, ov; | 225 | u32 v = 800000, ov; |
226 | 226 | ||
227 | rtc->msr = 0; /* Ensure timer registers accessible */ | 227 | rtc->msr = 0; /* Ensure timer registers accessible */ |
228 | 228 | ||
@@ -246,7 +246,7 @@ unsigned long bvme6000_gettimeoffset (void) | |||
246 | v += 10000; /* Int pending, + 10ms */ | 246 | v += 10000; /* Int pending, + 10ms */ |
247 | rtc->msr = msr; | 247 | rtc->msr = msr; |
248 | 248 | ||
249 | return v; | 249 | return v * 1000; |
250 | } | 250 | } |
251 | 251 | ||
252 | /* | 252 | /* |
diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c index bf16af1edacf..b7609f791522 100644 --- a/arch/m68k/hp300/config.c +++ b/arch/m68k/hp300/config.c | |||
@@ -251,7 +251,7 @@ void __init config_hp300(void) | |||
251 | mach_sched_init = hp300_sched_init; | 251 | mach_sched_init = hp300_sched_init; |
252 | mach_init_IRQ = hp300_init_IRQ; | 252 | mach_init_IRQ = hp300_init_IRQ; |
253 | mach_get_model = hp300_get_model; | 253 | mach_get_model = hp300_get_model; |
254 | mach_gettimeoffset = hp300_gettimeoffset; | 254 | arch_gettimeoffset = hp300_gettimeoffset; |
255 | mach_hwclk = hp300_hwclk; | 255 | mach_hwclk = hp300_hwclk; |
256 | mach_get_ss = hp300_get_ss; | 256 | mach_get_ss = hp300_get_ss; |
257 | mach_reset = hp300_reset; | 257 | mach_reset = hp300_reset; |
diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index 29a71be9fa5b..749543b425a4 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c | |||
@@ -46,7 +46,7 @@ static irqreturn_t hp300_tick(int irq, void *dev_id) | |||
46 | return vector(irq, NULL); | 46 | return vector(irq, NULL); |
47 | } | 47 | } |
48 | 48 | ||
49 | unsigned long hp300_gettimeoffset(void) | 49 | u32 hp300_gettimeoffset(void) |
50 | { | 50 | { |
51 | /* Read current timer 1 value */ | 51 | /* Read current timer 1 value */ |
52 | unsigned char lsb, msb1, msb2; | 52 | unsigned char lsb, msb1, msb2; |
@@ -59,7 +59,7 @@ unsigned long hp300_gettimeoffset(void) | |||
59 | /* A carry happened while we were reading. Read it again */ | 59 | /* A carry happened while we were reading. Read it again */ |
60 | lsb = in_8(CLOCKBASE + 7); | 60 | lsb = in_8(CLOCKBASE + 7); |
61 | ticks = INTVAL - ((msb2 << 8) | lsb); | 61 | ticks = INTVAL - ((msb2 << 8) | lsb); |
62 | return (USECS_PER_JIFFY * ticks) / INTVAL; | 62 | return ((USECS_PER_JIFFY * ticks) / INTVAL) * 1000; |
63 | } | 63 | } |
64 | 64 | ||
65 | void __init hp300_sched_init(irq_handler_t vector) | 65 | void __init hp300_sched_init(irq_handler_t vector) |
diff --git a/arch/m68k/hp300/time.h b/arch/m68k/hp300/time.h index 7b98242960de..f5583ec4033d 100644 --- a/arch/m68k/hp300/time.h +++ b/arch/m68k/hp300/time.h | |||
@@ -1,2 +1,2 @@ | |||
1 | extern void hp300_sched_init(irq_handler_t vector); | 1 | extern void hp300_sched_init(irq_handler_t vector); |
2 | extern unsigned long hp300_gettimeoffset(void); | 2 | extern u32 hp300_gettimeoffset(void); |
diff --git a/arch/m68k/include/asm/dma-mapping.h b/arch/m68k/include/asm/dma-mapping.h index 3e6b8445af6a..292805f0762e 100644 --- a/arch/m68k/include/asm/dma-mapping.h +++ b/arch/m68k/include/asm/dma-mapping.h | |||
@@ -115,4 +115,14 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t handle) | |||
115 | #include <asm-generic/dma-mapping-broken.h> | 115 | #include <asm-generic/dma-mapping-broken.h> |
116 | #endif | 116 | #endif |
117 | 117 | ||
118 | /* drivers/base/dma-mapping.c */ | ||
119 | extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, | ||
120 | void *cpu_addr, dma_addr_t dma_addr, size_t size); | ||
121 | extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
122 | void *cpu_addr, dma_addr_t dma_addr, | ||
123 | size_t size); | ||
124 | |||
125 | #define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s) | ||
126 | #define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s) | ||
127 | |||
118 | #endif /* _M68K_DMA_MAPPING_H */ | 128 | #endif /* _M68K_DMA_MAPPING_H */ |
diff --git a/arch/m68k/include/asm/machdep.h b/arch/m68k/include/asm/machdep.h index 825c1c813196..953ca21da8ee 100644 --- a/arch/m68k/include/asm/machdep.h +++ b/arch/m68k/include/asm/machdep.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/seq_file.h> | 4 | #include <linux/seq_file.h> |
5 | #include <linux/interrupt.h> | 5 | #include <linux/interrupt.h> |
6 | #include <linux/time.h> | ||
6 | 7 | ||
7 | struct pt_regs; | 8 | struct pt_regs; |
8 | struct mktime; | 9 | struct mktime; |
@@ -16,7 +17,6 @@ extern void (*mach_init_IRQ) (void); | |||
16 | extern void (*mach_get_model) (char *model); | 17 | extern void (*mach_get_model) (char *model); |
17 | extern void (*mach_get_hardware_list) (struct seq_file *m); | 18 | extern void (*mach_get_hardware_list) (struct seq_file *m); |
18 | /* machine dependent timer functions */ | 19 | /* machine dependent timer functions */ |
19 | extern unsigned long (*mach_gettimeoffset)(void); | ||
20 | extern int (*mach_hwclk)(int, struct rtc_time*); | 20 | extern int (*mach_hwclk)(int, struct rtc_time*); |
21 | extern unsigned int (*mach_get_ss)(void); | 21 | extern unsigned int (*mach_get_ss)(void); |
22 | extern int (*mach_get_rtc_pll)(struct rtc_pll_info *); | 22 | extern int (*mach_get_rtc_pll)(struct rtc_pll_info *); |
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index d872ce4807c9..80cfbe56ea32 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c | |||
@@ -84,7 +84,6 @@ void (*mach_init_IRQ) (void) __initdata = NULL; | |||
84 | void (*mach_get_model) (char *model); | 84 | void (*mach_get_model) (char *model); |
85 | void (*mach_get_hardware_list) (struct seq_file *m); | 85 | void (*mach_get_hardware_list) (struct seq_file *m); |
86 | /* machine dependent timer functions */ | 86 | /* machine dependent timer functions */ |
87 | unsigned long (*mach_gettimeoffset) (void); | ||
88 | int (*mach_hwclk) (int, struct rtc_time*); | 87 | int (*mach_hwclk) (int, struct rtc_time*); |
89 | EXPORT_SYMBOL(mach_hwclk); | 88 | EXPORT_SYMBOL(mach_hwclk); |
90 | int (*mach_set_clock_mmss) (unsigned long); | 89 | int (*mach_set_clock_mmss) (unsigned long); |
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index 5d0bcaad2e55..bea6bcf8f9b8 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c | |||
@@ -80,18 +80,8 @@ void read_persistent_clock(struct timespec *ts) | |||
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | void __init time_init(void) | ||
84 | { | ||
85 | mach_sched_init(timer_interrupt); | ||
86 | } | ||
87 | |||
88 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | 83 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET |
89 | 84 | ||
90 | u32 arch_gettimeoffset(void) | ||
91 | { | ||
92 | return mach_gettimeoffset() * 1000; | ||
93 | } | ||
94 | |||
95 | static int __init rtc_init(void) | 85 | static int __init rtc_init(void) |
96 | { | 86 | { |
97 | struct platform_device *pdev; | 87 | struct platform_device *pdev; |
@@ -106,3 +96,8 @@ static int __init rtc_init(void) | |||
106 | module_init(rtc_init); | 96 | module_init(rtc_init); |
107 | 97 | ||
108 | #endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */ | 98 | #endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */ |
99 | |||
100 | void __init time_init(void) | ||
101 | { | ||
102 | mach_sched_init(timer_interrupt); | ||
103 | } | ||
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index d9f62e0f46c0..afb95d5fb26b 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
@@ -52,7 +52,7 @@ struct mac_booter_data mac_bi_data; | |||
52 | static unsigned long mac_orig_videoaddr; | 52 | static unsigned long mac_orig_videoaddr; |
53 | 53 | ||
54 | /* Mac specific timer functions */ | 54 | /* Mac specific timer functions */ |
55 | extern unsigned long mac_gettimeoffset(void); | 55 | extern u32 mac_gettimeoffset(void); |
56 | extern int mac_hwclk(int, struct rtc_time *); | 56 | extern int mac_hwclk(int, struct rtc_time *); |
57 | extern int mac_set_clock_mmss(unsigned long); | 57 | extern int mac_set_clock_mmss(unsigned long); |
58 | extern void iop_preinit(void); | 58 | extern void iop_preinit(void); |
@@ -177,7 +177,7 @@ void __init config_mac(void) | |||
177 | mach_sched_init = mac_sched_init; | 177 | mach_sched_init = mac_sched_init; |
178 | mach_init_IRQ = mac_init_IRQ; | 178 | mach_init_IRQ = mac_init_IRQ; |
179 | mach_get_model = mac_get_model; | 179 | mach_get_model = mac_get_model; |
180 | mach_gettimeoffset = mac_gettimeoffset; | 180 | arch_gettimeoffset = mac_gettimeoffset; |
181 | mach_hwclk = mac_hwclk; | 181 | mach_hwclk = mac_hwclk; |
182 | mach_set_clock_mmss = mac_set_clock_mmss; | 182 | mach_set_clock_mmss = mac_set_clock_mmss; |
183 | mach_reset = mac_reset; | 183 | mach_reset = mac_reset; |
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 2d85662715fb..5d1458bb871b 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c | |||
@@ -327,7 +327,7 @@ void via_debug_dump(void) | |||
327 | * TBI: get time offset between scheduling timer ticks | 327 | * TBI: get time offset between scheduling timer ticks |
328 | */ | 328 | */ |
329 | 329 | ||
330 | unsigned long mac_gettimeoffset (void) | 330 | u32 mac_gettimeoffset(void) |
331 | { | 331 | { |
332 | unsigned long ticks, offset = 0; | 332 | unsigned long ticks, offset = 0; |
333 | 333 | ||
@@ -341,7 +341,7 @@ unsigned long mac_gettimeoffset (void) | |||
341 | ticks = MAC_CLOCK_TICK - ticks; | 341 | ticks = MAC_CLOCK_TICK - ticks; |
342 | ticks = ticks * 10000L / MAC_CLOCK_TICK; | 342 | ticks = ticks * 10000L / MAC_CLOCK_TICK; |
343 | 343 | ||
344 | return ticks + offset; | 344 | return (ticks + offset) * 1000; |
345 | } | 345 | } |
346 | 346 | ||
347 | /* | 347 | /* |
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index a41c09149e23..1c6262803b94 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | static void mvme147_get_model(char *model); | 38 | static void mvme147_get_model(char *model); |
39 | extern void mvme147_sched_init(irq_handler_t handler); | 39 | extern void mvme147_sched_init(irq_handler_t handler); |
40 | extern unsigned long mvme147_gettimeoffset (void); | 40 | extern u32 mvme147_gettimeoffset(void); |
41 | extern int mvme147_hwclk (int, struct rtc_time *); | 41 | extern int mvme147_hwclk (int, struct rtc_time *); |
42 | extern int mvme147_set_clock_mmss (unsigned long); | 42 | extern int mvme147_set_clock_mmss (unsigned long); |
43 | extern void mvme147_reset (void); | 43 | extern void mvme147_reset (void); |
@@ -88,7 +88,7 @@ void __init config_mvme147(void) | |||
88 | mach_max_dma_address = 0x01000000; | 88 | mach_max_dma_address = 0x01000000; |
89 | mach_sched_init = mvme147_sched_init; | 89 | mach_sched_init = mvme147_sched_init; |
90 | mach_init_IRQ = mvme147_init_IRQ; | 90 | mach_init_IRQ = mvme147_init_IRQ; |
91 | mach_gettimeoffset = mvme147_gettimeoffset; | 91 | arch_gettimeoffset = mvme147_gettimeoffset; |
92 | mach_hwclk = mvme147_hwclk; | 92 | mach_hwclk = mvme147_hwclk; |
93 | mach_set_clock_mmss = mvme147_set_clock_mmss; | 93 | mach_set_clock_mmss = mvme147_set_clock_mmss; |
94 | mach_reset = mvme147_reset; | 94 | mach_reset = mvme147_reset; |
@@ -127,7 +127,7 @@ void mvme147_sched_init (irq_handler_t timer_routine) | |||
127 | 127 | ||
128 | /* This is always executed with interrupts disabled. */ | 128 | /* This is always executed with interrupts disabled. */ |
129 | /* XXX There are race hazards in this code XXX */ | 129 | /* XXX There are race hazards in this code XXX */ |
130 | unsigned long mvme147_gettimeoffset (void) | 130 | u32 mvme147_gettimeoffset(void) |
131 | { | 131 | { |
132 | volatile unsigned short *cp = (volatile unsigned short *)0xfffe1012; | 132 | volatile unsigned short *cp = (volatile unsigned short *)0xfffe1012; |
133 | unsigned short n; | 133 | unsigned short n; |
@@ -137,7 +137,7 @@ unsigned long mvme147_gettimeoffset (void) | |||
137 | n = *cp; | 137 | n = *cp; |
138 | 138 | ||
139 | n -= PCC_TIMER_PRELOAD; | 139 | n -= PCC_TIMER_PRELOAD; |
140 | return (unsigned long)n * 25 / 4; | 140 | return ((unsigned long)n * 25 / 4) * 1000; |
141 | } | 141 | } |
142 | 142 | ||
143 | static int bcd2int (unsigned char b) | 143 | static int bcd2int (unsigned char b) |
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index b6d7d8a7a3dd..080a342458a1 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c | |||
@@ -43,7 +43,7 @@ static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; | |||
43 | 43 | ||
44 | static void mvme16x_get_model(char *model); | 44 | static void mvme16x_get_model(char *model); |
45 | extern void mvme16x_sched_init(irq_handler_t handler); | 45 | extern void mvme16x_sched_init(irq_handler_t handler); |
46 | extern unsigned long mvme16x_gettimeoffset (void); | 46 | extern u32 mvme16x_gettimeoffset(void); |
47 | extern int mvme16x_hwclk (int, struct rtc_time *); | 47 | extern int mvme16x_hwclk (int, struct rtc_time *); |
48 | extern int mvme16x_set_clock_mmss (unsigned long); | 48 | extern int mvme16x_set_clock_mmss (unsigned long); |
49 | extern void mvme16x_reset (void); | 49 | extern void mvme16x_reset (void); |
@@ -289,7 +289,7 @@ void __init config_mvme16x(void) | |||
289 | mach_max_dma_address = 0xffffffff; | 289 | mach_max_dma_address = 0xffffffff; |
290 | mach_sched_init = mvme16x_sched_init; | 290 | mach_sched_init = mvme16x_sched_init; |
291 | mach_init_IRQ = mvme16x_init_IRQ; | 291 | mach_init_IRQ = mvme16x_init_IRQ; |
292 | mach_gettimeoffset = mvme16x_gettimeoffset; | 292 | arch_gettimeoffset = mvme16x_gettimeoffset; |
293 | mach_hwclk = mvme16x_hwclk; | 293 | mach_hwclk = mvme16x_hwclk; |
294 | mach_set_clock_mmss = mvme16x_set_clock_mmss; | 294 | mach_set_clock_mmss = mvme16x_set_clock_mmss; |
295 | mach_reset = mvme16x_reset; | 295 | mach_reset = mvme16x_reset; |
@@ -405,9 +405,9 @@ void mvme16x_sched_init (irq_handler_t timer_routine) | |||
405 | 405 | ||
406 | 406 | ||
407 | /* This is always executed with interrupts disabled. */ | 407 | /* This is always executed with interrupts disabled. */ |
408 | unsigned long mvme16x_gettimeoffset (void) | 408 | u32 mvme16x_gettimeoffset(void) |
409 | { | 409 | { |
410 | return (*(volatile unsigned long *)0xfff42008); | 410 | return (*(volatile u32 *)0xfff42008) * 1000; |
411 | } | 411 | } |
412 | 412 | ||
413 | int bcd2int (unsigned char b) | 413 | int bcd2int (unsigned char b) |
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 1adb5b7b0d1a..658542b914fc 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c | |||
@@ -40,7 +40,7 @@ extern void q40_init_IRQ(void); | |||
40 | static void q40_get_model(char *model); | 40 | static void q40_get_model(char *model); |
41 | extern void q40_sched_init(irq_handler_t handler); | 41 | extern void q40_sched_init(irq_handler_t handler); |
42 | 42 | ||
43 | static unsigned long q40_gettimeoffset(void); | 43 | static u32 q40_gettimeoffset(void); |
44 | static int q40_hwclk(int, struct rtc_time *); | 44 | static int q40_hwclk(int, struct rtc_time *); |
45 | static unsigned int q40_get_ss(void); | 45 | static unsigned int q40_get_ss(void); |
46 | static int q40_set_clock_mmss(unsigned long); | 46 | static int q40_set_clock_mmss(unsigned long); |
@@ -170,7 +170,7 @@ void __init config_q40(void) | |||
170 | mach_sched_init = q40_sched_init; | 170 | mach_sched_init = q40_sched_init; |
171 | 171 | ||
172 | mach_init_IRQ = q40_init_IRQ; | 172 | mach_init_IRQ = q40_init_IRQ; |
173 | mach_gettimeoffset = q40_gettimeoffset; | 173 | arch_gettimeoffset = q40_gettimeoffset; |
174 | mach_hwclk = q40_hwclk; | 174 | mach_hwclk = q40_hwclk; |
175 | mach_get_ss = q40_get_ss; | 175 | mach_get_ss = q40_get_ss; |
176 | mach_get_rtc_pll = q40_get_rtc_pll; | 176 | mach_get_rtc_pll = q40_get_rtc_pll; |
@@ -204,9 +204,9 @@ int q40_parse_bootinfo(const struct bi_record *rec) | |||
204 | } | 204 | } |
205 | 205 | ||
206 | 206 | ||
207 | static unsigned long q40_gettimeoffset(void) | 207 | static u32 q40_gettimeoffset(void) |
208 | { | 208 | { |
209 | return 5000 * (ql_ticks != 0); | 209 | return 5000 * (ql_ticks != 0) * 1000; |
210 | } | 210 | } |
211 | 211 | ||
212 | 212 | ||
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 2ca25bd01a96..f59ec58083f8 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c | |||
@@ -36,7 +36,7 @@ | |||
36 | 36 | ||
37 | char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; | 37 | char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; |
38 | 38 | ||
39 | extern unsigned long sun3_gettimeoffset(void); | 39 | extern u32 sun3_gettimeoffset(void); |
40 | static void sun3_sched_init(irq_handler_t handler); | 40 | static void sun3_sched_init(irq_handler_t handler); |
41 | extern void sun3_get_model (char* model); | 41 | extern void sun3_get_model (char* model); |
42 | extern int sun3_hwclk(int set, struct rtc_time *t); | 42 | extern int sun3_hwclk(int set, struct rtc_time *t); |
@@ -141,7 +141,7 @@ void __init config_sun3(void) | |||
141 | mach_sched_init = sun3_sched_init; | 141 | mach_sched_init = sun3_sched_init; |
142 | mach_init_IRQ = sun3_init_IRQ; | 142 | mach_init_IRQ = sun3_init_IRQ; |
143 | mach_reset = sun3_reboot; | 143 | mach_reset = sun3_reboot; |
144 | mach_gettimeoffset = sun3_gettimeoffset; | 144 | arch_gettimeoffset = sun3_gettimeoffset; |
145 | mach_get_model = sun3_get_model; | 145 | mach_get_model = sun3_get_model; |
146 | mach_hwclk = sun3_hwclk; | 146 | mach_hwclk = sun3_hwclk; |
147 | mach_halt = sun3_halt; | 147 | mach_halt = sun3_halt; |
diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c index 94fe8016f1f0..889829e11f1d 100644 --- a/arch/m68k/sun3/intersil.c +++ b/arch/m68k/sun3/intersil.c | |||
@@ -23,9 +23,9 @@ | |||
23 | #define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) | 23 | #define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) |
24 | 24 | ||
25 | /* does this need to be implemented? */ | 25 | /* does this need to be implemented? */ |
26 | unsigned long sun3_gettimeoffset(void) | 26 | u32 sun3_gettimeoffset(void) |
27 | { | 27 | { |
28 | return 1; | 28 | return 1000; |
29 | } | 29 | } |
30 | 30 | ||
31 | 31 | ||
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index dd306c84d36d..0532d64d191e 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c | |||
@@ -48,7 +48,7 @@ void __init config_sun3x(void) | |||
48 | mach_sched_init = sun3x_sched_init; | 48 | mach_sched_init = sun3x_sched_init; |
49 | mach_init_IRQ = sun3_init_IRQ; | 49 | mach_init_IRQ = sun3_init_IRQ; |
50 | 50 | ||
51 | mach_gettimeoffset = sun3x_gettimeoffset; | 51 | arch_gettimeoffset = sun3x_gettimeoffset; |
52 | mach_reset = sun3x_reboot; | 52 | mach_reset = sun3x_reboot; |
53 | 53 | ||
54 | mach_hwclk = sun3x_hwclk; | 54 | mach_hwclk = sun3x_hwclk; |
diff --git a/arch/m68k/sun3x/time.c b/arch/m68k/sun3x/time.c index 1d0a72480409..c8eb08add6b0 100644 --- a/arch/m68k/sun3x/time.c +++ b/arch/m68k/sun3x/time.c | |||
@@ -71,7 +71,7 @@ int sun3x_hwclk(int set, struct rtc_time *t) | |||
71 | return 0; | 71 | return 0; |
72 | } | 72 | } |
73 | /* Not much we can do here */ | 73 | /* Not much we can do here */ |
74 | unsigned long sun3x_gettimeoffset (void) | 74 | u32 sun3x_gettimeoffset(void) |
75 | { | 75 | { |
76 | return 0L; | 76 | return 0L; |
77 | } | 77 | } |
diff --git a/arch/m68k/sun3x/time.h b/arch/m68k/sun3x/time.h index 6909e1297534..a4f9126be7e2 100644 --- a/arch/m68k/sun3x/time.h +++ b/arch/m68k/sun3x/time.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define SUN3X_TIME_H | 2 | #define SUN3X_TIME_H |
3 | 3 | ||
4 | extern int sun3x_hwclk(int set, struct rtc_time *t); | 4 | extern int sun3x_hwclk(int set, struct rtc_time *t); |
5 | unsigned long sun3x_gettimeoffset (void); | 5 | u32 sun3x_gettimeoffset(void); |
6 | void sun3x_sched_init(irq_handler_t vector); | 6 | void sun3x_sched_init(irq_handler_t vector); |
7 | 7 | ||
8 | struct mostek_dt { | 8 | struct mostek_dt { |
diff --git a/arch/mips/bcm47xx/Kconfig b/arch/mips/bcm47xx/Kconfig index d7af29f1fcf0..ba611927749b 100644 --- a/arch/mips/bcm47xx/Kconfig +++ b/arch/mips/bcm47xx/Kconfig | |||
@@ -8,8 +8,10 @@ config BCM47XX_SSB | |||
8 | select SSB_DRIVER_EXTIF | 8 | select SSB_DRIVER_EXTIF |
9 | select SSB_EMBEDDED | 9 | select SSB_EMBEDDED |
10 | select SSB_B43_PCI_BRIDGE if PCI | 10 | select SSB_B43_PCI_BRIDGE if PCI |
11 | select SSB_DRIVER_PCICORE if PCI | ||
11 | select SSB_PCICORE_HOSTMODE if PCI | 12 | select SSB_PCICORE_HOSTMODE if PCI |
12 | select SSB_DRIVER_GPIO | 13 | select SSB_DRIVER_GPIO |
14 | select GPIOLIB | ||
13 | default y | 15 | default y |
14 | help | 16 | help |
15 | Add support for old Broadcom BCM47xx boards with Sonics Silicon Backplane support. | 17 | Add support for old Broadcom BCM47xx boards with Sonics Silicon Backplane support. |
@@ -25,6 +27,7 @@ config BCM47XX_BCMA | |||
25 | select BCMA_HOST_PCI if PCI | 27 | select BCMA_HOST_PCI if PCI |
26 | select BCMA_DRIVER_PCI_HOSTMODE if PCI | 28 | select BCMA_DRIVER_PCI_HOSTMODE if PCI |
27 | select BCMA_DRIVER_GPIO | 29 | select BCMA_DRIVER_GPIO |
30 | select GPIOLIB | ||
28 | default y | 31 | default y |
29 | help | 32 | help |
30 | Add support for new Broadcom BCM47xx boards with Broadcom specific Advanced Microcontroller Bus. | 33 | Add support for new Broadcom BCM47xx boards with Broadcom specific Advanced Microcontroller Bus. |
diff --git a/arch/mips/cavium-octeon/executive/cvmx-l2c.c b/arch/mips/cavium-octeon/executive/cvmx-l2c.c index 9f883bf76953..33b72144db31 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-l2c.c +++ b/arch/mips/cavium-octeon/executive/cvmx-l2c.c | |||
@@ -30,6 +30,7 @@ | |||
30 | * measurement, and debugging facilities. | 30 | * measurement, and debugging facilities. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include <linux/compiler.h> | ||
33 | #include <linux/irqflags.h> | 34 | #include <linux/irqflags.h> |
34 | #include <asm/octeon/cvmx.h> | 35 | #include <asm/octeon/cvmx.h> |
35 | #include <asm/octeon/cvmx-l2c.h> | 36 | #include <asm/octeon/cvmx-l2c.h> |
@@ -285,22 +286,22 @@ uint64_t cvmx_l2c_read_perf(uint32_t counter) | |||
285 | */ | 286 | */ |
286 | static void fault_in(uint64_t addr, int len) | 287 | static void fault_in(uint64_t addr, int len) |
287 | { | 288 | { |
288 | volatile char *ptr; | 289 | char *ptr; |
289 | volatile char dummy; | 290 | |
290 | /* | 291 | /* |
291 | * Adjust addr and length so we get all cache lines even for | 292 | * Adjust addr and length so we get all cache lines even for |
292 | * small ranges spanning two cache lines. | 293 | * small ranges spanning two cache lines. |
293 | */ | 294 | */ |
294 | len += addr & CVMX_CACHE_LINE_MASK; | 295 | len += addr & CVMX_CACHE_LINE_MASK; |
295 | addr &= ~CVMX_CACHE_LINE_MASK; | 296 | addr &= ~CVMX_CACHE_LINE_MASK; |
296 | ptr = (volatile char *)cvmx_phys_to_ptr(addr); | 297 | ptr = cvmx_phys_to_ptr(addr); |
297 | /* | 298 | /* |
298 | * Invalidate L1 cache to make sure all loads result in data | 299 | * Invalidate L1 cache to make sure all loads result in data |
299 | * being in L2. | 300 | * being in L2. |
300 | */ | 301 | */ |
301 | CVMX_DCACHE_INVALIDATE; | 302 | CVMX_DCACHE_INVALIDATE; |
302 | while (len > 0) { | 303 | while (len > 0) { |
303 | dummy += *ptr; | 304 | ACCESS_ONCE(*ptr); |
304 | len -= CVMX_CACHE_LINE_SIZE; | 305 | len -= CVMX_CACHE_LINE_SIZE; |
305 | ptr += CVMX_CACHE_LINE_SIZE; | 306 | ptr += CVMX_CACHE_LINE_SIZE; |
306 | } | 307 | } |
diff --git a/arch/mips/include/asm/dsp.h b/arch/mips/include/asm/dsp.h index e9bfc0813c72..7bfad0520e25 100644 --- a/arch/mips/include/asm/dsp.h +++ b/arch/mips/include/asm/dsp.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <asm/mipsregs.h> | 16 | #include <asm/mipsregs.h> |
17 | 17 | ||
18 | #define DSP_DEFAULT 0x00000000 | 18 | #define DSP_DEFAULT 0x00000000 |
19 | #define DSP_MASK 0x3ff | 19 | #define DSP_MASK 0x3f |
20 | 20 | ||
21 | #define __enable_dsp_hazard() \ | 21 | #define __enable_dsp_hazard() \ |
22 | do { \ | 22 | do { \ |
diff --git a/arch/mips/include/asm/inst.h b/arch/mips/include/asm/inst.h index ab84064283db..33c34adbecfa 100644 --- a/arch/mips/include/asm/inst.h +++ b/arch/mips/include/asm/inst.h | |||
@@ -353,6 +353,7 @@ union mips_instruction { | |||
353 | struct u_format u_format; | 353 | struct u_format u_format; |
354 | struct c_format c_format; | 354 | struct c_format c_format; |
355 | struct r_format r_format; | 355 | struct r_format r_format; |
356 | struct p_format p_format; | ||
356 | struct f_format f_format; | 357 | struct f_format f_format; |
357 | struct ma_format ma_format; | 358 | struct ma_format ma_format; |
358 | struct b_format b_format; | 359 | struct b_format b_format; |
diff --git a/arch/mips/include/asm/mach-pnx833x/war.h b/arch/mips/include/asm/mach-pnx833x/war.h index edaa06d9d492..e410df4e1b3a 100644 --- a/arch/mips/include/asm/mach-pnx833x/war.h +++ b/arch/mips/include/asm/mach-pnx833x/war.h | |||
@@ -21,4 +21,4 @@ | |||
21 | #define R10000_LLSC_WAR 0 | 21 | #define R10000_LLSC_WAR 0 |
22 | #define MIPS34K_MISSED_ITLB_WAR 0 | 22 | #define MIPS34K_MISSED_ITLB_WAR 0 |
23 | 23 | ||
24 | #endif /* __ASM_MIPS_MACH_PNX8550_WAR_H */ | 24 | #endif /* __ASM_MIPS_MACH_PNX833X_WAR_H */ |
diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h index c63191055e69..013d5f781263 100644 --- a/arch/mips/include/asm/pgtable-64.h +++ b/arch/mips/include/asm/pgtable-64.h | |||
@@ -230,6 +230,7 @@ static inline void pud_clear(pud_t *pudp) | |||
230 | #else | 230 | #else |
231 | #define pte_pfn(x) ((unsigned long)((x).pte >> _PFN_SHIFT)) | 231 | #define pte_pfn(x) ((unsigned long)((x).pte >> _PFN_SHIFT)) |
232 | #define pfn_pte(pfn, prot) __pte(((pfn) << _PFN_SHIFT) | pgprot_val(prot)) | 232 | #define pfn_pte(pfn, prot) __pte(((pfn) << _PFN_SHIFT) | pgprot_val(prot)) |
233 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << _PFN_SHIFT) | pgprot_val(prot)) | ||
233 | #endif | 234 | #endif |
234 | 235 | ||
235 | #define __pgd_offset(address) pgd_index(address) | 236 | #define __pgd_offset(address) pgd_index(address) |
diff --git a/arch/mips/include/uapi/asm/Kbuild b/arch/mips/include/uapi/asm/Kbuild index a1a0452ac185..77d4fb33f75a 100644 --- a/arch/mips/include/uapi/asm/Kbuild +++ b/arch/mips/include/uapi/asm/Kbuild | |||
@@ -3,6 +3,7 @@ include include/uapi/asm-generic/Kbuild.asm | |||
3 | 3 | ||
4 | header-y += auxvec.h | 4 | header-y += auxvec.h |
5 | header-y += bitsperlong.h | 5 | header-y += bitsperlong.h |
6 | header-y += break.h | ||
6 | header-y += byteorder.h | 7 | header-y += byteorder.h |
7 | header-y += cachectl.h | 8 | header-y += cachectl.h |
8 | header-y += errno.h | 9 | header-y += errno.h |
diff --git a/arch/mips/include/asm/break.h b/arch/mips/include/uapi/asm/break.h index 9161e684cb4c..9161e684cb4c 100644 --- a/arch/mips/include/asm/break.h +++ b/arch/mips/include/uapi/asm/break.h | |||
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c index 6a2d758dd8e9..83fa1460e294 100644 --- a/arch/mips/kernel/ftrace.c +++ b/arch/mips/kernel/ftrace.c | |||
@@ -25,6 +25,12 @@ | |||
25 | #define MCOUNT_OFFSET_INSNS 4 | 25 | #define MCOUNT_OFFSET_INSNS 4 |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | /* Arch override because MIPS doesn't need to run this from stop_machine() */ | ||
29 | void arch_ftrace_update_code(int command) | ||
30 | { | ||
31 | ftrace_modify_all_code(command); | ||
32 | } | ||
33 | |||
28 | /* | 34 | /* |
29 | * Check if the address is in kernel space | 35 | * Check if the address is in kernel space |
30 | * | 36 | * |
@@ -89,6 +95,24 @@ static int ftrace_modify_code(unsigned long ip, unsigned int new_code) | |||
89 | return 0; | 95 | return 0; |
90 | } | 96 | } |
91 | 97 | ||
98 | #ifndef CONFIG_64BIT | ||
99 | static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1, | ||
100 | unsigned int new_code2) | ||
101 | { | ||
102 | int faulted; | ||
103 | |||
104 | safe_store_code(new_code1, ip, faulted); | ||
105 | if (unlikely(faulted)) | ||
106 | return -EFAULT; | ||
107 | ip += 4; | ||
108 | safe_store_code(new_code2, ip, faulted); | ||
109 | if (unlikely(faulted)) | ||
110 | return -EFAULT; | ||
111 | flush_icache_range(ip, ip + 8); /* original ip + 12 */ | ||
112 | return 0; | ||
113 | } | ||
114 | #endif | ||
115 | |||
92 | /* | 116 | /* |
93 | * The details about the calling site of mcount on MIPS | 117 | * The details about the calling site of mcount on MIPS |
94 | * | 118 | * |
@@ -131,8 +155,18 @@ int ftrace_make_nop(struct module *mod, | |||
131 | * needed. | 155 | * needed. |
132 | */ | 156 | */ |
133 | new = in_kernel_space(ip) ? INSN_NOP : INSN_B_1F; | 157 | new = in_kernel_space(ip) ? INSN_NOP : INSN_B_1F; |
134 | 158 | #ifdef CONFIG_64BIT | |
135 | return ftrace_modify_code(ip, new); | 159 | return ftrace_modify_code(ip, new); |
160 | #else | ||
161 | /* | ||
162 | * On 32 bit MIPS platforms, gcc adds a stack adjust | ||
163 | * instruction in the delay slot after the branch to | ||
164 | * mcount and expects mcount to restore the sp on return. | ||
165 | * This is based on a legacy API and does nothing but | ||
166 | * waste instructions so it's being removed at runtime. | ||
167 | */ | ||
168 | return ftrace_modify_code_2(ip, new, INSN_NOP); | ||
169 | #endif | ||
136 | } | 170 | } |
137 | 171 | ||
138 | int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | 172 | int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) |
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S index 4c968e7efb74..165867673357 100644 --- a/arch/mips/kernel/mcount.S +++ b/arch/mips/kernel/mcount.S | |||
@@ -46,9 +46,8 @@ | |||
46 | PTR_L a5, PT_R9(sp) | 46 | PTR_L a5, PT_R9(sp) |
47 | PTR_L a6, PT_R10(sp) | 47 | PTR_L a6, PT_R10(sp) |
48 | PTR_L a7, PT_R11(sp) | 48 | PTR_L a7, PT_R11(sp) |
49 | PTR_ADDIU sp, PT_SIZE | ||
50 | #else | 49 | #else |
51 | PTR_ADDIU sp, (PT_SIZE + 8) | 50 | PTR_ADDIU sp, PT_SIZE |
52 | #endif | 51 | #endif |
53 | .endm | 52 | .endm |
54 | 53 | ||
@@ -69,7 +68,9 @@ NESTED(ftrace_caller, PT_SIZE, ra) | |||
69 | .globl _mcount | 68 | .globl _mcount |
70 | _mcount: | 69 | _mcount: |
71 | b ftrace_stub | 70 | b ftrace_stub |
72 | nop | 71 | addiu sp,sp,8 |
72 | |||
73 | /* When tracing is activated, it calls ftrace_caller+8 (aka here) */ | ||
73 | lw t1, function_trace_stop | 74 | lw t1, function_trace_stop |
74 | bnez t1, ftrace_stub | 75 | bnez t1, ftrace_stub |
75 | nop | 76 | nop |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index eec690af6581..147cec19621d 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -705,7 +705,7 @@ static int vpe_run(struct vpe * v) | |||
705 | 705 | ||
706 | printk(KERN_WARNING | 706 | printk(KERN_WARNING |
707 | "VPE loader: TC %d is already in use.\n", | 707 | "VPE loader: TC %d is already in use.\n", |
708 | t->index); | 708 | v->tc->index); |
709 | return -ENOEXEC; | 709 | return -ENOEXEC; |
710 | } | 710 | } |
711 | } else { | 711 | } else { |
diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c index f36acd1b3808..a7935bf0fecb 100644 --- a/arch/mips/lantiq/irq.c +++ b/arch/mips/lantiq/irq.c | |||
@@ -408,7 +408,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) | |||
408 | #endif | 408 | #endif |
409 | 409 | ||
410 | /* tell oprofile which irq to use */ | 410 | /* tell oprofile which irq to use */ |
411 | cp0_perfcount_irq = LTQ_PERF_IRQ; | 411 | cp0_perfcount_irq = irq_create_mapping(ltq_domain, LTQ_PERF_IRQ); |
412 | 412 | ||
413 | /* | 413 | /* |
414 | * if the timer irq is not one of the mips irqs we need to | 414 | * if the timer irq is not one of the mips irqs we need to |
diff --git a/arch/mips/lib/delay.c b/arch/mips/lib/delay.c index dc81ca8dc0dd..288f7954988d 100644 --- a/arch/mips/lib/delay.c +++ b/arch/mips/lib/delay.c | |||
@@ -21,7 +21,7 @@ void __delay(unsigned long loops) | |||
21 | " .set noreorder \n" | 21 | " .set noreorder \n" |
22 | " .align 3 \n" | 22 | " .align 3 \n" |
23 | "1: bnez %0, 1b \n" | 23 | "1: bnez %0, 1b \n" |
24 | #if __SIZEOF_LONG__ == 4 | 24 | #if BITS_PER_LONG == 32 |
25 | " subu %0, 1 \n" | 25 | " subu %0, 1 \n" |
26 | #else | 26 | #else |
27 | " dsubu %0, 1 \n" | 27 | " dsubu %0, 1 \n" |
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c index 7657fd21cd3f..cacfd31e8ec9 100644 --- a/arch/mips/mm/ioremap.c +++ b/arch/mips/mm/ioremap.c | |||
@@ -190,9 +190,3 @@ void __iounmap(const volatile void __iomem *addr) | |||
190 | 190 | ||
191 | EXPORT_SYMBOL(__ioremap); | 191 | EXPORT_SYMBOL(__ioremap); |
192 | EXPORT_SYMBOL(__iounmap); | 192 | EXPORT_SYMBOL(__iounmap); |
193 | |||
194 | int __virt_addr_valid(const volatile void *kaddr) | ||
195 | { | ||
196 | return pfn_valid(PFN_DOWN(virt_to_phys(kaddr))); | ||
197 | } | ||
198 | EXPORT_SYMBOL_GPL(__virt_addr_valid); | ||
diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c index d9be7540a6be..7e5fe2790d8a 100644 --- a/arch/mips/mm/mmap.c +++ b/arch/mips/mm/mmap.c | |||
@@ -192,3 +192,9 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) | |||
192 | 192 | ||
193 | return ret; | 193 | return ret; |
194 | } | 194 | } |
195 | |||
196 | int __virt_addr_valid(const volatile void *kaddr) | ||
197 | { | ||
198 | return pfn_valid(PFN_DOWN(virt_to_phys(kaddr))); | ||
199 | } | ||
200 | EXPORT_SYMBOL_GPL(__virt_addr_valid); | ||
diff --git a/arch/mips/netlogic/xlr/setup.c b/arch/mips/netlogic/xlr/setup.c index 4e7f49d3d5a8..c5ce6992ac4c 100644 --- a/arch/mips/netlogic/xlr/setup.c +++ b/arch/mips/netlogic/xlr/setup.c | |||
@@ -193,8 +193,11 @@ static void nlm_init_node(void) | |||
193 | 193 | ||
194 | void __init prom_init(void) | 194 | void __init prom_init(void) |
195 | { | 195 | { |
196 | int i, *argv, *envp; /* passed as 32 bit ptrs */ | 196 | int *argv, *envp; /* passed as 32 bit ptrs */ |
197 | struct psb_info *prom_infop; | 197 | struct psb_info *prom_infop; |
198 | #ifdef CONFIG_SMP | ||
199 | int i; | ||
200 | #endif | ||
198 | 201 | ||
199 | /* truncate to 32 bit and sign extend all args */ | 202 | /* truncate to 32 bit and sign extend all args */ |
200 | argv = (int *)(long)(int)fw_arg1; | 203 | argv = (int *)(long)(int)fw_arg1; |
diff --git a/arch/mips/pci/pci-ar71xx.c b/arch/mips/pci/pci-ar71xx.c index 1552522b8718..6eaa4f2d0e38 100644 --- a/arch/mips/pci/pci-ar71xx.c +++ b/arch/mips/pci/pci-ar71xx.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <asm/mach-ath79/pci.h> | 24 | #include <asm/mach-ath79/pci.h> |
25 | 25 | ||
26 | #define AR71XX_PCI_MEM_BASE 0x10000000 | 26 | #define AR71XX_PCI_MEM_BASE 0x10000000 |
27 | #define AR71XX_PCI_MEM_SIZE 0x08000000 | 27 | #define AR71XX_PCI_MEM_SIZE 0x07000000 |
28 | 28 | ||
29 | #define AR71XX_PCI_WIN0_OFFS 0x10000000 | 29 | #define AR71XX_PCI_WIN0_OFFS 0x10000000 |
30 | #define AR71XX_PCI_WIN1_OFFS 0x11000000 | 30 | #define AR71XX_PCI_WIN1_OFFS 0x11000000 |
diff --git a/arch/mips/pci/pci-ar724x.c b/arch/mips/pci/pci-ar724x.c index 86d77a666458..c11c75be2d7e 100644 --- a/arch/mips/pci/pci-ar724x.c +++ b/arch/mips/pci/pci-ar724x.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #define AR724X_PCI_CTRL_SIZE 0x100 | 21 | #define AR724X_PCI_CTRL_SIZE 0x100 |
22 | 22 | ||
23 | #define AR724X_PCI_MEM_BASE 0x10000000 | 23 | #define AR724X_PCI_MEM_BASE 0x10000000 |
24 | #define AR724X_PCI_MEM_SIZE 0x08000000 | 24 | #define AR724X_PCI_MEM_SIZE 0x04000000 |
25 | 25 | ||
26 | #define AR724X_PCI_REG_RESET 0x18 | 26 | #define AR724X_PCI_REG_RESET 0x18 |
27 | #define AR724X_PCI_REG_INT_STATUS 0x4c | 27 | #define AR724X_PCI_REG_INT_STATUS 0x4c |
diff --git a/arch/mn10300/include/asm/dma-mapping.h b/arch/mn10300/include/asm/dma-mapping.h index c1be4397b1ed..a18abfc558eb 100644 --- a/arch/mn10300/include/asm/dma-mapping.h +++ b/arch/mn10300/include/asm/dma-mapping.h | |||
@@ -168,4 +168,19 @@ void dma_cache_sync(void *vaddr, size_t size, | |||
168 | mn10300_dcache_flush_inv(); | 168 | mn10300_dcache_flush_inv(); |
169 | } | 169 | } |
170 | 170 | ||
171 | /* Not supported for now */ | ||
172 | static inline int dma_mmap_coherent(struct device *dev, | ||
173 | struct vm_area_struct *vma, void *cpu_addr, | ||
174 | dma_addr_t dma_addr, size_t size) | ||
175 | { | ||
176 | return -EINVAL; | ||
177 | } | ||
178 | |||
179 | static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
180 | void *cpu_addr, dma_addr_t dma_addr, | ||
181 | size_t size) | ||
182 | { | ||
183 | return -EINVAL; | ||
184 | } | ||
185 | |||
171 | #endif | 186 | #endif |
diff --git a/arch/parisc/include/asm/dma-mapping.h b/arch/parisc/include/asm/dma-mapping.h index 467bbd510eac..106b395688e1 100644 --- a/arch/parisc/include/asm/dma-mapping.h +++ b/arch/parisc/include/asm/dma-mapping.h | |||
@@ -238,4 +238,19 @@ void * sba_get_iommu(struct parisc_device *dev); | |||
238 | /* At the moment, we panic on error for IOMMU resource exaustion */ | 238 | /* At the moment, we panic on error for IOMMU resource exaustion */ |
239 | #define dma_mapping_error(dev, x) 0 | 239 | #define dma_mapping_error(dev, x) 0 |
240 | 240 | ||
241 | /* This API cannot be supported on PA-RISC */ | ||
242 | static inline int dma_mmap_coherent(struct device *dev, | ||
243 | struct vm_area_struct *vma, void *cpu_addr, | ||
244 | dma_addr_t dma_addr, size_t size) | ||
245 | { | ||
246 | return -EINVAL; | ||
247 | } | ||
248 | |||
249 | static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
250 | void *cpu_addr, dma_addr_t dma_addr, | ||
251 | size_t size) | ||
252 | { | ||
253 | return -EINVAL; | ||
254 | } | ||
255 | |||
241 | #endif | 256 | #endif |
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S index 56585086413a..7443481a315c 100644 --- a/arch/powerpc/mm/hash_low_64.S +++ b/arch/powerpc/mm/hash_low_64.S | |||
@@ -115,11 +115,13 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT) | |||
115 | sldi r29,r5,SID_SHIFT - VPN_SHIFT | 115 | sldi r29,r5,SID_SHIFT - VPN_SHIFT |
116 | rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT - VPN_SHIFT) | 116 | rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT - VPN_SHIFT) |
117 | or r29,r28,r29 | 117 | or r29,r28,r29 |
118 | 118 | /* | |
119 | /* Calculate hash value for primary slot and store it in r28 */ | 119 | * Calculate hash value for primary slot and store it in r28 |
120 | rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */ | 120 | * r3 = va, r5 = vsid |
121 | rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */ | 121 | * r0 = (va >> 12) & ((1ul << (28 - 12)) -1) |
122 | xor r28,r5,r0 | 122 | */ |
123 | rldicl r0,r3,64-12,48 | ||
124 | xor r28,r5,r0 /* hash */ | ||
123 | b 4f | 125 | b 4f |
124 | 126 | ||
125 | 3: /* Calc vpn and put it in r29 */ | 127 | 3: /* Calc vpn and put it in r29 */ |
@@ -130,11 +132,12 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT) | |||
130 | /* | 132 | /* |
131 | * calculate hash value for primary slot and | 133 | * calculate hash value for primary slot and |
132 | * store it in r28 for 1T segment | 134 | * store it in r28 for 1T segment |
135 | * r3 = va, r5 = vsid | ||
133 | */ | 136 | */ |
134 | rldic r28,r5,25,25 /* (vsid << 25) & 0x7fffffffff */ | 137 | sldi r28,r5,25 /* vsid << 25 */ |
135 | clrldi r5,r5,40 /* vsid & 0xffffff */ | 138 | /* r0 = (va >> 12) & ((1ul << (40 - 12)) -1) */ |
136 | rldicl r0,r3,64-12,36 /* (ea >> 12) & 0xfffffff */ | 139 | rldicl r0,r3,64-12,36 |
137 | xor r28,r28,r5 | 140 | xor r28,r28,r5 /* vsid ^ ( vsid << 25) */ |
138 | xor r28,r28,r0 /* hash */ | 141 | xor r28,r28,r0 /* hash */ |
139 | 142 | ||
140 | /* Convert linux PTE bits into HW equivalents */ | 143 | /* Convert linux PTE bits into HW equivalents */ |
@@ -407,11 +410,13 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT) | |||
407 | */ | 410 | */ |
408 | rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT - VPN_SHIFT) | 411 | rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT - VPN_SHIFT) |
409 | or r29,r28,r29 | 412 | or r29,r28,r29 |
410 | 413 | /* | |
411 | /* Calculate hash value for primary slot and store it in r28 */ | 414 | * Calculate hash value for primary slot and store it in r28 |
412 | rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */ | 415 | * r3 = va, r5 = vsid |
413 | rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */ | 416 | * r0 = (va >> 12) & ((1ul << (28 - 12)) -1) |
414 | xor r28,r5,r0 | 417 | */ |
418 | rldicl r0,r3,64-12,48 | ||
419 | xor r28,r5,r0 /* hash */ | ||
415 | b 4f | 420 | b 4f |
416 | 421 | ||
417 | 3: /* Calc vpn and put it in r29 */ | 422 | 3: /* Calc vpn and put it in r29 */ |
@@ -426,11 +431,12 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT) | |||
426 | /* | 431 | /* |
427 | * Calculate hash value for primary slot and | 432 | * Calculate hash value for primary slot and |
428 | * store it in r28 for 1T segment | 433 | * store it in r28 for 1T segment |
434 | * r3 = va, r5 = vsid | ||
429 | */ | 435 | */ |
430 | rldic r28,r5,25,25 /* (vsid << 25) & 0x7fffffffff */ | 436 | sldi r28,r5,25 /* vsid << 25 */ |
431 | clrldi r5,r5,40 /* vsid & 0xffffff */ | 437 | /* r0 = (va >> 12) & ((1ul << (40 - 12)) -1) */ |
432 | rldicl r0,r3,64-12,36 /* (ea >> 12) & 0xfffffff */ | 438 | rldicl r0,r3,64-12,36 |
433 | xor r28,r28,r5 | 439 | xor r28,r28,r5 /* vsid ^ ( vsid << 25) */ |
434 | xor r28,r28,r0 /* hash */ | 440 | xor r28,r28,r0 /* hash */ |
435 | 441 | ||
436 | /* Convert linux PTE bits into HW equivalents */ | 442 | /* Convert linux PTE bits into HW equivalents */ |
@@ -752,25 +758,27 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT) | |||
752 | rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT - VPN_SHIFT) | 758 | rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT - VPN_SHIFT) |
753 | or r29,r28,r29 | 759 | or r29,r28,r29 |
754 | 760 | ||
755 | /* Calculate hash value for primary slot and store it in r28 */ | 761 | /* Calculate hash value for primary slot and store it in r28 |
756 | rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */ | 762 | * r3 = va, r5 = vsid |
757 | rldicl r0,r3,64-16,52 /* (ea >> 16) & 0xfff */ | 763 | * r0 = (va >> 16) & ((1ul << (28 - 16)) -1) |
758 | xor r28,r5,r0 | 764 | */ |
765 | rldicl r0,r3,64-16,52 | ||
766 | xor r28,r5,r0 /* hash */ | ||
759 | b 4f | 767 | b 4f |
760 | 768 | ||
761 | 3: /* Calc vpn and put it in r29 */ | 769 | 3: /* Calc vpn and put it in r29 */ |
762 | sldi r29,r5,SID_SHIFT_1T - VPN_SHIFT | 770 | sldi r29,r5,SID_SHIFT_1T - VPN_SHIFT |
763 | rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT_1T - VPN_SHIFT) | 771 | rldicl r28,r3,64 - VPN_SHIFT,64 - (SID_SHIFT_1T - VPN_SHIFT) |
764 | or r29,r28,r29 | 772 | or r29,r28,r29 |
765 | |||
766 | /* | 773 | /* |
767 | * calculate hash value for primary slot and | 774 | * calculate hash value for primary slot and |
768 | * store it in r28 for 1T segment | 775 | * store it in r28 for 1T segment |
776 | * r3 = va, r5 = vsid | ||
769 | */ | 777 | */ |
770 | rldic r28,r5,25,25 /* (vsid << 25) & 0x7fffffffff */ | 778 | sldi r28,r5,25 /* vsid << 25 */ |
771 | clrldi r5,r5,40 /* vsid & 0xffffff */ | 779 | /* r0 = (va >> 16) & ((1ul << (40 - 16)) -1) */ |
772 | rldicl r0,r3,64-16,40 /* (ea >> 16) & 0xffffff */ | 780 | rldicl r0,r3,64-16,40 |
773 | xor r28,r28,r5 | 781 | xor r28,r28,r5 /* vsid ^ ( vsid << 25) */ |
774 | xor r28,r28,r0 /* hash */ | 782 | xor r28,r28,r0 /* hash */ |
775 | 783 | ||
776 | /* Convert linux PTE bits into HW equivalents */ | 784 | /* Convert linux PTE bits into HW equivalents */ |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 102ff7cb3e41..142c4ceff112 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -207,7 +207,7 @@ sysexit_from_sys_call: | |||
207 | testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) | 207 | testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) |
208 | jnz ia32_ret_from_sys_call | 208 | jnz ia32_ret_from_sys_call |
209 | TRACE_IRQS_ON | 209 | TRACE_IRQS_ON |
210 | sti | 210 | ENABLE_INTERRUPTS(CLBR_NONE) |
211 | movl %eax,%esi /* second arg, syscall return value */ | 211 | movl %eax,%esi /* second arg, syscall return value */ |
212 | cmpl $-MAX_ERRNO,%eax /* is it an error ? */ | 212 | cmpl $-MAX_ERRNO,%eax /* is it an error ? */ |
213 | jbe 1f | 213 | jbe 1f |
@@ -217,7 +217,7 @@ sysexit_from_sys_call: | |||
217 | call __audit_syscall_exit | 217 | call __audit_syscall_exit |
218 | movq RAX-ARGOFFSET(%rsp),%rax /* reload syscall return value */ | 218 | movq RAX-ARGOFFSET(%rsp),%rax /* reload syscall return value */ |
219 | movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi | 219 | movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi |
220 | cli | 220 | DISABLE_INTERRUPTS(CLBR_NONE) |
221 | TRACE_IRQS_OFF | 221 | TRACE_IRQS_OFF |
222 | testl %edi,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) | 222 | testl %edi,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) |
223 | jz \exit | 223 | jz \exit |
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index fe9edec6698a..84c1309c4c0c 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -298,8 +298,7 @@ struct _cache_attr { | |||
298 | unsigned int); | 298 | unsigned int); |
299 | }; | 299 | }; |
300 | 300 | ||
301 | #ifdef CONFIG_AMD_NB | 301 | #if defined(CONFIG_AMD_NB) && defined(CONFIG_SYSFS) |
302 | |||
303 | /* | 302 | /* |
304 | * L3 cache descriptors | 303 | * L3 cache descriptors |
305 | */ | 304 | */ |
@@ -524,9 +523,9 @@ store_subcaches(struct _cpuid4_info *this_leaf, const char *buf, size_t count, | |||
524 | static struct _cache_attr subcaches = | 523 | static struct _cache_attr subcaches = |
525 | __ATTR(subcaches, 0644, show_subcaches, store_subcaches); | 524 | __ATTR(subcaches, 0644, show_subcaches, store_subcaches); |
526 | 525 | ||
527 | #else /* CONFIG_AMD_NB */ | 526 | #else |
528 | #define amd_init_l3_cache(x, y) | 527 | #define amd_init_l3_cache(x, y) |
529 | #endif /* CONFIG_AMD_NB */ | 528 | #endif /* CONFIG_AMD_NB && CONFIG_SYSFS */ |
530 | 529 | ||
531 | static int | 530 | static int |
532 | __cpuinit cpuid4_cache_lookup_regs(int index, | 531 | __cpuinit cpuid4_cache_lookup_regs(int index, |
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 93b9e1181f83..4914e94ad6e8 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -2019,7 +2019,10 @@ __init int intel_pmu_init(void) | |||
2019 | break; | 2019 | break; |
2020 | 2020 | ||
2021 | case 28: /* Atom */ | 2021 | case 28: /* Atom */ |
2022 | case 54: /* Cedariew */ | 2022 | case 38: /* Lincroft */ |
2023 | case 39: /* Penwell */ | ||
2024 | case 53: /* Cloverview */ | ||
2025 | case 54: /* Cedarview */ | ||
2023 | memcpy(hw_cache_event_ids, atom_hw_cache_event_ids, | 2026 | memcpy(hw_cache_event_ids, atom_hw_cache_event_ids, |
2024 | sizeof(hw_cache_event_ids)); | 2027 | sizeof(hw_cache_event_ids)); |
2025 | 2028 | ||
@@ -2084,6 +2087,7 @@ __init int intel_pmu_init(void) | |||
2084 | pr_cont("SandyBridge events, "); | 2087 | pr_cont("SandyBridge events, "); |
2085 | break; | 2088 | break; |
2086 | case 58: /* IvyBridge */ | 2089 | case 58: /* IvyBridge */ |
2090 | case 62: /* IvyBridge EP */ | ||
2087 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, | 2091 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, |
2088 | sizeof(hw_cache_event_ids)); | 2092 | sizeof(hw_cache_event_ids)); |
2089 | memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, | 2093 | memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, |
diff --git a/arch/x86/kernel/cpu/perf_event_p6.c b/arch/x86/kernel/cpu/perf_event_p6.c index f2af39f5dc3d..4820c232a0b9 100644 --- a/arch/x86/kernel/cpu/perf_event_p6.c +++ b/arch/x86/kernel/cpu/perf_event_p6.c | |||
@@ -19,7 +19,7 @@ static const u64 p6_perfmon_event_map[] = | |||
19 | 19 | ||
20 | }; | 20 | }; |
21 | 21 | ||
22 | static __initconst u64 p6_hw_cache_event_ids | 22 | static u64 p6_hw_cache_event_ids |
23 | [PERF_COUNT_HW_CACHE_MAX] | 23 | [PERF_COUNT_HW_CACHE_MAX] |
24 | [PERF_COUNT_HW_CACHE_OP_MAX] | 24 | [PERF_COUNT_HW_CACHE_OP_MAX] |
25 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = | 25 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = |
diff --git a/arch/x86/tools/insn_sanity.c b/arch/x86/tools/insn_sanity.c index cc2f8c131286..872eb60e7806 100644 --- a/arch/x86/tools/insn_sanity.c +++ b/arch/x86/tools/insn_sanity.c | |||
@@ -55,7 +55,7 @@ static FILE *input_file; /* Input file name */ | |||
55 | static void usage(const char *err) | 55 | static void usage(const char *err) |
56 | { | 56 | { |
57 | if (err) | 57 | if (err) |
58 | fprintf(stderr, "Error: %s\n\n", err); | 58 | fprintf(stderr, "%s: Error: %s\n\n", prog, err); |
59 | fprintf(stderr, "Usage: %s [-y|-n|-v] [-s seed[,no]] [-m max] [-i input]\n", prog); | 59 | fprintf(stderr, "Usage: %s [-y|-n|-v] [-s seed[,no]] [-m max] [-i input]\n", prog); |
60 | fprintf(stderr, "\t-y 64bit mode\n"); | 60 | fprintf(stderr, "\t-y 64bit mode\n"); |
61 | fprintf(stderr, "\t-n 32bit mode\n"); | 61 | fprintf(stderr, "\t-n 32bit mode\n"); |
@@ -269,7 +269,13 @@ int main(int argc, char **argv) | |||
269 | insns++; | 269 | insns++; |
270 | } | 270 | } |
271 | 271 | ||
272 | fprintf(stdout, "%s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n", (errors) ? "Failure" : "Success", insns, (input_file) ? "given" : "random", errors, seed); | 272 | fprintf(stdout, "%s: %s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n", |
273 | prog, | ||
274 | (errors) ? "Failure" : "Success", | ||
275 | insns, | ||
276 | (input_file) ? "given" : "random", | ||
277 | errors, | ||
278 | seed); | ||
273 | 279 | ||
274 | return errors ? 1 : 0; | 280 | return errors ? 1 : 0; |
275 | } | 281 | } |
diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h index 4acb5feba1fb..172a02a6ad14 100644 --- a/arch/xtensa/include/asm/dma-mapping.h +++ b/arch/xtensa/include/asm/dma-mapping.h | |||
@@ -170,4 +170,19 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size, | |||
170 | consistent_sync(vaddr, size, direction); | 170 | consistent_sync(vaddr, size, direction); |
171 | } | 171 | } |
172 | 172 | ||
173 | /* Not supported for now */ | ||
174 | static inline int dma_mmap_coherent(struct device *dev, | ||
175 | struct vm_area_struct *vma, void *cpu_addr, | ||
176 | dma_addr_t dma_addr, size_t size) | ||
177 | { | ||
178 | return -EINVAL; | ||
179 | } | ||
180 | |||
181 | static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
182 | void *cpu_addr, dma_addr_t dma_addr, | ||
183 | size_t size) | ||
184 | { | ||
185 | return -EINVAL; | ||
186 | } | ||
187 | |||
173 | #endif /* _XTENSA_DMA_MAPPING_H */ | 188 | #endif /* _XTENSA_DMA_MAPPING_H */ |
diff --git a/block/genhd.c b/block/genhd.c index 9a289d7c84bb..3993ebf4135f 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -35,6 +35,8 @@ static DEFINE_IDR(ext_devt_idr); | |||
35 | 35 | ||
36 | static struct device_type disk_type; | 36 | static struct device_type disk_type; |
37 | 37 | ||
38 | static void disk_check_events(struct disk_events *ev, | ||
39 | unsigned int *clearing_ptr); | ||
38 | static void disk_alloc_events(struct gendisk *disk); | 40 | static void disk_alloc_events(struct gendisk *disk); |
39 | static void disk_add_events(struct gendisk *disk); | 41 | static void disk_add_events(struct gendisk *disk); |
40 | static void disk_del_events(struct gendisk *disk); | 42 | static void disk_del_events(struct gendisk *disk); |
@@ -1549,6 +1551,7 @@ unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask) | |||
1549 | const struct block_device_operations *bdops = disk->fops; | 1551 | const struct block_device_operations *bdops = disk->fops; |
1550 | struct disk_events *ev = disk->ev; | 1552 | struct disk_events *ev = disk->ev; |
1551 | unsigned int pending; | 1553 | unsigned int pending; |
1554 | unsigned int clearing = mask; | ||
1552 | 1555 | ||
1553 | if (!ev) { | 1556 | if (!ev) { |
1554 | /* for drivers still using the old ->media_changed method */ | 1557 | /* for drivers still using the old ->media_changed method */ |
@@ -1558,34 +1561,53 @@ unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask) | |||
1558 | return 0; | 1561 | return 0; |
1559 | } | 1562 | } |
1560 | 1563 | ||
1561 | /* tell the workfn about the events being cleared */ | 1564 | disk_block_events(disk); |
1565 | |||
1566 | /* | ||
1567 | * store the union of mask and ev->clearing on the stack so that the | ||
1568 | * race with disk_flush_events does not cause ambiguity (ev->clearing | ||
1569 | * can still be modified even if events are blocked). | ||
1570 | */ | ||
1562 | spin_lock_irq(&ev->lock); | 1571 | spin_lock_irq(&ev->lock); |
1563 | ev->clearing |= mask; | 1572 | clearing |= ev->clearing; |
1573 | ev->clearing = 0; | ||
1564 | spin_unlock_irq(&ev->lock); | 1574 | spin_unlock_irq(&ev->lock); |
1565 | 1575 | ||
1566 | /* uncondtionally schedule event check and wait for it to finish */ | 1576 | disk_check_events(ev, &clearing); |
1567 | disk_block_events(disk); | 1577 | /* |
1568 | queue_delayed_work(system_freezable_wq, &ev->dwork, 0); | 1578 | * if ev->clearing is not 0, the disk_flush_events got called in the |
1569 | flush_delayed_work(&ev->dwork); | 1579 | * middle of this function, so we want to run the workfn without delay. |
1570 | __disk_unblock_events(disk, false); | 1580 | */ |
1581 | __disk_unblock_events(disk, ev->clearing ? true : false); | ||
1571 | 1582 | ||
1572 | /* then, fetch and clear pending events */ | 1583 | /* then, fetch and clear pending events */ |
1573 | spin_lock_irq(&ev->lock); | 1584 | spin_lock_irq(&ev->lock); |
1574 | WARN_ON_ONCE(ev->clearing & mask); /* cleared by workfn */ | ||
1575 | pending = ev->pending & mask; | 1585 | pending = ev->pending & mask; |
1576 | ev->pending &= ~mask; | 1586 | ev->pending &= ~mask; |
1577 | spin_unlock_irq(&ev->lock); | 1587 | spin_unlock_irq(&ev->lock); |
1588 | WARN_ON_ONCE(clearing & mask); | ||
1578 | 1589 | ||
1579 | return pending; | 1590 | return pending; |
1580 | } | 1591 | } |
1581 | 1592 | ||
1593 | /* | ||
1594 | * Separate this part out so that a different pointer for clearing_ptr can be | ||
1595 | * passed in for disk_clear_events. | ||
1596 | */ | ||
1582 | static void disk_events_workfn(struct work_struct *work) | 1597 | static void disk_events_workfn(struct work_struct *work) |
1583 | { | 1598 | { |
1584 | struct delayed_work *dwork = to_delayed_work(work); | 1599 | struct delayed_work *dwork = to_delayed_work(work); |
1585 | struct disk_events *ev = container_of(dwork, struct disk_events, dwork); | 1600 | struct disk_events *ev = container_of(dwork, struct disk_events, dwork); |
1601 | |||
1602 | disk_check_events(ev, &ev->clearing); | ||
1603 | } | ||
1604 | |||
1605 | static void disk_check_events(struct disk_events *ev, | ||
1606 | unsigned int *clearing_ptr) | ||
1607 | { | ||
1586 | struct gendisk *disk = ev->disk; | 1608 | struct gendisk *disk = ev->disk; |
1587 | char *envp[ARRAY_SIZE(disk_uevents) + 1] = { }; | 1609 | char *envp[ARRAY_SIZE(disk_uevents) + 1] = { }; |
1588 | unsigned int clearing = ev->clearing; | 1610 | unsigned int clearing = *clearing_ptr; |
1589 | unsigned int events; | 1611 | unsigned int events; |
1590 | unsigned long intv; | 1612 | unsigned long intv; |
1591 | int nr_events = 0, i; | 1613 | int nr_events = 0, i; |
@@ -1598,7 +1620,7 @@ static void disk_events_workfn(struct work_struct *work) | |||
1598 | 1620 | ||
1599 | events &= ~ev->pending; | 1621 | events &= ~ev->pending; |
1600 | ev->pending |= events; | 1622 | ev->pending |= events; |
1601 | ev->clearing &= ~clearing; | 1623 | *clearing_ptr &= ~clearing; |
1602 | 1624 | ||
1603 | intv = disk_events_poll_jiffies(disk); | 1625 | intv = disk_events_poll_jiffies(disk); |
1604 | if (!ev->block && intv) | 1626 | if (!ev->block && intv) |
diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h index 6a0955e6d4fc..53ecac5a2161 100644 --- a/drivers/atm/iphase.h +++ b/drivers/atm/iphase.h | |||
@@ -636,82 +636,82 @@ struct rx_buf_desc { | |||
636 | #define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE | 636 | #define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE |
637 | #define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE | 637 | #define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE |
638 | 638 | ||
639 | typedef volatile u_int freg_t; | 639 | typedef volatile u_int ffreg_t; |
640 | typedef u_int rreg_t; | 640 | typedef u_int rreg_t; |
641 | 641 | ||
642 | typedef struct _ffredn_t { | 642 | typedef struct _ffredn_t { |
643 | freg_t idlehead_high; /* Idle cell header (high) */ | 643 | ffreg_t idlehead_high; /* Idle cell header (high) */ |
644 | freg_t idlehead_low; /* Idle cell header (low) */ | 644 | ffreg_t idlehead_low; /* Idle cell header (low) */ |
645 | freg_t maxrate; /* Maximum rate */ | 645 | ffreg_t maxrate; /* Maximum rate */ |
646 | freg_t stparms; /* Traffic Management Parameters */ | 646 | ffreg_t stparms; /* Traffic Management Parameters */ |
647 | freg_t abrubr_abr; /* ABRUBR Priority Byte 1, TCR Byte 0 */ | 647 | ffreg_t abrubr_abr; /* ABRUBR Priority Byte 1, TCR Byte 0 */ |
648 | freg_t rm_type; /* */ | 648 | ffreg_t rm_type; /* */ |
649 | u_int filler5[0x17 - 0x06]; | 649 | u_int filler5[0x17 - 0x06]; |
650 | freg_t cmd_reg; /* Command register */ | 650 | ffreg_t cmd_reg; /* Command register */ |
651 | u_int filler18[0x20 - 0x18]; | 651 | u_int filler18[0x20 - 0x18]; |
652 | freg_t cbr_base; /* CBR Pointer Base */ | 652 | ffreg_t cbr_base; /* CBR Pointer Base */ |
653 | freg_t vbr_base; /* VBR Pointer Base */ | 653 | ffreg_t vbr_base; /* VBR Pointer Base */ |
654 | freg_t abr_base; /* ABR Pointer Base */ | 654 | ffreg_t abr_base; /* ABR Pointer Base */ |
655 | freg_t ubr_base; /* UBR Pointer Base */ | 655 | ffreg_t ubr_base; /* UBR Pointer Base */ |
656 | u_int filler24; | 656 | u_int filler24; |
657 | freg_t vbrwq_base; /* VBR Wait Queue Base */ | 657 | ffreg_t vbrwq_base; /* VBR Wait Queue Base */ |
658 | freg_t abrwq_base; /* ABR Wait Queue Base */ | 658 | ffreg_t abrwq_base; /* ABR Wait Queue Base */ |
659 | freg_t ubrwq_base; /* UBR Wait Queue Base */ | 659 | ffreg_t ubrwq_base; /* UBR Wait Queue Base */ |
660 | freg_t vct_base; /* Main VC Table Base */ | 660 | ffreg_t vct_base; /* Main VC Table Base */ |
661 | freg_t vcte_base; /* Extended Main VC Table Base */ | 661 | ffreg_t vcte_base; /* Extended Main VC Table Base */ |
662 | u_int filler2a[0x2C - 0x2A]; | 662 | u_int filler2a[0x2C - 0x2A]; |
663 | freg_t cbr_tab_beg; /* CBR Table Begin */ | 663 | ffreg_t cbr_tab_beg; /* CBR Table Begin */ |
664 | freg_t cbr_tab_end; /* CBR Table End */ | 664 | ffreg_t cbr_tab_end; /* CBR Table End */ |
665 | freg_t cbr_pointer; /* CBR Pointer */ | 665 | ffreg_t cbr_pointer; /* CBR Pointer */ |
666 | u_int filler2f[0x30 - 0x2F]; | 666 | u_int filler2f[0x30 - 0x2F]; |
667 | freg_t prq_st_adr; /* Packet Ready Queue Start Address */ | 667 | ffreg_t prq_st_adr; /* Packet Ready Queue Start Address */ |
668 | freg_t prq_ed_adr; /* Packet Ready Queue End Address */ | 668 | ffreg_t prq_ed_adr; /* Packet Ready Queue End Address */ |
669 | freg_t prq_rd_ptr; /* Packet Ready Queue read pointer */ | 669 | ffreg_t prq_rd_ptr; /* Packet Ready Queue read pointer */ |
670 | freg_t prq_wr_ptr; /* Packet Ready Queue write pointer */ | 670 | ffreg_t prq_wr_ptr; /* Packet Ready Queue write pointer */ |
671 | freg_t tcq_st_adr; /* Transmit Complete Queue Start Address*/ | 671 | ffreg_t tcq_st_adr; /* Transmit Complete Queue Start Address*/ |
672 | freg_t tcq_ed_adr; /* Transmit Complete Queue End Address */ | 672 | ffreg_t tcq_ed_adr; /* Transmit Complete Queue End Address */ |
673 | freg_t tcq_rd_ptr; /* Transmit Complete Queue read pointer */ | 673 | ffreg_t tcq_rd_ptr; /* Transmit Complete Queue read pointer */ |
674 | freg_t tcq_wr_ptr; /* Transmit Complete Queue write pointer*/ | 674 | ffreg_t tcq_wr_ptr; /* Transmit Complete Queue write pointer*/ |
675 | u_int filler38[0x40 - 0x38]; | 675 | u_int filler38[0x40 - 0x38]; |
676 | freg_t queue_base; /* Base address for PRQ and TCQ */ | 676 | ffreg_t queue_base; /* Base address for PRQ and TCQ */ |
677 | freg_t desc_base; /* Base address of descriptor table */ | 677 | ffreg_t desc_base; /* Base address of descriptor table */ |
678 | u_int filler42[0x45 - 0x42]; | 678 | u_int filler42[0x45 - 0x42]; |
679 | freg_t mode_reg_0; /* Mode register 0 */ | 679 | ffreg_t mode_reg_0; /* Mode register 0 */ |
680 | freg_t mode_reg_1; /* Mode register 1 */ | 680 | ffreg_t mode_reg_1; /* Mode register 1 */ |
681 | freg_t intr_status_reg;/* Interrupt Status register */ | 681 | ffreg_t intr_status_reg;/* Interrupt Status register */ |
682 | freg_t mask_reg; /* Mask Register */ | 682 | ffreg_t mask_reg; /* Mask Register */ |
683 | freg_t cell_ctr_high1; /* Total cell transfer count (high) */ | 683 | ffreg_t cell_ctr_high1; /* Total cell transfer count (high) */ |
684 | freg_t cell_ctr_lo1; /* Total cell transfer count (low) */ | 684 | ffreg_t cell_ctr_lo1; /* Total cell transfer count (low) */ |
685 | freg_t state_reg; /* Status register */ | 685 | ffreg_t state_reg; /* Status register */ |
686 | u_int filler4c[0x58 - 0x4c]; | 686 | u_int filler4c[0x58 - 0x4c]; |
687 | freg_t curr_desc_num; /* Contains the current descriptor num */ | 687 | ffreg_t curr_desc_num; /* Contains the current descriptor num */ |
688 | freg_t next_desc; /* Next descriptor */ | 688 | ffreg_t next_desc; /* Next descriptor */ |
689 | freg_t next_vc; /* Next VC */ | 689 | ffreg_t next_vc; /* Next VC */ |
690 | u_int filler5b[0x5d - 0x5b]; | 690 | u_int filler5b[0x5d - 0x5b]; |
691 | freg_t present_slot_cnt;/* Present slot count */ | 691 | ffreg_t present_slot_cnt;/* Present slot count */ |
692 | u_int filler5e[0x6a - 0x5e]; | 692 | u_int filler5e[0x6a - 0x5e]; |
693 | freg_t new_desc_num; /* New descriptor number */ | 693 | ffreg_t new_desc_num; /* New descriptor number */ |
694 | freg_t new_vc; /* New VC */ | 694 | ffreg_t new_vc; /* New VC */ |
695 | freg_t sched_tbl_ptr; /* Schedule table pointer */ | 695 | ffreg_t sched_tbl_ptr; /* Schedule table pointer */ |
696 | freg_t vbrwq_wptr; /* VBR wait queue write pointer */ | 696 | ffreg_t vbrwq_wptr; /* VBR wait queue write pointer */ |
697 | freg_t vbrwq_rptr; /* VBR wait queue read pointer */ | 697 | ffreg_t vbrwq_rptr; /* VBR wait queue read pointer */ |
698 | freg_t abrwq_wptr; /* ABR wait queue write pointer */ | 698 | ffreg_t abrwq_wptr; /* ABR wait queue write pointer */ |
699 | freg_t abrwq_rptr; /* ABR wait queue read pointer */ | 699 | ffreg_t abrwq_rptr; /* ABR wait queue read pointer */ |
700 | freg_t ubrwq_wptr; /* UBR wait queue write pointer */ | 700 | ffreg_t ubrwq_wptr; /* UBR wait queue write pointer */ |
701 | freg_t ubrwq_rptr; /* UBR wait queue read pointer */ | 701 | ffreg_t ubrwq_rptr; /* UBR wait queue read pointer */ |
702 | freg_t cbr_vc; /* CBR VC */ | 702 | ffreg_t cbr_vc; /* CBR VC */ |
703 | freg_t vbr_sb_vc; /* VBR SB VC */ | 703 | ffreg_t vbr_sb_vc; /* VBR SB VC */ |
704 | freg_t abr_sb_vc; /* ABR SB VC */ | 704 | ffreg_t abr_sb_vc; /* ABR SB VC */ |
705 | freg_t ubr_sb_vc; /* UBR SB VC */ | 705 | ffreg_t ubr_sb_vc; /* UBR SB VC */ |
706 | freg_t vbr_next_link; /* VBR next link */ | 706 | ffreg_t vbr_next_link; /* VBR next link */ |
707 | freg_t abr_next_link; /* ABR next link */ | 707 | ffreg_t abr_next_link; /* ABR next link */ |
708 | freg_t ubr_next_link; /* UBR next link */ | 708 | ffreg_t ubr_next_link; /* UBR next link */ |
709 | u_int filler7a[0x7c-0x7a]; | 709 | u_int filler7a[0x7c-0x7a]; |
710 | freg_t out_rate_head; /* Out of rate head */ | 710 | ffreg_t out_rate_head; /* Out of rate head */ |
711 | u_int filler7d[0xca-0x7d]; /* pad out to full address space */ | 711 | u_int filler7d[0xca-0x7d]; /* pad out to full address space */ |
712 | freg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */ | 712 | ffreg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */ |
713 | freg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */ | 713 | ffreg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */ |
714 | u_int fillercc[0x100-0xcc]; /* pad out to full address space */ | 714 | u_int fillercc[0x100-0xcc]; /* pad out to full address space */ |
715 | } ffredn_t; | 715 | } ffredn_t; |
716 | 716 | ||
717 | typedef struct _rfredn_t { | 717 | typedef struct _rfredn_t { |
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h index 19e3fbfd5757..cb0c45488572 100644 --- a/drivers/bcma/bcma_private.h +++ b/drivers/bcma/bcma_private.h | |||
@@ -94,11 +94,16 @@ void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc); | |||
94 | #ifdef CONFIG_BCMA_DRIVER_GPIO | 94 | #ifdef CONFIG_BCMA_DRIVER_GPIO |
95 | /* driver_gpio.c */ | 95 | /* driver_gpio.c */ |
96 | int bcma_gpio_init(struct bcma_drv_cc *cc); | 96 | int bcma_gpio_init(struct bcma_drv_cc *cc); |
97 | int bcma_gpio_unregister(struct bcma_drv_cc *cc); | ||
97 | #else | 98 | #else |
98 | static inline int bcma_gpio_init(struct bcma_drv_cc *cc) | 99 | static inline int bcma_gpio_init(struct bcma_drv_cc *cc) |
99 | { | 100 | { |
100 | return -ENOTSUPP; | 101 | return -ENOTSUPP; |
101 | } | 102 | } |
103 | static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc) | ||
104 | { | ||
105 | return 0; | ||
106 | } | ||
102 | #endif /* CONFIG_BCMA_DRIVER_GPIO */ | 107 | #endif /* CONFIG_BCMA_DRIVER_GPIO */ |
103 | 108 | ||
104 | #endif | 109 | #endif |
diff --git a/drivers/bcma/driver_chipcommon_nflash.c b/drivers/bcma/driver_chipcommon_nflash.c index dbda91e4dff5..1f0b83e18f68 100644 --- a/drivers/bcma/driver_chipcommon_nflash.c +++ b/drivers/bcma/driver_chipcommon_nflash.c | |||
@@ -21,7 +21,7 @@ int bcma_nflash_init(struct bcma_drv_cc *cc) | |||
21 | struct bcma_bus *bus = cc->core->bus; | 21 | struct bcma_bus *bus = cc->core->bus; |
22 | 22 | ||
23 | if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 && | 23 | if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 && |
24 | cc->core->id.rev != 0x38) { | 24 | cc->core->id.rev != 38) { |
25 | bcma_err(bus, "NAND flash on unsupported board!\n"); | 25 | bcma_err(bus, "NAND flash on unsupported board!\n"); |
26 | return -ENOTSUPP; | 26 | return -ENOTSUPP; |
27 | } | 27 | } |
diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c index 9a6f585da2d9..71f755c06fc6 100644 --- a/drivers/bcma/driver_gpio.c +++ b/drivers/bcma/driver_gpio.c | |||
@@ -96,3 +96,8 @@ int bcma_gpio_init(struct bcma_drv_cc *cc) | |||
96 | 96 | ||
97 | return gpiochip_add(chip); | 97 | return gpiochip_add(chip); |
98 | } | 98 | } |
99 | |||
100 | int bcma_gpio_unregister(struct bcma_drv_cc *cc) | ||
101 | { | ||
102 | return gpiochip_remove(&cc->gpio); | ||
103 | } | ||
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 4a92f647b58b..324f9debda88 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c | |||
@@ -268,6 +268,13 @@ int bcma_bus_register(struct bcma_bus *bus) | |||
268 | void bcma_bus_unregister(struct bcma_bus *bus) | 268 | void bcma_bus_unregister(struct bcma_bus *bus) |
269 | { | 269 | { |
270 | struct bcma_device *cores[3]; | 270 | struct bcma_device *cores[3]; |
271 | int err; | ||
272 | |||
273 | err = bcma_gpio_unregister(&bus->drv_cc); | ||
274 | if (err == -EBUSY) | ||
275 | bcma_err(bus, "Some GPIOs are still in use.\n"); | ||
276 | else if (err) | ||
277 | bcma_err(bus, "Can not unregister GPIO driver: %i\n", err); | ||
271 | 278 | ||
272 | cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); | 279 | cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); |
273 | cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); | 280 | cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); |
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index f58a4a4b4dfb..2b8303ad63c9 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c | |||
@@ -168,7 +168,7 @@ static void wake_all_senders(struct drbd_tconn *tconn) { | |||
168 | } | 168 | } |
169 | 169 | ||
170 | /* must hold resource->req_lock */ | 170 | /* must hold resource->req_lock */ |
171 | static void start_new_tl_epoch(struct drbd_tconn *tconn) | 171 | void start_new_tl_epoch(struct drbd_tconn *tconn) |
172 | { | 172 | { |
173 | /* no point closing an epoch, if it is empty, anyways. */ | 173 | /* no point closing an epoch, if it is empty, anyways. */ |
174 | if (tconn->current_tle_writes == 0) | 174 | if (tconn->current_tle_writes == 0) |
diff --git a/drivers/block/drbd/drbd_req.h b/drivers/block/drbd/drbd_req.h index 016de6b8bb57..c08d22964d06 100644 --- a/drivers/block/drbd/drbd_req.h +++ b/drivers/block/drbd/drbd_req.h | |||
@@ -267,6 +267,7 @@ struct bio_and_error { | |||
267 | int error; | 267 | int error; |
268 | }; | 268 | }; |
269 | 269 | ||
270 | extern void start_new_tl_epoch(struct drbd_tconn *tconn); | ||
270 | extern void drbd_req_destroy(struct kref *kref); | 271 | extern void drbd_req_destroy(struct kref *kref); |
271 | extern void _req_may_be_done(struct drbd_request *req, | 272 | extern void _req_may_be_done(struct drbd_request *req, |
272 | struct bio_and_error *m); | 273 | struct bio_and_error *m); |
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 53bf6182bac4..0fe220cfb9e9 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c | |||
@@ -931,6 +931,7 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns, | |||
931 | enum drbd_state_rv rv = SS_SUCCESS; | 931 | enum drbd_state_rv rv = SS_SUCCESS; |
932 | enum sanitize_state_warnings ssw; | 932 | enum sanitize_state_warnings ssw; |
933 | struct after_state_chg_work *ascw; | 933 | struct after_state_chg_work *ascw; |
934 | bool did_remote, should_do_remote; | ||
934 | 935 | ||
935 | os = drbd_read_state(mdev); | 936 | os = drbd_read_state(mdev); |
936 | 937 | ||
@@ -981,11 +982,17 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns, | |||
981 | (os.disk != D_DISKLESS && ns.disk == D_DISKLESS)) | 982 | (os.disk != D_DISKLESS && ns.disk == D_DISKLESS)) |
982 | atomic_inc(&mdev->local_cnt); | 983 | atomic_inc(&mdev->local_cnt); |
983 | 984 | ||
985 | did_remote = drbd_should_do_remote(mdev->state); | ||
984 | mdev->state.i = ns.i; | 986 | mdev->state.i = ns.i; |
987 | should_do_remote = drbd_should_do_remote(mdev->state); | ||
985 | mdev->tconn->susp = ns.susp; | 988 | mdev->tconn->susp = ns.susp; |
986 | mdev->tconn->susp_nod = ns.susp_nod; | 989 | mdev->tconn->susp_nod = ns.susp_nod; |
987 | mdev->tconn->susp_fen = ns.susp_fen; | 990 | mdev->tconn->susp_fen = ns.susp_fen; |
988 | 991 | ||
992 | /* put replicated vs not-replicated requests in seperate epochs */ | ||
993 | if (did_remote != should_do_remote) | ||
994 | start_new_tl_epoch(mdev->tconn); | ||
995 | |||
989 | if (os.disk == D_ATTACHING && ns.disk >= D_NEGOTIATING) | 996 | if (os.disk == D_ATTACHING && ns.disk >= D_NEGOTIATING) |
990 | drbd_print_uuids(mdev, "attached to UUIDs"); | 997 | drbd_print_uuids(mdev, "attached to UUIDs"); |
991 | 998 | ||
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 9694dd99bbbc..3fd100990453 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
@@ -626,12 +626,13 @@ static void mtip_timeout_function(unsigned long int data) | |||
626 | } | 626 | } |
627 | } | 627 | } |
628 | 628 | ||
629 | if (cmdto_cnt && !test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) { | 629 | if (cmdto_cnt) { |
630 | print_tags(port->dd, "timed out", tagaccum, cmdto_cnt); | 630 | print_tags(port->dd, "timed out", tagaccum, cmdto_cnt); |
631 | 631 | if (!test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) { | |
632 | mtip_restart_port(port); | 632 | mtip_restart_port(port); |
633 | wake_up_interruptible(&port->svc_wait); | ||
634 | } | ||
633 | clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags); | 635 | clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags); |
634 | wake_up_interruptible(&port->svc_wait); | ||
635 | } | 636 | } |
636 | 637 | ||
637 | if (port->ic_pause_timer) { | 638 | if (port->ic_pause_timer) { |
@@ -3887,7 +3888,12 @@ static int mtip_block_remove(struct driver_data *dd) | |||
3887 | * Delete our gendisk structure. This also removes the device | 3888 | * Delete our gendisk structure. This also removes the device |
3888 | * from /dev | 3889 | * from /dev |
3889 | */ | 3890 | */ |
3890 | del_gendisk(dd->disk); | 3891 | if (dd->disk) { |
3892 | if (dd->disk->queue) | ||
3893 | del_gendisk(dd->disk); | ||
3894 | else | ||
3895 | put_disk(dd->disk); | ||
3896 | } | ||
3891 | 3897 | ||
3892 | spin_lock(&rssd_index_lock); | 3898 | spin_lock(&rssd_index_lock); |
3893 | ida_remove(&rssd_index_ida, dd->index); | 3899 | ida_remove(&rssd_index_ida, dd->index); |
@@ -3921,7 +3927,13 @@ static int mtip_block_shutdown(struct driver_data *dd) | |||
3921 | "Shutting down %s ...\n", dd->disk->disk_name); | 3927 | "Shutting down %s ...\n", dd->disk->disk_name); |
3922 | 3928 | ||
3923 | /* Delete our gendisk structure, and cleanup the blk queue. */ | 3929 | /* Delete our gendisk structure, and cleanup the blk queue. */ |
3924 | del_gendisk(dd->disk); | 3930 | if (dd->disk) { |
3931 | if (dd->disk->queue) | ||
3932 | del_gendisk(dd->disk); | ||
3933 | else | ||
3934 | put_disk(dd->disk); | ||
3935 | } | ||
3936 | |||
3925 | 3937 | ||
3926 | spin_lock(&rssd_index_lock); | 3938 | spin_lock(&rssd_index_lock); |
3927 | ida_remove(&rssd_index_ida, dd->index); | 3939 | ida_remove(&rssd_index_ida, dd->index); |
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 74374fb762aa..5ac841ff6cc7 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c | |||
@@ -161,10 +161,12 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, | |||
161 | static void make_response(struct xen_blkif *blkif, u64 id, | 161 | static void make_response(struct xen_blkif *blkif, u64 id, |
162 | unsigned short op, int st); | 162 | unsigned short op, int st); |
163 | 163 | ||
164 | #define foreach_grant(pos, rbtree, node) \ | 164 | #define foreach_grant_safe(pos, n, rbtree, node) \ |
165 | for ((pos) = container_of(rb_first((rbtree)), typeof(*(pos)), node); \ | 165 | for ((pos) = container_of(rb_first((rbtree)), typeof(*(pos)), node), \ |
166 | (n) = rb_next(&(pos)->node); \ | ||
166 | &(pos)->node != NULL; \ | 167 | &(pos)->node != NULL; \ |
167 | (pos) = container_of(rb_next(&(pos)->node), typeof(*(pos)), node)) | 168 | (pos) = container_of(n, typeof(*(pos)), node), \ |
169 | (n) = (&(pos)->node != NULL) ? rb_next(&(pos)->node) : NULL) | ||
168 | 170 | ||
169 | 171 | ||
170 | static void add_persistent_gnt(struct rb_root *root, | 172 | static void add_persistent_gnt(struct rb_root *root, |
@@ -217,10 +219,11 @@ static void free_persistent_gnts(struct rb_root *root, unsigned int num) | |||
217 | struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | 219 | struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST]; |
218 | struct page *pages[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | 220 | struct page *pages[BLKIF_MAX_SEGMENTS_PER_REQUEST]; |
219 | struct persistent_gnt *persistent_gnt; | 221 | struct persistent_gnt *persistent_gnt; |
222 | struct rb_node *n; | ||
220 | int ret = 0; | 223 | int ret = 0; |
221 | int segs_to_unmap = 0; | 224 | int segs_to_unmap = 0; |
222 | 225 | ||
223 | foreach_grant(persistent_gnt, root, node) { | 226 | foreach_grant_safe(persistent_gnt, n, root, node) { |
224 | BUG_ON(persistent_gnt->handle == | 227 | BUG_ON(persistent_gnt->handle == |
225 | BLKBACK_INVALID_HANDLE); | 228 | BLKBACK_INVALID_HANDLE); |
226 | gnttab_set_unmap_op(&unmap[segs_to_unmap], | 229 | gnttab_set_unmap_op(&unmap[segs_to_unmap], |
@@ -230,9 +233,6 @@ static void free_persistent_gnts(struct rb_root *root, unsigned int num) | |||
230 | persistent_gnt->handle); | 233 | persistent_gnt->handle); |
231 | 234 | ||
232 | pages[segs_to_unmap] = persistent_gnt->page; | 235 | pages[segs_to_unmap] = persistent_gnt->page; |
233 | rb_erase(&persistent_gnt->node, root); | ||
234 | kfree(persistent_gnt); | ||
235 | num--; | ||
236 | 236 | ||
237 | if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST || | 237 | if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST || |
238 | !rb_next(&persistent_gnt->node)) { | 238 | !rb_next(&persistent_gnt->node)) { |
@@ -241,6 +241,10 @@ static void free_persistent_gnts(struct rb_root *root, unsigned int num) | |||
241 | BUG_ON(ret); | 241 | BUG_ON(ret); |
242 | segs_to_unmap = 0; | 242 | segs_to_unmap = 0; |
243 | } | 243 | } |
244 | |||
245 | rb_erase(&persistent_gnt->node, root); | ||
246 | kfree(persistent_gnt); | ||
247 | num--; | ||
244 | } | 248 | } |
245 | BUG_ON(num != 0); | 249 | BUG_ON(num != 0); |
246 | } | 250 | } |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 96e9b00db081..11043c18ac5a 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -792,6 +792,7 @@ static void blkif_free(struct blkfront_info *info, int suspend) | |||
792 | { | 792 | { |
793 | struct llist_node *all_gnts; | 793 | struct llist_node *all_gnts; |
794 | struct grant *persistent_gnt; | 794 | struct grant *persistent_gnt; |
795 | struct llist_node *n; | ||
795 | 796 | ||
796 | /* Prevent new requests being issued until we fix things up. */ | 797 | /* Prevent new requests being issued until we fix things up. */ |
797 | spin_lock_irq(&info->io_lock); | 798 | spin_lock_irq(&info->io_lock); |
@@ -804,7 +805,7 @@ static void blkif_free(struct blkfront_info *info, int suspend) | |||
804 | /* Remove all persistent grants */ | 805 | /* Remove all persistent grants */ |
805 | if (info->persistent_gnts_c) { | 806 | if (info->persistent_gnts_c) { |
806 | all_gnts = llist_del_all(&info->persistent_gnts); | 807 | all_gnts = llist_del_all(&info->persistent_gnts); |
807 | llist_for_each_entry(persistent_gnt, all_gnts, node) { | 808 | llist_for_each_entry_safe(persistent_gnt, n, all_gnts, node) { |
808 | gnttab_end_foreign_access(persistent_gnt->gref, 0, 0UL); | 809 | gnttab_end_foreign_access(persistent_gnt->gref, 0, 0UL); |
809 | __free_page(pfn_to_page(persistent_gnt->pfn)); | 810 | __free_page(pfn_to_page(persistent_gnt->pfn)); |
810 | kfree(persistent_gnt); | 811 | kfree(persistent_gnt); |
@@ -835,7 +836,7 @@ static void blkif_free(struct blkfront_info *info, int suspend) | |||
835 | static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info, | 836 | static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info, |
836 | struct blkif_response *bret) | 837 | struct blkif_response *bret) |
837 | { | 838 | { |
838 | int i; | 839 | int i = 0; |
839 | struct bio_vec *bvec; | 840 | struct bio_vec *bvec; |
840 | struct req_iterator iter; | 841 | struct req_iterator iter; |
841 | unsigned long flags; | 842 | unsigned long flags; |
@@ -852,7 +853,8 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info, | |||
852 | */ | 853 | */ |
853 | rq_for_each_segment(bvec, s->request, iter) { | 854 | rq_for_each_segment(bvec, s->request, iter) { |
854 | BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE); | 855 | BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE); |
855 | i = offset >> PAGE_SHIFT; | 856 | if (bvec->bv_offset < offset) |
857 | i++; | ||
856 | BUG_ON(i >= s->req.u.rw.nr_segments); | 858 | BUG_ON(i >= s->req.u.rw.nr_segments); |
857 | shared_data = kmap_atomic( | 859 | shared_data = kmap_atomic( |
858 | pfn_to_page(s->grants_used[i]->pfn)); | 860 | pfn_to_page(s->grants_used[i]->pfn)); |
@@ -861,7 +863,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info, | |||
861 | bvec->bv_len); | 863 | bvec->bv_len); |
862 | bvec_kunmap_irq(bvec_data, &flags); | 864 | bvec_kunmap_irq(bvec_data, &flags); |
863 | kunmap_atomic(shared_data); | 865 | kunmap_atomic(shared_data); |
864 | offset += bvec->bv_len; | 866 | offset = bvec->bv_offset + bvec->bv_len; |
865 | } | 867 | } |
866 | } | 868 | } |
867 | /* Add the persistent grant into the list of free grants */ | 869 | /* Add the persistent grant into the list of free grants */ |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 684b0d53764f..ee4dbeafb377 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -2062,7 +2062,8 @@ static void virtcons_remove(struct virtio_device *vdev) | |||
2062 | /* Disable interrupts for vqs */ | 2062 | /* Disable interrupts for vqs */ |
2063 | vdev->config->reset(vdev); | 2063 | vdev->config->reset(vdev); |
2064 | /* Finish up work that's lined up */ | 2064 | /* Finish up work that's lined up */ |
2065 | cancel_work_sync(&portdev->control_work); | 2065 | if (use_multiport(portdev)) |
2066 | cancel_work_sync(&portdev->control_work); | ||
2066 | 2067 | ||
2067 | list_for_each_entry_safe(port, port2, &portdev->ports, list) | 2068 | list_for_each_entry_safe(port, port2, &portdev->ports, list) |
2068 | unplug_port(port); | 2069 | unplug_port(port); |
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 64798424b6cb..e920cbe519fa 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig | |||
@@ -1,3 +1,6 @@ | |||
1 | config CLKSRC_OF | ||
2 | bool | ||
3 | |||
1 | config CLKSRC_I8253 | 4 | config CLKSRC_I8253 |
2 | bool | 5 | bool |
3 | 6 | ||
@@ -25,6 +28,9 @@ config ARMADA_370_XP_TIMER | |||
25 | config SUNXI_TIMER | 28 | config SUNXI_TIMER |
26 | bool | 29 | bool |
27 | 30 | ||
31 | config VT8500_TIMER | ||
32 | bool | ||
33 | |||
28 | config CLKSRC_NOMADIK_MTU | 34 | config CLKSRC_NOMADIK_MTU |
29 | bool | 35 | bool |
30 | depends on (ARCH_NOMADIK || ARCH_U8500) | 36 | depends on (ARCH_NOMADIK || ARCH_U8500) |
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index e69511c4c66e..49271105339f 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | obj-$(CONFIG_CLKSRC_OF) += clksrc-of.o | ||
1 | obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_clksrc.o | 2 | obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_clksrc.o |
2 | obj-$(CONFIG_X86_CYCLONE_TIMER) += cyclone.o | 3 | obj-$(CONFIG_X86_CYCLONE_TIMER) += cyclone.o |
3 | obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o | 4 | obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o |
@@ -16,5 +17,6 @@ obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o | |||
16 | obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o | 17 | obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o |
17 | obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o | 18 | obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o |
18 | obj-$(CONFIG_SUNXI_TIMER) += sunxi_timer.o | 19 | obj-$(CONFIG_SUNXI_TIMER) += sunxi_timer.o |
20 | obj-$(CONFIG_VT8500_TIMER) += vt8500_timer.o | ||
19 | 21 | ||
20 | obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o | 22 | obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o |
diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c index bc19f12c20ce..7f796d8f7505 100644 --- a/drivers/clocksource/bcm2835_timer.c +++ b/drivers/clocksource/bcm2835_timer.c | |||
@@ -101,7 +101,7 @@ static struct of_device_id bcm2835_time_match[] __initconst = { | |||
101 | {} | 101 | {} |
102 | }; | 102 | }; |
103 | 103 | ||
104 | static void __init bcm2835_time_init(void) | 104 | void __init bcm2835_timer_init(void) |
105 | { | 105 | { |
106 | struct device_node *node; | 106 | struct device_node *node; |
107 | void __iomem *base; | 107 | void __iomem *base; |
@@ -155,7 +155,3 @@ static void __init bcm2835_time_init(void) | |||
155 | 155 | ||
156 | pr_info("bcm2835: system timer (irq = %d)\n", irq); | 156 | pr_info("bcm2835: system timer (irq = %d)\n", irq); |
157 | } | 157 | } |
158 | |||
159 | struct sys_timer bcm2835_timer = { | ||
160 | .init = bcm2835_time_init, | ||
161 | }; | ||
diff --git a/drivers/clocksource/clksrc-of.c b/drivers/clocksource/clksrc-of.c new file mode 100644 index 000000000000..bdabdaa8d00f --- /dev/null +++ b/drivers/clocksource/clksrc-of.c | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include <linux/init.h> | ||
18 | #include <linux/of.h> | ||
19 | |||
20 | extern struct of_device_id __clksrc_of_table[]; | ||
21 | |||
22 | static const struct of_device_id __clksrc_of_table_sentinel | ||
23 | __used __section(__clksrc_of_table_end); | ||
24 | |||
25 | void __init clocksource_of_init(void) | ||
26 | { | ||
27 | struct device_node *np; | ||
28 | const struct of_device_id *match; | ||
29 | void (*init_func)(void); | ||
30 | |||
31 | for_each_matching_node_and_match(np, __clksrc_of_table, &match) { | ||
32 | init_func = match->data; | ||
33 | init_func(); | ||
34 | } | ||
35 | } | ||
diff --git a/drivers/clocksource/cs5535-clockevt.c b/drivers/clocksource/cs5535-clockevt.c index d9279385304d..ea210482dd20 100644 --- a/drivers/clocksource/cs5535-clockevt.c +++ b/drivers/clocksource/cs5535-clockevt.c | |||
@@ -100,7 +100,6 @@ static struct clock_event_device cs5535_clockevent = { | |||
100 | .set_mode = mfgpt_set_mode, | 100 | .set_mode = mfgpt_set_mode, |
101 | .set_next_event = mfgpt_next_event, | 101 | .set_next_event = mfgpt_next_event, |
102 | .rating = 250, | 102 | .rating = 250, |
103 | .shift = 32 | ||
104 | }; | 103 | }; |
105 | 104 | ||
106 | static irqreturn_t mfgpt_tick(int irq, void *dev_id) | 105 | static irqreturn_t mfgpt_tick(int irq, void *dev_id) |
@@ -169,17 +168,11 @@ static int __init cs5535_mfgpt_init(void) | |||
169 | cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, val); | 168 | cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, val); |
170 | 169 | ||
171 | /* Set up the clock event */ | 170 | /* Set up the clock event */ |
172 | cs5535_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, | ||
173 | cs5535_clockevent.shift); | ||
174 | cs5535_clockevent.min_delta_ns = clockevent_delta2ns(0xF, | ||
175 | &cs5535_clockevent); | ||
176 | cs5535_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFE, | ||
177 | &cs5535_clockevent); | ||
178 | |||
179 | printk(KERN_INFO DRV_NAME | 171 | printk(KERN_INFO DRV_NAME |
180 | ": Registering MFGPT timer as a clock event, using IRQ %d\n", | 172 | ": Registering MFGPT timer as a clock event, using IRQ %d\n", |
181 | timer_irq); | 173 | timer_irq); |
182 | clockevents_register_device(&cs5535_clockevent); | 174 | clockevents_config_and_register(&cs5535_clockevent, MFGPT_HZ, |
175 | 0xF, 0xFFFE); | ||
183 | 176 | ||
184 | return 0; | 177 | return 0; |
185 | 178 | ||
diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c index f7dba5b79b44..ab09ed3742ee 100644 --- a/drivers/clocksource/dw_apb_timer_of.c +++ b/drivers/clocksource/dw_apb_timer_of.c | |||
@@ -107,7 +107,7 @@ static const struct of_device_id osctimer_ids[] __initconst = { | |||
107 | {}, | 107 | {}, |
108 | }; | 108 | }; |
109 | 109 | ||
110 | static void __init timer_init(void) | 110 | void __init dw_apb_timer_init(void) |
111 | { | 111 | { |
112 | struct device_node *event_timer, *source_timer; | 112 | struct device_node *event_timer, *source_timer; |
113 | 113 | ||
@@ -125,7 +125,3 @@ static void __init timer_init(void) | |||
125 | 125 | ||
126 | init_sched_clock(); | 126 | init_sched_clock(); |
127 | } | 127 | } |
128 | |||
129 | struct sys_timer dw_apb_timer = { | ||
130 | .init = timer_init, | ||
131 | }; | ||
diff --git a/drivers/clocksource/nomadik-mtu.c b/drivers/clocksource/nomadik-mtu.c index 8914c3c1c88b..025afc6dd324 100644 --- a/drivers/clocksource/nomadik-mtu.c +++ b/drivers/clocksource/nomadik-mtu.c | |||
@@ -134,12 +134,32 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode, | |||
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | void nmdk_clksrc_reset(void) | ||
138 | { | ||
139 | /* Disable */ | ||
140 | writel(0, mtu_base + MTU_CR(0)); | ||
141 | |||
142 | /* ClockSource: configure load and background-load, and fire it up */ | ||
143 | writel(nmdk_cycle, mtu_base + MTU_LR(0)); | ||
144 | writel(nmdk_cycle, mtu_base + MTU_BGLR(0)); | ||
145 | |||
146 | writel(clk_prescale | MTU_CRn_32BITS | MTU_CRn_ENA, | ||
147 | mtu_base + MTU_CR(0)); | ||
148 | } | ||
149 | |||
150 | static void nmdk_clkevt_resume(struct clock_event_device *cedev) | ||
151 | { | ||
152 | nmdk_clkevt_reset(); | ||
153 | nmdk_clksrc_reset(); | ||
154 | } | ||
155 | |||
137 | static struct clock_event_device nmdk_clkevt = { | 156 | static struct clock_event_device nmdk_clkevt = { |
138 | .name = "mtu_1", | 157 | .name = "mtu_1", |
139 | .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, | 158 | .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, |
140 | .rating = 200, | 159 | .rating = 200, |
141 | .set_mode = nmdk_clkevt_mode, | 160 | .set_mode = nmdk_clkevt_mode, |
142 | .set_next_event = nmdk_clkevt_next, | 161 | .set_next_event = nmdk_clkevt_next, |
162 | .resume = nmdk_clkevt_resume, | ||
143 | }; | 163 | }; |
144 | 164 | ||
145 | /* | 165 | /* |
@@ -161,19 +181,6 @@ static struct irqaction nmdk_timer_irq = { | |||
161 | .dev_id = &nmdk_clkevt, | 181 | .dev_id = &nmdk_clkevt, |
162 | }; | 182 | }; |
163 | 183 | ||
164 | void nmdk_clksrc_reset(void) | ||
165 | { | ||
166 | /* Disable */ | ||
167 | writel(0, mtu_base + MTU_CR(0)); | ||
168 | |||
169 | /* ClockSource: configure load and background-load, and fire it up */ | ||
170 | writel(nmdk_cycle, mtu_base + MTU_LR(0)); | ||
171 | writel(nmdk_cycle, mtu_base + MTU_BGLR(0)); | ||
172 | |||
173 | writel(clk_prescale | MTU_CRn_32BITS | MTU_CRn_ENA, | ||
174 | mtu_base + MTU_CR(0)); | ||
175 | } | ||
176 | |||
177 | void __init nmdk_timer_init(void __iomem *base, int irq) | 184 | void __init nmdk_timer_init(void __iomem *base, int irq) |
178 | { | 185 | { |
179 | unsigned long rate; | 186 | unsigned long rate; |
diff --git a/drivers/clocksource/sunxi_timer.c b/drivers/clocksource/sunxi_timer.c index 3cd1bd3d7aee..0ce85e29769b 100644 --- a/drivers/clocksource/sunxi_timer.c +++ b/drivers/clocksource/sunxi_timer.c | |||
@@ -74,7 +74,6 @@ static int sunxi_clkevt_next_event(unsigned long evt, | |||
74 | 74 | ||
75 | static struct clock_event_device sunxi_clockevent = { | 75 | static struct clock_event_device sunxi_clockevent = { |
76 | .name = "sunxi_tick", | 76 | .name = "sunxi_tick", |
77 | .shift = 32, | ||
78 | .rating = 300, | 77 | .rating = 300, |
79 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 78 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
80 | .set_mode = sunxi_clkevt_mode, | 79 | .set_mode = sunxi_clkevt_mode, |
@@ -104,7 +103,7 @@ static struct of_device_id sunxi_timer_dt_ids[] = { | |||
104 | { } | 103 | { } |
105 | }; | 104 | }; |
106 | 105 | ||
107 | static void __init sunxi_timer_init(void) | 106 | void __init sunxi_timer_init(void) |
108 | { | 107 | { |
109 | struct device_node *node; | 108 | struct device_node *node; |
110 | unsigned long rate = 0; | 109 | unsigned long rate = 0; |
@@ -154,18 +153,8 @@ static void __init sunxi_timer_init(void) | |||
154 | val = readl(timer_base + TIMER_CTL_REG); | 153 | val = readl(timer_base + TIMER_CTL_REG); |
155 | writel(val | TIMER_CTL_ENABLE, timer_base + TIMER_CTL_REG); | 154 | writel(val | TIMER_CTL_ENABLE, timer_base + TIMER_CTL_REG); |
156 | 155 | ||
157 | sunxi_clockevent.mult = div_sc(rate / TIMER_SCAL, | ||
158 | NSEC_PER_SEC, | ||
159 | sunxi_clockevent.shift); | ||
160 | sunxi_clockevent.max_delta_ns = clockevent_delta2ns(0xff, | ||
161 | &sunxi_clockevent); | ||
162 | sunxi_clockevent.min_delta_ns = clockevent_delta2ns(0x1, | ||
163 | &sunxi_clockevent); | ||
164 | sunxi_clockevent.cpumask = cpumask_of(0); | 156 | sunxi_clockevent.cpumask = cpumask_of(0); |
165 | 157 | ||
166 | clockevents_register_device(&sunxi_clockevent); | 158 | clockevents_config_and_register(&sunxi_clockevent, rate / TIMER_SCAL, |
159 | 0x1, 0xff); | ||
167 | } | 160 | } |
168 | |||
169 | struct sys_timer sunxi_timer = { | ||
170 | .init = sunxi_timer_init, | ||
171 | }; | ||
diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index 32cb929b8eb6..8a6187225dd0 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c | |||
@@ -157,7 +157,6 @@ static struct tc_clkevt_device clkevt = { | |||
157 | .name = "tc_clkevt", | 157 | .name = "tc_clkevt", |
158 | .features = CLOCK_EVT_FEAT_PERIODIC | 158 | .features = CLOCK_EVT_FEAT_PERIODIC |
159 | | CLOCK_EVT_FEAT_ONESHOT, | 159 | | CLOCK_EVT_FEAT_ONESHOT, |
160 | .shift = 32, | ||
161 | /* Should be lower than at91rm9200's system timer */ | 160 | /* Should be lower than at91rm9200's system timer */ |
162 | .rating = 125, | 161 | .rating = 125, |
163 | .set_next_event = tc_next_event, | 162 | .set_next_event = tc_next_event, |
@@ -196,13 +195,9 @@ static void __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) | |||
196 | 195 | ||
197 | timer_clock = clk32k_divisor_idx; | 196 | timer_clock = clk32k_divisor_idx; |
198 | 197 | ||
199 | clkevt.clkevt.mult = div_sc(32768, NSEC_PER_SEC, clkevt.clkevt.shift); | ||
200 | clkevt.clkevt.max_delta_ns | ||
201 | = clockevent_delta2ns(0xffff, &clkevt.clkevt); | ||
202 | clkevt.clkevt.min_delta_ns = clockevent_delta2ns(1, &clkevt.clkevt) + 1; | ||
203 | clkevt.clkevt.cpumask = cpumask_of(0); | 198 | clkevt.clkevt.cpumask = cpumask_of(0); |
204 | 199 | ||
205 | clockevents_register_device(&clkevt.clkevt); | 200 | clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff); |
206 | 201 | ||
207 | setup_irq(irq, &tc_irqaction); | 202 | setup_irq(irq, &tc_irqaction); |
208 | } | 203 | } |
diff --git a/arch/arm/mach-vt8500/timer.c b/drivers/clocksource/vt8500_timer.c index 3dd21a47881f..ed66cf07d3c6 100644 --- a/arch/arm/mach-vt8500/timer.c +++ b/drivers/clocksource/vt8500_timer.c | |||
@@ -168,17 +168,12 @@ void __init vt8500_timer_init(void) | |||
168 | pr_err("%s: vt8500_timer_init: clocksource_register failed for %s\n", | 168 | pr_err("%s: vt8500_timer_init: clocksource_register failed for %s\n", |
169 | __func__, clocksource.name); | 169 | __func__, clocksource.name); |
170 | 170 | ||
171 | clockevents_calc_mult_shift(&clockevent, VT8500_TIMER_HZ, 4); | ||
172 | |||
173 | /* copy-pasted from mach-msm; no idea */ | ||
174 | clockevent.max_delta_ns = | ||
175 | clockevent_delta2ns(0xf0000000, &clockevent); | ||
176 | clockevent.min_delta_ns = clockevent_delta2ns(4, &clockevent); | ||
177 | clockevent.cpumask = cpumask_of(0); | 171 | clockevent.cpumask = cpumask_of(0); |
178 | 172 | ||
179 | if (setup_irq(timer_irq, &irq)) | 173 | if (setup_irq(timer_irq, &irq)) |
180 | pr_err("%s: setup_irq failed for %s\n", __func__, | 174 | pr_err("%s: setup_irq failed for %s\n", __func__, |
181 | clockevent.name); | 175 | clockevent.name); |
182 | clockevents_register_device(&clockevent); | 176 | clockevents_config_and_register(&clockevent, VT8500_TIMER_HZ, |
177 | 4, 0xf0000000); | ||
183 | } | 178 | } |
184 | 179 | ||
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 4d0e60adbc6d..a2d478e8692a 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -1313,14 +1313,18 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav | |||
1313 | if (!(tmp & EVERGREEN_CRTC_BLANK_DATA_EN)) { | 1313 | if (!(tmp & EVERGREEN_CRTC_BLANK_DATA_EN)) { |
1314 | radeon_wait_for_vblank(rdev, i); | 1314 | radeon_wait_for_vblank(rdev, i); |
1315 | tmp |= EVERGREEN_CRTC_BLANK_DATA_EN; | 1315 | tmp |= EVERGREEN_CRTC_BLANK_DATA_EN; |
1316 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); | ||
1316 | WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp); | 1317 | WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp); |
1318 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0); | ||
1317 | } | 1319 | } |
1318 | } else { | 1320 | } else { |
1319 | tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); | 1321 | tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); |
1320 | if (!(tmp & EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE)) { | 1322 | if (!(tmp & EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE)) { |
1321 | radeon_wait_for_vblank(rdev, i); | 1323 | radeon_wait_for_vblank(rdev, i); |
1322 | tmp |= EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE; | 1324 | tmp |= EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE; |
1325 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); | ||
1323 | WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp); | 1326 | WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp); |
1327 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0); | ||
1324 | } | 1328 | } |
1325 | } | 1329 | } |
1326 | /* wait for the next frame */ | 1330 | /* wait for the next frame */ |
@@ -1345,6 +1349,8 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav | |||
1345 | blackout &= ~BLACKOUT_MODE_MASK; | 1349 | blackout &= ~BLACKOUT_MODE_MASK; |
1346 | WREG32(MC_SHARED_BLACKOUT_CNTL, blackout | 1); | 1350 | WREG32(MC_SHARED_BLACKOUT_CNTL, blackout | 1); |
1347 | } | 1351 | } |
1352 | /* wait for the MC to settle */ | ||
1353 | udelay(100); | ||
1348 | } | 1354 | } |
1349 | 1355 | ||
1350 | void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save) | 1356 | void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save) |
@@ -1378,11 +1384,15 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s | |||
1378 | if (ASIC_IS_DCE6(rdev)) { | 1384 | if (ASIC_IS_DCE6(rdev)) { |
1379 | tmp = RREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]); | 1385 | tmp = RREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]); |
1380 | tmp |= EVERGREEN_CRTC_BLANK_DATA_EN; | 1386 | tmp |= EVERGREEN_CRTC_BLANK_DATA_EN; |
1387 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); | ||
1381 | WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp); | 1388 | WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp); |
1389 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0); | ||
1382 | } else { | 1390 | } else { |
1383 | tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); | 1391 | tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); |
1384 | tmp &= ~EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE; | 1392 | tmp &= ~EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE; |
1393 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); | ||
1385 | WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp); | 1394 | WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp); |
1395 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0); | ||
1386 | } | 1396 | } |
1387 | /* wait for the next frame */ | 1397 | /* wait for the next frame */ |
1388 | frame_count = radeon_get_vblank_counter(rdev, i); | 1398 | frame_count = radeon_get_vblank_counter(rdev, i); |
@@ -2036,9 +2046,20 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
2036 | WREG32(HDP_ADDR_CONFIG, gb_addr_config); | 2046 | WREG32(HDP_ADDR_CONFIG, gb_addr_config); |
2037 | WREG32(DMA_TILING_CONFIG, gb_addr_config); | 2047 | WREG32(DMA_TILING_CONFIG, gb_addr_config); |
2038 | 2048 | ||
2039 | tmp = gb_addr_config & NUM_PIPES_MASK; | 2049 | if ((rdev->config.evergreen.max_backends == 1) && |
2040 | tmp = r6xx_remap_render_backend(rdev, tmp, rdev->config.evergreen.max_backends, | 2050 | (rdev->flags & RADEON_IS_IGP)) { |
2041 | EVERGREEN_MAX_BACKENDS, disabled_rb_mask); | 2051 | if ((disabled_rb_mask & 3) == 1) { |
2052 | /* RB0 disabled, RB1 enabled */ | ||
2053 | tmp = 0x11111111; | ||
2054 | } else { | ||
2055 | /* RB1 disabled, RB0 enabled */ | ||
2056 | tmp = 0x00000000; | ||
2057 | } | ||
2058 | } else { | ||
2059 | tmp = gb_addr_config & NUM_PIPES_MASK; | ||
2060 | tmp = r6xx_remap_render_backend(rdev, tmp, rdev->config.evergreen.max_backends, | ||
2061 | EVERGREEN_MAX_BACKENDS, disabled_rb_mask); | ||
2062 | } | ||
2042 | WREG32(GB_BACKEND_MAP, tmp); | 2063 | WREG32(GB_BACKEND_MAP, tmp); |
2043 | 2064 | ||
2044 | WREG32(CGTS_SYS_TCC_DISABLE, 0); | 2065 | WREG32(CGTS_SYS_TCC_DISABLE, 0); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index bc2540b17c5e..becb03e8b32f 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1462,12 +1462,15 @@ u32 r6xx_remap_render_backend(struct radeon_device *rdev, | |||
1462 | u32 disabled_rb_mask) | 1462 | u32 disabled_rb_mask) |
1463 | { | 1463 | { |
1464 | u32 rendering_pipe_num, rb_num_width, req_rb_num; | 1464 | u32 rendering_pipe_num, rb_num_width, req_rb_num; |
1465 | u32 pipe_rb_ratio, pipe_rb_remain; | 1465 | u32 pipe_rb_ratio, pipe_rb_remain, tmp; |
1466 | u32 data = 0, mask = 1 << (max_rb_num - 1); | 1466 | u32 data = 0, mask = 1 << (max_rb_num - 1); |
1467 | unsigned i, j; | 1467 | unsigned i, j; |
1468 | 1468 | ||
1469 | /* mask out the RBs that don't exist on that asic */ | 1469 | /* mask out the RBs that don't exist on that asic */ |
1470 | disabled_rb_mask |= (0xff << max_rb_num) & 0xff; | 1470 | tmp = disabled_rb_mask | ((0xff << max_rb_num) & 0xff); |
1471 | /* make sure at least one RB is available */ | ||
1472 | if ((tmp & 0xff) != 0xff) | ||
1473 | disabled_rb_mask = tmp; | ||
1471 | 1474 | ||
1472 | rendering_pipe_num = 1 << tiling_pipe_num; | 1475 | rendering_pipe_num = 1 << tiling_pipe_num; |
1473 | req_rb_num = total_max_rb_num - r600_count_pipe_bits(disabled_rb_mask); | 1476 | req_rb_num = total_max_rb_num - r600_count_pipe_bits(disabled_rb_mask); |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 9056fafb00ea..0b202c07fe50 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -1445,7 +1445,7 @@ static struct radeon_asic cayman_asic = { | |||
1445 | .vm = { | 1445 | .vm = { |
1446 | .init = &cayman_vm_init, | 1446 | .init = &cayman_vm_init, |
1447 | .fini = &cayman_vm_fini, | 1447 | .fini = &cayman_vm_fini, |
1448 | .pt_ring_index = R600_RING_TYPE_DMA_INDEX, | 1448 | .pt_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
1449 | .set_page = &cayman_vm_set_page, | 1449 | .set_page = &cayman_vm_set_page, |
1450 | }, | 1450 | }, |
1451 | .ring = { | 1451 | .ring = { |
@@ -1572,7 +1572,7 @@ static struct radeon_asic trinity_asic = { | |||
1572 | .vm = { | 1572 | .vm = { |
1573 | .init = &cayman_vm_init, | 1573 | .init = &cayman_vm_init, |
1574 | .fini = &cayman_vm_fini, | 1574 | .fini = &cayman_vm_fini, |
1575 | .pt_ring_index = R600_RING_TYPE_DMA_INDEX, | 1575 | .pt_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
1576 | .set_page = &cayman_vm_set_page, | 1576 | .set_page = &cayman_vm_set_page, |
1577 | }, | 1577 | }, |
1578 | .ring = { | 1578 | .ring = { |
@@ -1699,7 +1699,7 @@ static struct radeon_asic si_asic = { | |||
1699 | .vm = { | 1699 | .vm = { |
1700 | .init = &si_vm_init, | 1700 | .init = &si_vm_init, |
1701 | .fini = &si_vm_fini, | 1701 | .fini = &si_vm_fini, |
1702 | .pt_ring_index = R600_RING_TYPE_DMA_INDEX, | 1702 | .pt_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
1703 | .set_page = &si_vm_set_page, | 1703 | .set_page = &si_vm_set_page, |
1704 | }, | 1704 | }, |
1705 | .ring = { | 1705 | .ring = { |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 33a56a09ff10..3e403bdda58f 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -2470,6 +2470,14 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
2470 | 1), | 2470 | 1), |
2471 | ATOM_DEVICE_CRT1_SUPPORT); | 2471 | ATOM_DEVICE_CRT1_SUPPORT); |
2472 | } | 2472 | } |
2473 | /* RV100 board with external TDMS bit mis-set. | ||
2474 | * Actually uses internal TMDS, clear the bit. | ||
2475 | */ | ||
2476 | if (dev->pdev->device == 0x5159 && | ||
2477 | dev->pdev->subsystem_vendor == 0x1014 && | ||
2478 | dev->pdev->subsystem_device == 0x029A) { | ||
2479 | tmp &= ~(1 << 4); | ||
2480 | } | ||
2473 | if ((tmp >> 4) & 0x1) { | 2481 | if ((tmp >> 4) & 0x1) { |
2474 | devices |= ATOM_DEVICE_DFP2_SUPPORT; | 2482 | devices |= ATOM_DEVICE_DFP2_SUPPORT; |
2475 | radeon_add_legacy_encoder(dev, | 2483 | radeon_add_legacy_encoder(dev, |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index ff3def784619..05c96fa0b051 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -1115,8 +1115,10 @@ radeon_user_framebuffer_create(struct drm_device *dev, | |||
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL); | 1117 | radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL); |
1118 | if (radeon_fb == NULL) | 1118 | if (radeon_fb == NULL) { |
1119 | drm_gem_object_unreference_unlocked(obj); | ||
1119 | return ERR_PTR(-ENOMEM); | 1120 | return ERR_PTR(-ENOMEM); |
1121 | } | ||
1120 | 1122 | ||
1121 | ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj); | 1123 | ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj); |
1122 | if (ret) { | 1124 | if (ret) { |
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index 2430d80b1871..cd72062d5a91 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c | |||
@@ -377,6 +377,9 @@ int radeon_ring_alloc(struct radeon_device *rdev, struct radeon_ring *ring, unsi | |||
377 | { | 377 | { |
378 | int r; | 378 | int r; |
379 | 379 | ||
380 | /* make sure we aren't trying to allocate more space than there is on the ring */ | ||
381 | if (ndw > (ring->ring_size / 4)) | ||
382 | return -ENOMEM; | ||
380 | /* Align requested size with padding so unlock_commit can | 383 | /* Align requested size with padding so unlock_commit can |
381 | * pad safely */ | 384 | * pad safely */ |
382 | ndw = (ndw + ring->align_mask) & ~ring->align_mask; | 385 | ndw = (ndw + ring->align_mask) & ~ring->align_mask; |
diff --git a/drivers/gpu/drm/radeon/reg_srcs/cayman b/drivers/gpu/drm/radeon/reg_srcs/cayman index 0f656b111c15..a072fa8c46b0 100644 --- a/drivers/gpu/drm/radeon/reg_srcs/cayman +++ b/drivers/gpu/drm/radeon/reg_srcs/cayman | |||
@@ -1,5 +1,6 @@ | |||
1 | cayman 0x9400 | 1 | cayman 0x9400 |
2 | 0x0000802C GRBM_GFX_INDEX | 2 | 0x0000802C GRBM_GFX_INDEX |
3 | 0x00008040 WAIT_UNTIL | ||
3 | 0x000084FC CP_STRMOUT_CNTL | 4 | 0x000084FC CP_STRMOUT_CNTL |
4 | 0x000085F0 CP_COHER_CNTL | 5 | 0x000085F0 CP_COHER_CNTL |
5 | 0x000085F4 CP_COHER_SIZE | 6 | 0x000085F4 CP_COHER_SIZE |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 2bb6d0e84b3d..435ed3551364 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
@@ -336,6 +336,8 @@ void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save) | |||
336 | WREG32(R600_CITF_CNTL, blackout); | 336 | WREG32(R600_CITF_CNTL, blackout); |
337 | } | 337 | } |
338 | } | 338 | } |
339 | /* wait for the MC to settle */ | ||
340 | udelay(100); | ||
339 | } | 341 | } |
340 | 342 | ||
341 | void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save) | 343 | void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save) |
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 44420fca7dfa..8be35c809c7b 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c | |||
@@ -429,7 +429,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, | |||
429 | struct ttm_bo_device *bdev = bo->bdev; | 429 | struct ttm_bo_device *bdev = bo->bdev; |
430 | struct ttm_bo_driver *driver = bdev->driver; | 430 | struct ttm_bo_driver *driver = bdev->driver; |
431 | 431 | ||
432 | fbo = kzalloc(sizeof(*fbo), GFP_KERNEL); | 432 | fbo = kmalloc(sizeof(*fbo), GFP_KERNEL); |
433 | if (!fbo) | 433 | if (!fbo) |
434 | return -ENOMEM; | 434 | return -ENOMEM; |
435 | 435 | ||
@@ -448,7 +448,12 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, | |||
448 | fbo->vm_node = NULL; | 448 | fbo->vm_node = NULL; |
449 | atomic_set(&fbo->cpu_writers, 0); | 449 | atomic_set(&fbo->cpu_writers, 0); |
450 | 450 | ||
451 | fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); | 451 | spin_lock(&bdev->fence_lock); |
452 | if (bo->sync_obj) | ||
453 | fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); | ||
454 | else | ||
455 | fbo->sync_obj = NULL; | ||
456 | spin_unlock(&bdev->fence_lock); | ||
452 | kref_init(&fbo->list_kref); | 457 | kref_init(&fbo->list_kref); |
453 | kref_init(&fbo->kref); | 458 | kref_init(&fbo->kref); |
454 | fbo->destroy = &ttm_transfered_destroy; | 459 | fbo->destroy = &ttm_transfered_destroy; |
@@ -661,13 +666,11 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, | |||
661 | */ | 666 | */ |
662 | 667 | ||
663 | set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); | 668 | set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); |
664 | |||
665 | /* ttm_buffer_object_transfer accesses bo->sync_obj */ | ||
666 | ret = ttm_buffer_object_transfer(bo, &ghost_obj); | ||
667 | spin_unlock(&bdev->fence_lock); | 669 | spin_unlock(&bdev->fence_lock); |
668 | if (tmp_obj) | 670 | if (tmp_obj) |
669 | driver->sync_obj_unref(&tmp_obj); | 671 | driver->sync_obj_unref(&tmp_obj); |
670 | 672 | ||
673 | ret = ttm_buffer_object_transfer(bo, &ghost_obj); | ||
671 | if (ret) | 674 | if (ret) |
672 | return ret; | 675 | return ret; |
673 | 676 | ||
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 4dfa605e2d14..34e25471aeaa 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -306,6 +306,9 @@ | |||
306 | #define USB_VENDOR_ID_EZKEY 0x0518 | 306 | #define USB_VENDOR_ID_EZKEY 0x0518 |
307 | #define USB_DEVICE_ID_BTC_8193 0x0002 | 307 | #define USB_DEVICE_ID_BTC_8193 0x0002 |
308 | 308 | ||
309 | #define USB_VENDOR_ID_FORMOSA 0x147a | ||
310 | #define USB_DEVICE_ID_FORMOSA_IR_RECEIVER 0xe03e | ||
311 | |||
309 | #define USB_VENDOR_ID_FREESCALE 0x15A2 | 312 | #define USB_VENDOR_ID_FREESCALE 0x15A2 |
310 | #define USB_DEVICE_ID_FREESCALE_MX28 0x004F | 313 | #define USB_DEVICE_ID_FREESCALE_MX28 0x004F |
311 | 314 | ||
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 12e4fdc810bf..e766b5614ef5 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c | |||
@@ -540,13 +540,24 @@ static int i2c_hid_output_raw_report(struct hid_device *hid, __u8 *buf, | |||
540 | { | 540 | { |
541 | struct i2c_client *client = hid->driver_data; | 541 | struct i2c_client *client = hid->driver_data; |
542 | int report_id = buf[0]; | 542 | int report_id = buf[0]; |
543 | int ret; | ||
543 | 544 | ||
544 | if (report_type == HID_INPUT_REPORT) | 545 | if (report_type == HID_INPUT_REPORT) |
545 | return -EINVAL; | 546 | return -EINVAL; |
546 | 547 | ||
547 | return i2c_hid_set_report(client, | 548 | if (report_id) { |
549 | buf++; | ||
550 | count--; | ||
551 | } | ||
552 | |||
553 | ret = i2c_hid_set_report(client, | ||
548 | report_type == HID_FEATURE_REPORT ? 0x03 : 0x02, | 554 | report_type == HID_FEATURE_REPORT ? 0x03 : 0x02, |
549 | report_id, buf, count); | 555 | report_id, buf, count); |
556 | |||
557 | if (report_id && ret >= 0) | ||
558 | ret++; /* add report_id to the number of transfered bytes */ | ||
559 | |||
560 | return ret; | ||
550 | } | 561 | } |
551 | 562 | ||
552 | static int i2c_hid_parse(struct hid_device *hid) | 563 | static int i2c_hid_parse(struct hid_device *hid) |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index ac9e35228254..e0e6abf1cd3b 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -70,6 +70,7 @@ static const struct hid_blacklist { | |||
70 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, | 70 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, |
71 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, | 71 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, |
72 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, | 72 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, |
73 | { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, | ||
73 | { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, | 74 | { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, |
74 | { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, | 75 | { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, |
75 | { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS }, | 76 | { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS }, |
diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c index 4850d03870c2..35275099cafd 100644 --- a/drivers/infiniband/hw/qib/qib_qp.c +++ b/drivers/infiniband/hw/qib/qib_qp.c | |||
@@ -263,20 +263,15 @@ static void remove_qp(struct qib_ibdev *dev, struct qib_qp *qp) | |||
263 | struct qib_qp __rcu **qpp; | 263 | struct qib_qp __rcu **qpp; |
264 | 264 | ||
265 | qpp = &dev->qp_table[n]; | 265 | qpp = &dev->qp_table[n]; |
266 | q = rcu_dereference_protected(*qpp, | 266 | for (; (q = rcu_dereference_protected(*qpp, |
267 | lockdep_is_held(&dev->qpt_lock)); | 267 | lockdep_is_held(&dev->qpt_lock))) != NULL; |
268 | for (; q; qpp = &q->next) { | 268 | qpp = &q->next) |
269 | if (q == qp) { | 269 | if (q == qp) { |
270 | atomic_dec(&qp->refcount); | 270 | atomic_dec(&qp->refcount); |
271 | *qpp = qp->next; | 271 | *qpp = qp->next; |
272 | rcu_assign_pointer(qp->next, NULL); | 272 | rcu_assign_pointer(qp->next, NULL); |
273 | q = rcu_dereference_protected(*qpp, | ||
274 | lockdep_is_held(&dev->qpt_lock)); | ||
275 | break; | 273 | break; |
276 | } | 274 | } |
277 | q = rcu_dereference_protected(*qpp, | ||
278 | lockdep_is_held(&dev->qpt_lock)); | ||
279 | } | ||
280 | } | 275 | } |
281 | 276 | ||
282 | spin_unlock_irqrestore(&dev->qpt_lock, flags); | 277 | spin_unlock_irqrestore(&dev->qpt_lock, flags); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 03103d2bd641..67b0c1d23678 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c | |||
@@ -741,6 +741,9 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_ | |||
741 | 741 | ||
742 | tx_req->mapping = addr; | 742 | tx_req->mapping = addr; |
743 | 743 | ||
744 | skb_orphan(skb); | ||
745 | skb_dst_drop(skb); | ||
746 | |||
744 | rc = post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1), | 747 | rc = post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1), |
745 | addr, skb->len); | 748 | addr, skb->len); |
746 | if (unlikely(rc)) { | 749 | if (unlikely(rc)) { |
@@ -752,9 +755,6 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_ | |||
752 | dev->trans_start = jiffies; | 755 | dev->trans_start = jiffies; |
753 | ++tx->tx_head; | 756 | ++tx->tx_head; |
754 | 757 | ||
755 | skb_orphan(skb); | ||
756 | skb_dst_drop(skb); | ||
757 | |||
758 | if (++priv->tx_outstanding == ipoib_sendq_size) { | 758 | if (++priv->tx_outstanding == ipoib_sendq_size) { |
759 | ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n", | 759 | ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n", |
760 | tx->qp->qp_num); | 760 | tx->qp->qp_num); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index a1bca70e20aa..2cfa76f5d99e 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -600,6 +600,9 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, | |||
600 | netif_stop_queue(dev); | 600 | netif_stop_queue(dev); |
601 | } | 601 | } |
602 | 602 | ||
603 | skb_orphan(skb); | ||
604 | skb_dst_drop(skb); | ||
605 | |||
603 | rc = post_send(priv, priv->tx_head & (ipoib_sendq_size - 1), | 606 | rc = post_send(priv, priv->tx_head & (ipoib_sendq_size - 1), |
604 | address->ah, qpn, tx_req, phead, hlen); | 607 | address->ah, qpn, tx_req, phead, hlen); |
605 | if (unlikely(rc)) { | 608 | if (unlikely(rc)) { |
@@ -615,9 +618,6 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, | |||
615 | 618 | ||
616 | address->last_send = priv->tx_head; | 619 | address->last_send = priv->tx_head; |
617 | ++priv->tx_head; | 620 | ++priv->tx_head; |
618 | |||
619 | skb_orphan(skb); | ||
620 | skb_dst_drop(skb); | ||
621 | } | 621 | } |
622 | 622 | ||
623 | if (unlikely(priv->tx_outstanding > MAX_SEND_CQE)) | 623 | if (unlikely(priv->tx_outstanding > MAX_SEND_CQE)) |
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 69d9a395d54c..644d72468423 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -353,6 +353,25 @@ void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq) | |||
353 | irq_set_chained_handler(irq, gic_handle_cascade_irq); | 353 | irq_set_chained_handler(irq, gic_handle_cascade_irq); |
354 | } | 354 | } |
355 | 355 | ||
356 | static u8 gic_get_cpumask(struct gic_chip_data *gic) | ||
357 | { | ||
358 | void __iomem *base = gic_data_dist_base(gic); | ||
359 | u32 mask, i; | ||
360 | |||
361 | for (i = mask = 0; i < 32; i += 4) { | ||
362 | mask = readl_relaxed(base + GIC_DIST_TARGET + i); | ||
363 | mask |= mask >> 16; | ||
364 | mask |= mask >> 8; | ||
365 | if (mask) | ||
366 | break; | ||
367 | } | ||
368 | |||
369 | if (!mask) | ||
370 | pr_crit("GIC CPU mask not found - kernel will fail to boot.\n"); | ||
371 | |||
372 | return mask; | ||
373 | } | ||
374 | |||
356 | static void __init gic_dist_init(struct gic_chip_data *gic) | 375 | static void __init gic_dist_init(struct gic_chip_data *gic) |
357 | { | 376 | { |
358 | unsigned int i; | 377 | unsigned int i; |
@@ -371,7 +390,9 @@ static void __init gic_dist_init(struct gic_chip_data *gic) | |||
371 | /* | 390 | /* |
372 | * Set all global interrupts to this CPU only. | 391 | * Set all global interrupts to this CPU only. |
373 | */ | 392 | */ |
374 | cpumask = readl_relaxed(base + GIC_DIST_TARGET + 0); | 393 | cpumask = gic_get_cpumask(gic); |
394 | cpumask |= cpumask << 8; | ||
395 | cpumask |= cpumask << 16; | ||
375 | for (i = 32; i < gic_irqs; i += 4) | 396 | for (i = 32; i < gic_irqs; i += 4) |
376 | writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); | 397 | writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); |
377 | 398 | ||
@@ -402,7 +423,7 @@ static void __cpuinit gic_cpu_init(struct gic_chip_data *gic) | |||
402 | * Get what the GIC says our CPU mask is. | 423 | * Get what the GIC says our CPU mask is. |
403 | */ | 424 | */ |
404 | BUG_ON(cpu >= NR_GIC_CPU_IF); | 425 | BUG_ON(cpu >= NR_GIC_CPU_IF); |
405 | cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0); | 426 | cpu_mask = gic_get_cpumask(gic); |
406 | gic_cpu_map[cpu] = cpu_mask; | 427 | gic_cpu_map[cpu] = cpu_mask; |
407 | 428 | ||
408 | /* | 429 | /* |
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 675ae5274016..5409607d4875 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -2746,19 +2746,9 @@ static int thin_iterate_devices(struct dm_target *ti, | |||
2746 | return 0; | 2746 | return 0; |
2747 | } | 2747 | } |
2748 | 2748 | ||
2749 | /* | ||
2750 | * A thin device always inherits its queue limits from its pool. | ||
2751 | */ | ||
2752 | static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits) | ||
2753 | { | ||
2754 | struct thin_c *tc = ti->private; | ||
2755 | |||
2756 | *limits = bdev_get_queue(tc->pool_dev->bdev)->limits; | ||
2757 | } | ||
2758 | |||
2759 | static struct target_type thin_target = { | 2749 | static struct target_type thin_target = { |
2760 | .name = "thin", | 2750 | .name = "thin", |
2761 | .version = {1, 6, 0}, | 2751 | .version = {1, 7, 0}, |
2762 | .module = THIS_MODULE, | 2752 | .module = THIS_MODULE, |
2763 | .ctr = thin_ctr, | 2753 | .ctr = thin_ctr, |
2764 | .dtr = thin_dtr, | 2754 | .dtr = thin_dtr, |
@@ -2767,7 +2757,6 @@ static struct target_type thin_target = { | |||
2767 | .postsuspend = thin_postsuspend, | 2757 | .postsuspend = thin_postsuspend, |
2768 | .status = thin_status, | 2758 | .status = thin_status, |
2769 | .iterate_devices = thin_iterate_devices, | 2759 | .iterate_devices = thin_iterate_devices, |
2770 | .io_hints = thin_io_hints, | ||
2771 | }; | 2760 | }; |
2772 | 2761 | ||
2773 | /*----------------------------------------------------------------*/ | 2762 | /*----------------------------------------------------------------*/ |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index c72e4d5a9617..314a0e2faf79 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1188,6 +1188,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci, | |||
1188 | { | 1188 | { |
1189 | struct dm_target *ti; | 1189 | struct dm_target *ti; |
1190 | sector_t len; | 1190 | sector_t len; |
1191 | unsigned num_requests; | ||
1191 | 1192 | ||
1192 | do { | 1193 | do { |
1193 | ti = dm_table_find_target(ci->map, ci->sector); | 1194 | ti = dm_table_find_target(ci->map, ci->sector); |
@@ -1200,7 +1201,8 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci, | |||
1200 | * reconfiguration might also have changed that since the | 1201 | * reconfiguration might also have changed that since the |
1201 | * check was performed. | 1202 | * check was performed. |
1202 | */ | 1203 | */ |
1203 | if (!get_num_requests || !get_num_requests(ti)) | 1204 | num_requests = get_num_requests ? get_num_requests(ti) : 0; |
1205 | if (!num_requests) | ||
1204 | return -EOPNOTSUPP; | 1206 | return -EOPNOTSUPP; |
1205 | 1207 | ||
1206 | if (is_split_required && !is_split_required(ti)) | 1208 | if (is_split_required && !is_split_required(ti)) |
@@ -1208,7 +1210,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci, | |||
1208 | else | 1210 | else |
1209 | len = min(ci->sector_count, max_io_len(ci->sector, ti)); | 1211 | len = min(ci->sector_count, max_io_len(ci->sector, ti)); |
1210 | 1212 | ||
1211 | __issue_target_requests(ci, ti, ti->num_discard_requests, len); | 1213 | __issue_target_requests(ci, ti, num_requests, len); |
1212 | 1214 | ||
1213 | ci->sector += len; | 1215 | ci->sector += len; |
1214 | } while (ci->sector_count -= len); | 1216 | } while (ci->sector_count -= len); |
diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c index e10e525f33e5..296941a9ae25 100644 --- a/drivers/media/radio/radio-keene.c +++ b/drivers/media/radio/radio-keene.c | |||
@@ -374,6 +374,7 @@ static int usb_keene_probe(struct usb_interface *intf, | |||
374 | radio->vdev.ioctl_ops = &usb_keene_ioctl_ops; | 374 | radio->vdev.ioctl_ops = &usb_keene_ioctl_ops; |
375 | radio->vdev.lock = &radio->lock; | 375 | radio->vdev.lock = &radio->lock; |
376 | radio->vdev.release = video_device_release_empty; | 376 | radio->vdev.release = video_device_release_empty; |
377 | radio->vdev.vfl_dir = VFL_DIR_TX; | ||
377 | 378 | ||
378 | radio->usbdev = interface_to_usbdev(intf); | 379 | radio->usbdev = interface_to_usbdev(intf); |
379 | radio->intf = intf; | 380 | radio->intf = intf; |
diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c index a082e400ed0f..1507c9d508d7 100644 --- a/drivers/media/radio/radio-si4713.c +++ b/drivers/media/radio/radio-si4713.c | |||
@@ -250,6 +250,7 @@ static struct video_device radio_si4713_vdev_template = { | |||
250 | .name = "radio-si4713", | 250 | .name = "radio-si4713", |
251 | .release = video_device_release, | 251 | .release = video_device_release, |
252 | .ioctl_ops = &radio_si4713_ioctl_ops, | 252 | .ioctl_ops = &radio_si4713_ioctl_ops, |
253 | .vfl_dir = VFL_DIR_TX, | ||
253 | }; | 254 | }; |
254 | 255 | ||
255 | /* Platform driver interface */ | 256 | /* Platform driver interface */ |
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c index c48be195bbad..cabbe3adf435 100644 --- a/drivers/media/radio/radio-wl1273.c +++ b/drivers/media/radio/radio-wl1273.c | |||
@@ -1971,6 +1971,7 @@ static struct video_device wl1273_viddev_template = { | |||
1971 | .ioctl_ops = &wl1273_ioctl_ops, | 1971 | .ioctl_ops = &wl1273_ioctl_ops, |
1972 | .name = WL1273_FM_DRIVER_NAME, | 1972 | .name = WL1273_FM_DRIVER_NAME, |
1973 | .release = wl1273_vdev_release, | 1973 | .release = wl1273_vdev_release, |
1974 | .vfl_dir = VFL_DIR_TX, | ||
1974 | }; | 1975 | }; |
1975 | 1976 | ||
1976 | static int wl1273_fm_radio_remove(struct platform_device *pdev) | 1977 | static int wl1273_fm_radio_remove(struct platform_device *pdev) |
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c index 048de4536036..0a8ee8fab924 100644 --- a/drivers/media/radio/wl128x/fmdrv_v4l2.c +++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c | |||
@@ -518,6 +518,16 @@ static struct video_device fm_viddev_template = { | |||
518 | .ioctl_ops = &fm_drv_ioctl_ops, | 518 | .ioctl_ops = &fm_drv_ioctl_ops, |
519 | .name = FM_DRV_NAME, | 519 | .name = FM_DRV_NAME, |
520 | .release = video_device_release, | 520 | .release = video_device_release, |
521 | /* | ||
522 | * To ensure both the tuner and modulator ioctls are accessible we | ||
523 | * set the vfl_dir to M2M to indicate this. | ||
524 | * | ||
525 | * It is not really a mem2mem device of course, but it can both receive | ||
526 | * and transmit using the same radio device. It's the only radio driver | ||
527 | * that does this and it should really be split in two radio devices, | ||
528 | * but that would affect applications using this driver. | ||
529 | */ | ||
530 | .vfl_dir = VFL_DIR_M2M, | ||
521 | }; | 531 | }; |
522 | 532 | ||
523 | int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr) | 533 | int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr) |
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig index 27f80cd8aef3..46dcb54c32ec 100644 --- a/drivers/mtd/devices/Kconfig +++ b/drivers/mtd/devices/Kconfig | |||
@@ -272,6 +272,7 @@ config MTD_DOCG3 | |||
272 | tristate "M-Systems Disk-On-Chip G3" | 272 | tristate "M-Systems Disk-On-Chip G3" |
273 | select BCH | 273 | select BCH |
274 | select BCH_CONST_PARAMS | 274 | select BCH_CONST_PARAMS |
275 | select BITREVERSE | ||
275 | ---help--- | 276 | ---help--- |
276 | This provides an MTD device driver for the M-Systems DiskOnChip | 277 | This provides an MTD device driver for the M-Systems DiskOnChip |
277 | G3 devices. | 278 | G3 devices. |
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index 67cc73c18ddd..7901d72c9242 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -170,7 +170,7 @@ static int of_flash_probe(struct platform_device *dev) | |||
170 | resource_size_t res_size; | 170 | resource_size_t res_size; |
171 | struct mtd_part_parser_data ppdata; | 171 | struct mtd_part_parser_data ppdata; |
172 | bool map_indirect; | 172 | bool map_indirect; |
173 | const char *mtd_name; | 173 | const char *mtd_name = NULL; |
174 | 174 | ||
175 | match = of_match_device(of_flash_match, &dev->dev); | 175 | match = of_match_device(of_flash_match, &dev->dev); |
176 | if (!match) | 176 | if (!match) |
diff --git a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c index 86c9a79b89b3..595de4012e71 100644 --- a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c | |||
@@ -17,8 +17,8 @@ | |||
17 | #include "bcm47xxnflash.h" | 17 | #include "bcm47xxnflash.h" |
18 | 18 | ||
19 | /* Broadcom uses 1'000'000 but it seems to be too many. Tests on WNDR4500 has | 19 | /* Broadcom uses 1'000'000 but it seems to be too many. Tests on WNDR4500 has |
20 | * shown 164 retries as maxiumum. */ | 20 | * shown ~1000 retries as maxiumum. */ |
21 | #define NFLASH_READY_RETRIES 1000 | 21 | #define NFLASH_READY_RETRIES 10000 |
22 | 22 | ||
23 | #define NFLASH_SECTOR_SIZE 512 | 23 | #define NFLASH_SECTOR_SIZE 512 |
24 | 24 | ||
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 3502606f6480..feae55c7b880 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c | |||
@@ -523,7 +523,7 @@ static struct nand_ecclayout hwecc4_2048 __initconst = { | |||
523 | static const struct of_device_id davinci_nand_of_match[] = { | 523 | static const struct of_device_id davinci_nand_of_match[] = { |
524 | {.compatible = "ti,davinci-nand", }, | 524 | {.compatible = "ti,davinci-nand", }, |
525 | {}, | 525 | {}, |
526 | } | 526 | }; |
527 | MODULE_DEVICE_TABLE(of, davinci_nand_of_match); | 527 | MODULE_DEVICE_TABLE(of, davinci_nand_of_match); |
528 | 528 | ||
529 | static struct davinci_nand_pdata | 529 | static struct davinci_nand_pdata |
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 8323ac991ad1..3766682a0289 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -2857,8 +2857,11 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, | |||
2857 | int i; | 2857 | int i; |
2858 | int val; | 2858 | int val; |
2859 | 2859 | ||
2860 | /* ONFI need to be probed in 8 bits mode */ | 2860 | /* ONFI need to be probed in 8 bits mode, and 16 bits should be selected with NAND_BUSWIDTH_AUTO */ |
2861 | WARN_ON(chip->options & NAND_BUSWIDTH_16); | 2861 | if (chip->options & NAND_BUSWIDTH_16) { |
2862 | pr_err("Trying ONFI probe in 16 bits mode, aborting !\n"); | ||
2863 | return 0; | ||
2864 | } | ||
2862 | /* Try ONFI for unknown chip or LP */ | 2865 | /* Try ONFI for unknown chip or LP */ |
2863 | chip->cmdfunc(mtd, NAND_CMD_READID, 0x20, -1); | 2866 | chip->cmdfunc(mtd, NAND_CMD_READID, 0x20, -1); |
2864 | if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' || | 2867 | if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' || |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 1877ed7ca086..1c9e09fbdff8 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1053,6 +1053,7 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1053 | pr_info("%s: Setting primary slave to None.\n", | 1053 | pr_info("%s: Setting primary slave to None.\n", |
1054 | bond->dev->name); | 1054 | bond->dev->name); |
1055 | bond->primary_slave = NULL; | 1055 | bond->primary_slave = NULL; |
1056 | memset(bond->params.primary, 0, sizeof(bond->params.primary)); | ||
1056 | bond_select_active_slave(bond); | 1057 | bond_select_active_slave(bond); |
1057 | goto out; | 1058 | goto out; |
1058 | } | 1059 | } |
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c index 58607f196c9e..2282b1ae9765 100644 --- a/drivers/net/can/c_can/c_can.c +++ b/drivers/net/can/c_can/c_can.c | |||
@@ -488,8 +488,12 @@ static void c_can_setup_receive_object(struct net_device *dev, int iface, | |||
488 | 488 | ||
489 | priv->write_reg(priv, C_CAN_IFACE(MASK1_REG, iface), | 489 | priv->write_reg(priv, C_CAN_IFACE(MASK1_REG, iface), |
490 | IFX_WRITE_LOW_16BIT(mask)); | 490 | IFX_WRITE_LOW_16BIT(mask)); |
491 | |||
492 | /* According to C_CAN documentation, the reserved bit | ||
493 | * in IFx_MASK2 register is fixed 1 | ||
494 | */ | ||
491 | priv->write_reg(priv, C_CAN_IFACE(MASK2_REG, iface), | 495 | priv->write_reg(priv, C_CAN_IFACE(MASK2_REG, iface), |
492 | IFX_WRITE_HIGH_16BIT(mask)); | 496 | IFX_WRITE_HIGH_16BIT(mask) | BIT(13)); |
493 | 497 | ||
494 | priv->write_reg(priv, C_CAN_IFACE(ARB1_REG, iface), | 498 | priv->write_reg(priv, C_CAN_IFACE(ARB1_REG, iface), |
495 | IFX_WRITE_LOW_16BIT(id)); | 499 | IFX_WRITE_LOW_16BIT(id)); |
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 4eba17b83ba8..f1b3df167ff2 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -36,13 +36,13 @@ | |||
36 | 36 | ||
37 | #define DRV_VER "4.4.161.0u" | 37 | #define DRV_VER "4.4.161.0u" |
38 | #define DRV_NAME "be2net" | 38 | #define DRV_NAME "be2net" |
39 | #define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC" | 39 | #define BE_NAME "Emulex BladeEngine2" |
40 | #define BE3_NAME "ServerEngines BladeEngine3 10Gbps NIC" | 40 | #define BE3_NAME "Emulex BladeEngine3" |
41 | #define OC_NAME "Emulex OneConnect 10Gbps NIC" | 41 | #define OC_NAME "Emulex OneConnect" |
42 | #define OC_NAME_BE OC_NAME "(be3)" | 42 | #define OC_NAME_BE OC_NAME "(be3)" |
43 | #define OC_NAME_LANCER OC_NAME "(Lancer)" | 43 | #define OC_NAME_LANCER OC_NAME "(Lancer)" |
44 | #define OC_NAME_SH OC_NAME "(Skyhawk)" | 44 | #define OC_NAME_SH OC_NAME "(Skyhawk)" |
45 | #define DRV_DESC "ServerEngines BladeEngine 10Gbps NIC Driver" | 45 | #define DRV_DESC "Emulex OneConnect 10Gbps NIC Driver" |
46 | 46 | ||
47 | #define BE_VENDOR_ID 0x19a2 | 47 | #define BE_VENDOR_ID 0x19a2 |
48 | #define EMULEX_VENDOR_ID 0x10df | 48 | #define EMULEX_VENDOR_ID 0x10df |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 5c995700e534..4d6f3c54427a 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -25,7 +25,7 @@ | |||
25 | MODULE_VERSION(DRV_VER); | 25 | MODULE_VERSION(DRV_VER); |
26 | MODULE_DEVICE_TABLE(pci, be_dev_ids); | 26 | MODULE_DEVICE_TABLE(pci, be_dev_ids); |
27 | MODULE_DESCRIPTION(DRV_DESC " " DRV_VER); | 27 | MODULE_DESCRIPTION(DRV_DESC " " DRV_VER); |
28 | MODULE_AUTHOR("ServerEngines Corporation"); | 28 | MODULE_AUTHOR("Emulex Corporation"); |
29 | MODULE_LICENSE("GPL"); | 29 | MODULE_LICENSE("GPL"); |
30 | 30 | ||
31 | static unsigned int num_vfs; | 31 | static unsigned int num_vfs; |
diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h index 02a12b69555f..4dab6fc265a2 100644 --- a/drivers/net/ethernet/intel/e1000e/defines.h +++ b/drivers/net/ethernet/intel/e1000e/defines.h | |||
@@ -232,6 +232,7 @@ | |||
232 | #define E1000_CTRL_FRCDPX 0x00001000 /* Force Duplex */ | 232 | #define E1000_CTRL_FRCDPX 0x00001000 /* Force Duplex */ |
233 | #define E1000_CTRL_LANPHYPC_OVERRIDE 0x00010000 /* SW control of LANPHYPC */ | 233 | #define E1000_CTRL_LANPHYPC_OVERRIDE 0x00010000 /* SW control of LANPHYPC */ |
234 | #define E1000_CTRL_LANPHYPC_VALUE 0x00020000 /* SW value of LANPHYPC */ | 234 | #define E1000_CTRL_LANPHYPC_VALUE 0x00020000 /* SW value of LANPHYPC */ |
235 | #define E1000_CTRL_MEHE 0x00080000 /* Memory Error Handling Enable */ | ||
235 | #define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */ | 236 | #define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */ |
236 | #define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */ | 237 | #define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */ |
237 | #define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */ | 238 | #define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */ |
@@ -389,6 +390,12 @@ | |||
389 | 390 | ||
390 | #define E1000_PBS_16K E1000_PBA_16K | 391 | #define E1000_PBS_16K E1000_PBA_16K |
391 | 392 | ||
393 | /* Uncorrectable/correctable ECC Error counts and enable bits */ | ||
394 | #define E1000_PBECCSTS_CORR_ERR_CNT_MASK 0x000000FF | ||
395 | #define E1000_PBECCSTS_UNCORR_ERR_CNT_MASK 0x0000FF00 | ||
396 | #define E1000_PBECCSTS_UNCORR_ERR_CNT_SHIFT 8 | ||
397 | #define E1000_PBECCSTS_ECC_ENABLE 0x00010000 | ||
398 | |||
392 | #define IFS_MAX 80 | 399 | #define IFS_MAX 80 |
393 | #define IFS_MIN 40 | 400 | #define IFS_MIN 40 |
394 | #define IFS_RATIO 4 | 401 | #define IFS_RATIO 4 |
@@ -408,6 +415,7 @@ | |||
408 | #define E1000_ICR_RXSEQ 0x00000008 /* Rx sequence error */ | 415 | #define E1000_ICR_RXSEQ 0x00000008 /* Rx sequence error */ |
409 | #define E1000_ICR_RXDMT0 0x00000010 /* Rx desc min. threshold (0) */ | 416 | #define E1000_ICR_RXDMT0 0x00000010 /* Rx desc min. threshold (0) */ |
410 | #define E1000_ICR_RXT0 0x00000080 /* Rx timer intr (ring 0) */ | 417 | #define E1000_ICR_RXT0 0x00000080 /* Rx timer intr (ring 0) */ |
418 | #define E1000_ICR_ECCER 0x00400000 /* Uncorrectable ECC Error */ | ||
411 | #define E1000_ICR_INT_ASSERTED 0x80000000 /* If this bit asserted, the driver should claim the interrupt */ | 419 | #define E1000_ICR_INT_ASSERTED 0x80000000 /* If this bit asserted, the driver should claim the interrupt */ |
412 | #define E1000_ICR_RXQ0 0x00100000 /* Rx Queue 0 Interrupt */ | 420 | #define E1000_ICR_RXQ0 0x00100000 /* Rx Queue 0 Interrupt */ |
413 | #define E1000_ICR_RXQ1 0x00200000 /* Rx Queue 1 Interrupt */ | 421 | #define E1000_ICR_RXQ1 0x00200000 /* Rx Queue 1 Interrupt */ |
@@ -443,6 +451,7 @@ | |||
443 | #define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* Rx sequence error */ | 451 | #define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* Rx sequence error */ |
444 | #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* Rx desc min. threshold */ | 452 | #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* Rx desc min. threshold */ |
445 | #define E1000_IMS_RXT0 E1000_ICR_RXT0 /* Rx timer intr */ | 453 | #define E1000_IMS_RXT0 E1000_ICR_RXT0 /* Rx timer intr */ |
454 | #define E1000_IMS_ECCER E1000_ICR_ECCER /* Uncorrectable ECC Error */ | ||
446 | #define E1000_IMS_RXQ0 E1000_ICR_RXQ0 /* Rx Queue 0 Interrupt */ | 455 | #define E1000_IMS_RXQ0 E1000_ICR_RXQ0 /* Rx Queue 0 Interrupt */ |
447 | #define E1000_IMS_RXQ1 E1000_ICR_RXQ1 /* Rx Queue 1 Interrupt */ | 456 | #define E1000_IMS_RXQ1 E1000_ICR_RXQ1 /* Rx Queue 1 Interrupt */ |
448 | #define E1000_IMS_TXQ0 E1000_ICR_TXQ0 /* Tx Queue 0 Interrupt */ | 457 | #define E1000_IMS_TXQ0 E1000_ICR_TXQ0 /* Tx Queue 0 Interrupt */ |
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h index 6782a2eea1bc..7e95f221d60b 100644 --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h | |||
@@ -309,6 +309,8 @@ struct e1000_adapter { | |||
309 | 309 | ||
310 | struct napi_struct napi; | 310 | struct napi_struct napi; |
311 | 311 | ||
312 | unsigned int uncorr_errors; /* uncorrectable ECC errors */ | ||
313 | unsigned int corr_errors; /* correctable ECC errors */ | ||
312 | unsigned int restart_queue; | 314 | unsigned int restart_queue; |
313 | u32 txd_cmd; | 315 | u32 txd_cmd; |
314 | 316 | ||
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index f95bc6ee1c22..fd4772a2691c 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c | |||
@@ -108,6 +108,8 @@ static const struct e1000_stats e1000_gstrings_stats[] = { | |||
108 | E1000_STAT("dropped_smbus", stats.mgpdc), | 108 | E1000_STAT("dropped_smbus", stats.mgpdc), |
109 | E1000_STAT("rx_dma_failed", rx_dma_failed), | 109 | E1000_STAT("rx_dma_failed", rx_dma_failed), |
110 | E1000_STAT("tx_dma_failed", tx_dma_failed), | 110 | E1000_STAT("tx_dma_failed", tx_dma_failed), |
111 | E1000_STAT("uncorr_ecc_errors", uncorr_errors), | ||
112 | E1000_STAT("corr_ecc_errors", corr_errors), | ||
111 | }; | 113 | }; |
112 | 114 | ||
113 | #define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats) | 115 | #define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats) |
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h index cf217777586c..b88676ff3d86 100644 --- a/drivers/net/ethernet/intel/e1000e/hw.h +++ b/drivers/net/ethernet/intel/e1000e/hw.h | |||
@@ -77,6 +77,7 @@ enum e1e_registers { | |||
77 | #define E1000_POEMB E1000_PHY_CTRL /* PHY OEM Bits */ | 77 | #define E1000_POEMB E1000_PHY_CTRL /* PHY OEM Bits */ |
78 | E1000_PBA = 0x01000, /* Packet Buffer Allocation - RW */ | 78 | E1000_PBA = 0x01000, /* Packet Buffer Allocation - RW */ |
79 | E1000_PBS = 0x01008, /* Packet Buffer Size */ | 79 | E1000_PBS = 0x01008, /* Packet Buffer Size */ |
80 | E1000_PBECCSTS = 0x0100C, /* Packet Buffer ECC Status - RW */ | ||
80 | E1000_EEMNGCTL = 0x01010, /* MNG EEprom Control */ | 81 | E1000_EEMNGCTL = 0x01010, /* MNG EEprom Control */ |
81 | E1000_EEWR = 0x0102C, /* EEPROM Write Register - RW */ | 82 | E1000_EEWR = 0x0102C, /* EEPROM Write Register - RW */ |
82 | E1000_FLOP = 0x0103C, /* FLASH Opcode Register */ | 83 | E1000_FLOP = 0x0103C, /* FLASH Opcode Register */ |
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 976336547607..24d9f61956f0 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c | |||
@@ -3624,6 +3624,17 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw) | |||
3624 | if (hw->mac.type == e1000_ich8lan) | 3624 | if (hw->mac.type == e1000_ich8lan) |
3625 | reg |= (E1000_RFCTL_IPV6_EX_DIS | E1000_RFCTL_NEW_IPV6_EXT_DIS); | 3625 | reg |= (E1000_RFCTL_IPV6_EX_DIS | E1000_RFCTL_NEW_IPV6_EXT_DIS); |
3626 | ew32(RFCTL, reg); | 3626 | ew32(RFCTL, reg); |
3627 | |||
3628 | /* Enable ECC on Lynxpoint */ | ||
3629 | if (hw->mac.type == e1000_pch_lpt) { | ||
3630 | reg = er32(PBECCSTS); | ||
3631 | reg |= E1000_PBECCSTS_ECC_ENABLE; | ||
3632 | ew32(PBECCSTS, reg); | ||
3633 | |||
3634 | reg = er32(CTRL); | ||
3635 | reg |= E1000_CTRL_MEHE; | ||
3636 | ew32(CTRL, reg); | ||
3637 | } | ||
3627 | } | 3638 | } |
3628 | 3639 | ||
3629 | /** | 3640 | /** |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index fbf75fdca994..643c883dd795 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -1678,6 +1678,23 @@ static irqreturn_t e1000_intr_msi(int irq, void *data) | |||
1678 | mod_timer(&adapter->watchdog_timer, jiffies + 1); | 1678 | mod_timer(&adapter->watchdog_timer, jiffies + 1); |
1679 | } | 1679 | } |
1680 | 1680 | ||
1681 | /* Reset on uncorrectable ECC error */ | ||
1682 | if ((icr & E1000_ICR_ECCER) && (hw->mac.type == e1000_pch_lpt)) { | ||
1683 | u32 pbeccsts = er32(PBECCSTS); | ||
1684 | |||
1685 | adapter->corr_errors += | ||
1686 | pbeccsts & E1000_PBECCSTS_CORR_ERR_CNT_MASK; | ||
1687 | adapter->uncorr_errors += | ||
1688 | (pbeccsts & E1000_PBECCSTS_UNCORR_ERR_CNT_MASK) >> | ||
1689 | E1000_PBECCSTS_UNCORR_ERR_CNT_SHIFT; | ||
1690 | |||
1691 | /* Do the reset outside of interrupt context */ | ||
1692 | schedule_work(&adapter->reset_task); | ||
1693 | |||
1694 | /* return immediately since reset is imminent */ | ||
1695 | return IRQ_HANDLED; | ||
1696 | } | ||
1697 | |||
1681 | if (napi_schedule_prep(&adapter->napi)) { | 1698 | if (napi_schedule_prep(&adapter->napi)) { |
1682 | adapter->total_tx_bytes = 0; | 1699 | adapter->total_tx_bytes = 0; |
1683 | adapter->total_tx_packets = 0; | 1700 | adapter->total_tx_packets = 0; |
@@ -1741,6 +1758,23 @@ static irqreturn_t e1000_intr(int irq, void *data) | |||
1741 | mod_timer(&adapter->watchdog_timer, jiffies + 1); | 1758 | mod_timer(&adapter->watchdog_timer, jiffies + 1); |
1742 | } | 1759 | } |
1743 | 1760 | ||
1761 | /* Reset on uncorrectable ECC error */ | ||
1762 | if ((icr & E1000_ICR_ECCER) && (hw->mac.type == e1000_pch_lpt)) { | ||
1763 | u32 pbeccsts = er32(PBECCSTS); | ||
1764 | |||
1765 | adapter->corr_errors += | ||
1766 | pbeccsts & E1000_PBECCSTS_CORR_ERR_CNT_MASK; | ||
1767 | adapter->uncorr_errors += | ||
1768 | (pbeccsts & E1000_PBECCSTS_UNCORR_ERR_CNT_MASK) >> | ||
1769 | E1000_PBECCSTS_UNCORR_ERR_CNT_SHIFT; | ||
1770 | |||
1771 | /* Do the reset outside of interrupt context */ | ||
1772 | schedule_work(&adapter->reset_task); | ||
1773 | |||
1774 | /* return immediately since reset is imminent */ | ||
1775 | return IRQ_HANDLED; | ||
1776 | } | ||
1777 | |||
1744 | if (napi_schedule_prep(&adapter->napi)) { | 1778 | if (napi_schedule_prep(&adapter->napi)) { |
1745 | adapter->total_tx_bytes = 0; | 1779 | adapter->total_tx_bytes = 0; |
1746 | adapter->total_tx_packets = 0; | 1780 | adapter->total_tx_packets = 0; |
@@ -2104,6 +2138,8 @@ static void e1000_irq_enable(struct e1000_adapter *adapter) | |||
2104 | if (adapter->msix_entries) { | 2138 | if (adapter->msix_entries) { |
2105 | ew32(EIAC_82574, adapter->eiac_mask & E1000_EIAC_MASK_82574); | 2139 | ew32(EIAC_82574, adapter->eiac_mask & E1000_EIAC_MASK_82574); |
2106 | ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | E1000_IMS_LSC); | 2140 | ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | E1000_IMS_LSC); |
2141 | } else if (hw->mac.type == e1000_pch_lpt) { | ||
2142 | ew32(IMS, IMS_ENABLE_MASK | E1000_IMS_ECCER); | ||
2107 | } else { | 2143 | } else { |
2108 | ew32(IMS, IMS_ENABLE_MASK); | 2144 | ew32(IMS, IMS_ENABLE_MASK); |
2109 | } | 2145 | } |
@@ -4251,6 +4287,16 @@ static void e1000e_update_stats(struct e1000_adapter *adapter) | |||
4251 | adapter->stats.mgptc += er32(MGTPTC); | 4287 | adapter->stats.mgptc += er32(MGTPTC); |
4252 | adapter->stats.mgprc += er32(MGTPRC); | 4288 | adapter->stats.mgprc += er32(MGTPRC); |
4253 | adapter->stats.mgpdc += er32(MGTPDC); | 4289 | adapter->stats.mgpdc += er32(MGTPDC); |
4290 | |||
4291 | /* Correctable ECC Errors */ | ||
4292 | if (hw->mac.type == e1000_pch_lpt) { | ||
4293 | u32 pbeccsts = er32(PBECCSTS); | ||
4294 | adapter->corr_errors += | ||
4295 | pbeccsts & E1000_PBECCSTS_CORR_ERR_CNT_MASK; | ||
4296 | adapter->uncorr_errors += | ||
4297 | (pbeccsts & E1000_PBECCSTS_UNCORR_ERR_CNT_MASK) >> | ||
4298 | E1000_PBECCSTS_UNCORR_ERR_CNT_SHIFT; | ||
4299 | } | ||
4254 | } | 4300 | } |
4255 | 4301 | ||
4256 | /** | 4302 | /** |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index a6542d75374c..5163af314990 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -380,7 +380,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
380 | } | 380 | } |
381 | } | 381 | } |
382 | 382 | ||
383 | if ((dev_cap->flags & | 383 | if ((dev->caps.flags & |
384 | (MLX4_DEV_CAP_FLAG_64B_CQE | MLX4_DEV_CAP_FLAG_64B_EQE)) && | 384 | (MLX4_DEV_CAP_FLAG_64B_CQE | MLX4_DEV_CAP_FLAG_64B_EQE)) && |
385 | mlx4_is_master(dev)) | 385 | mlx4_is_master(dev)) |
386 | dev->caps.function_caps |= MLX4_FUNC_CAP_64B_EQE_CQE; | 386 | dev->caps.function_caps |= MLX4_FUNC_CAP_64B_EQE_CQE; |
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index 7992b3e05d3d..78ace59efd29 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
@@ -1801,7 +1801,7 @@ static void rhine_tx(struct net_device *dev) | |||
1801 | rp->tx_skbuff[entry]->len, | 1801 | rp->tx_skbuff[entry]->len, |
1802 | PCI_DMA_TODEVICE); | 1802 | PCI_DMA_TODEVICE); |
1803 | } | 1803 | } |
1804 | dev_kfree_skb_irq(rp->tx_skbuff[entry]); | 1804 | dev_kfree_skb(rp->tx_skbuff[entry]); |
1805 | rp->tx_skbuff[entry] = NULL; | 1805 | rp->tx_skbuff[entry] = NULL; |
1806 | entry = (++rp->dirty_tx) % TX_RING_SIZE; | 1806 | entry = (++rp->dirty_tx) % TX_RING_SIZE; |
1807 | } | 1807 | } |
@@ -2010,11 +2010,7 @@ static void rhine_slow_event_task(struct work_struct *work) | |||
2010 | if (intr_status & IntrPCIErr) | 2010 | if (intr_status & IntrPCIErr) |
2011 | netif_warn(rp, hw, dev, "PCI error\n"); | 2011 | netif_warn(rp, hw, dev, "PCI error\n"); |
2012 | 2012 | ||
2013 | napi_disable(&rp->napi); | 2013 | iowrite16(RHINE_EVENT & 0xffff, rp->base + IntrEnable); |
2014 | rhine_irq_disable(rp); | ||
2015 | /* Slow and safe. Consider __napi_schedule as a replacement ? */ | ||
2016 | napi_enable(&rp->napi); | ||
2017 | napi_schedule(&rp->napi); | ||
2018 | 2014 | ||
2019 | out_unlock: | 2015 | out_unlock: |
2020 | mutex_unlock(&rp->task_lock); | 2016 | mutex_unlock(&rp->task_lock); |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index cc09b67c23bc..2917a86f4c43 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -298,11 +298,12 @@ static void tun_flow_cleanup(unsigned long data) | |||
298 | } | 298 | } |
299 | 299 | ||
300 | static void tun_flow_update(struct tun_struct *tun, u32 rxhash, | 300 | static void tun_flow_update(struct tun_struct *tun, u32 rxhash, |
301 | u16 queue_index) | 301 | struct tun_file *tfile) |
302 | { | 302 | { |
303 | struct hlist_head *head; | 303 | struct hlist_head *head; |
304 | struct tun_flow_entry *e; | 304 | struct tun_flow_entry *e; |
305 | unsigned long delay = tun->ageing_time; | 305 | unsigned long delay = tun->ageing_time; |
306 | u16 queue_index = tfile->queue_index; | ||
306 | 307 | ||
307 | if (!rxhash) | 308 | if (!rxhash) |
308 | return; | 309 | return; |
@@ -311,7 +312,9 @@ static void tun_flow_update(struct tun_struct *tun, u32 rxhash, | |||
311 | 312 | ||
312 | rcu_read_lock(); | 313 | rcu_read_lock(); |
313 | 314 | ||
314 | if (tun->numqueues == 1) | 315 | /* We may get a very small possibility of OOO during switching, not |
316 | * worth to optimize.*/ | ||
317 | if (tun->numqueues == 1 || tfile->detached) | ||
315 | goto unlock; | 318 | goto unlock; |
316 | 319 | ||
317 | e = tun_flow_find(head, rxhash); | 320 | e = tun_flow_find(head, rxhash); |
@@ -411,21 +414,21 @@ static void __tun_detach(struct tun_file *tfile, bool clean) | |||
411 | 414 | ||
412 | tun = rtnl_dereference(tfile->tun); | 415 | tun = rtnl_dereference(tfile->tun); |
413 | 416 | ||
414 | if (tun) { | 417 | if (tun && !tfile->detached) { |
415 | u16 index = tfile->queue_index; | 418 | u16 index = tfile->queue_index; |
416 | BUG_ON(index >= tun->numqueues); | 419 | BUG_ON(index >= tun->numqueues); |
417 | dev = tun->dev; | 420 | dev = tun->dev; |
418 | 421 | ||
419 | rcu_assign_pointer(tun->tfiles[index], | 422 | rcu_assign_pointer(tun->tfiles[index], |
420 | tun->tfiles[tun->numqueues - 1]); | 423 | tun->tfiles[tun->numqueues - 1]); |
421 | rcu_assign_pointer(tfile->tun, NULL); | ||
422 | ntfile = rtnl_dereference(tun->tfiles[index]); | 424 | ntfile = rtnl_dereference(tun->tfiles[index]); |
423 | ntfile->queue_index = index; | 425 | ntfile->queue_index = index; |
424 | 426 | ||
425 | --tun->numqueues; | 427 | --tun->numqueues; |
426 | if (clean) | 428 | if (clean) { |
429 | rcu_assign_pointer(tfile->tun, NULL); | ||
427 | sock_put(&tfile->sk); | 430 | sock_put(&tfile->sk); |
428 | else | 431 | } else |
429 | tun_disable_queue(tun, tfile); | 432 | tun_disable_queue(tun, tfile); |
430 | 433 | ||
431 | synchronize_net(); | 434 | synchronize_net(); |
@@ -439,10 +442,13 @@ static void __tun_detach(struct tun_file *tfile, bool clean) | |||
439 | } | 442 | } |
440 | 443 | ||
441 | if (clean) { | 444 | if (clean) { |
442 | if (tun && tun->numqueues == 0 && tun->numdisabled == 0 && | 445 | if (tun && tun->numqueues == 0 && tun->numdisabled == 0) { |
443 | !(tun->flags & TUN_PERSIST)) | 446 | netif_carrier_off(tun->dev); |
444 | if (tun->dev->reg_state == NETREG_REGISTERED) | 447 | |
448 | if (!(tun->flags & TUN_PERSIST) && | ||
449 | tun->dev->reg_state == NETREG_REGISTERED) | ||
445 | unregister_netdevice(tun->dev); | 450 | unregister_netdevice(tun->dev); |
451 | } | ||
446 | 452 | ||
447 | BUG_ON(!test_bit(SOCK_EXTERNALLY_ALLOCATED, | 453 | BUG_ON(!test_bit(SOCK_EXTERNALLY_ALLOCATED, |
448 | &tfile->socket.flags)); | 454 | &tfile->socket.flags)); |
@@ -470,6 +476,10 @@ static void tun_detach_all(struct net_device *dev) | |||
470 | rcu_assign_pointer(tfile->tun, NULL); | 476 | rcu_assign_pointer(tfile->tun, NULL); |
471 | --tun->numqueues; | 477 | --tun->numqueues; |
472 | } | 478 | } |
479 | list_for_each_entry(tfile, &tun->disabled, next) { | ||
480 | wake_up_all(&tfile->wq.wait); | ||
481 | rcu_assign_pointer(tfile->tun, NULL); | ||
482 | } | ||
473 | BUG_ON(tun->numqueues != 0); | 483 | BUG_ON(tun->numqueues != 0); |
474 | 484 | ||
475 | synchronize_net(); | 485 | synchronize_net(); |
@@ -500,7 +510,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file) | |||
500 | goto out; | 510 | goto out; |
501 | 511 | ||
502 | err = -EINVAL; | 512 | err = -EINVAL; |
503 | if (rtnl_dereference(tfile->tun)) | 513 | if (rtnl_dereference(tfile->tun) && !tfile->detached) |
504 | goto out; | 514 | goto out; |
505 | 515 | ||
506 | err = -EBUSY; | 516 | err = -EBUSY; |
@@ -1199,7 +1209,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, | |||
1199 | tun->dev->stats.rx_packets++; | 1209 | tun->dev->stats.rx_packets++; |
1200 | tun->dev->stats.rx_bytes += len; | 1210 | tun->dev->stats.rx_bytes += len; |
1201 | 1211 | ||
1202 | tun_flow_update(tun, rxhash, tfile->queue_index); | 1212 | tun_flow_update(tun, rxhash, tfile); |
1203 | return total_len; | 1213 | return total_len; |
1204 | } | 1214 | } |
1205 | 1215 | ||
@@ -1658,10 +1668,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) | |||
1658 | device_create_file(&tun->dev->dev, &dev_attr_owner) || | 1668 | device_create_file(&tun->dev->dev, &dev_attr_owner) || |
1659 | device_create_file(&tun->dev->dev, &dev_attr_group)) | 1669 | device_create_file(&tun->dev->dev, &dev_attr_group)) |
1660 | pr_err("Failed to create tun sysfs files\n"); | 1670 | pr_err("Failed to create tun sysfs files\n"); |
1661 | |||
1662 | netif_carrier_on(tun->dev); | ||
1663 | } | 1671 | } |
1664 | 1672 | ||
1673 | netif_carrier_on(tun->dev); | ||
1674 | |||
1665 | tun_debug(KERN_INFO, tun, "tun_set_iff\n"); | 1675 | tun_debug(KERN_INFO, tun, "tun_set_iff\n"); |
1666 | 1676 | ||
1667 | if (ifr->ifr_flags & IFF_NO_PI) | 1677 | if (ifr->ifr_flags & IFF_NO_PI) |
@@ -1813,7 +1823,7 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr) | |||
1813 | ret = tun_attach(tun, file); | 1823 | ret = tun_attach(tun, file); |
1814 | } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { | 1824 | } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { |
1815 | tun = rtnl_dereference(tfile->tun); | 1825 | tun = rtnl_dereference(tfile->tun); |
1816 | if (!tun || !(tun->flags & TUN_TAP_MQ)) | 1826 | if (!tun || !(tun->flags & TUN_TAP_MQ) || tfile->detached) |
1817 | ret = -EINVAL; | 1827 | ret = -EINVAL; |
1818 | else | 1828 | else |
1819 | __tun_detach(tfile, false); | 1829 | __tun_detach(tfile, false); |
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 9197b2c72ca3..00d3b2d37828 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -1215,6 +1215,9 @@ static const struct usb_device_id cdc_devs[] = { | |||
1215 | { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), | 1215 | { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x46), |
1216 | .driver_info = (unsigned long)&wwan_info, | 1216 | .driver_info = (unsigned long)&wwan_info, |
1217 | }, | 1217 | }, |
1218 | { USB_VENDOR_AND_INTERFACE_INFO(0x12d1, 0xff, 0x02, 0x76), | ||
1219 | .driver_info = (unsigned long)&wwan_info, | ||
1220 | }, | ||
1218 | 1221 | ||
1219 | /* Infineon(now Intel) HSPA Modem platform */ | 1222 | /* Infineon(now Intel) HSPA Modem platform */ |
1220 | { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, | 1223 | { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443, |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 575a5839ee34..c8e05e27f38c 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -351,6 +351,10 @@ static const struct usb_device_id products[] = { | |||
351 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 57), | 351 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 57), |
352 | .driver_info = (unsigned long)&qmi_wwan_info, | 352 | .driver_info = (unsigned long)&qmi_wwan_info, |
353 | }, | 353 | }, |
354 | { /* HUAWEI_INTERFACE_NDIS_CONTROL_QUALCOMM */ | ||
355 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x69), | ||
356 | .driver_info = (unsigned long)&qmi_wwan_info, | ||
357 | }, | ||
354 | 358 | ||
355 | /* 2. Combined interface devices matching on class+protocol */ | 359 | /* 2. Combined interface devices matching on class+protocol */ |
356 | { /* Huawei E367 and possibly others in "Windows mode" */ | 360 | { /* Huawei E367 and possibly others in "Windows mode" */ |
@@ -361,6 +365,14 @@ static const struct usb_device_id products[] = { | |||
361 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17), | 365 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17), |
362 | .driver_info = (unsigned long)&qmi_wwan_info, | 366 | .driver_info = (unsigned long)&qmi_wwan_info, |
363 | }, | 367 | }, |
368 | { /* HUAWEI_NDIS_SINGLE_INTERFACE_VDF */ | ||
369 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x37), | ||
370 | .driver_info = (unsigned long)&qmi_wwan_info, | ||
371 | }, | ||
372 | { /* HUAWEI_INTERFACE_NDIS_HW_QUALCOMM */ | ||
373 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x67), | ||
374 | .driver_info = (unsigned long)&qmi_wwan_info, | ||
375 | }, | ||
364 | { /* Pantech UML290, P4200 and more */ | 376 | { /* Pantech UML290, P4200 and more */ |
365 | USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff), | 377 | USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff), |
366 | .driver_info = (unsigned long)&qmi_wwan_info, | 378 | .driver_info = (unsigned long)&qmi_wwan_info, |
@@ -461,6 +473,7 @@ static const struct usb_device_id products[] = { | |||
461 | {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */ | 473 | {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */ |
462 | {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ | 474 | {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ |
463 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ | 475 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ |
476 | {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ | ||
464 | 477 | ||
465 | /* 4. Gobi 1000 devices */ | 478 | /* 4. Gobi 1000 devices */ |
466 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 479 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index f34b2ebee815..5e33606c1366 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -380,6 +380,12 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
380 | unsigned long lockflags; | 380 | unsigned long lockflags; |
381 | size_t size = dev->rx_urb_size; | 381 | size_t size = dev->rx_urb_size; |
382 | 382 | ||
383 | /* prevent rx skb allocation when error ratio is high */ | ||
384 | if (test_bit(EVENT_RX_KILL, &dev->flags)) { | ||
385 | usb_free_urb(urb); | ||
386 | return -ENOLINK; | ||
387 | } | ||
388 | |||
383 | skb = __netdev_alloc_skb_ip_align(dev->net, size, flags); | 389 | skb = __netdev_alloc_skb_ip_align(dev->net, size, flags); |
384 | if (!skb) { | 390 | if (!skb) { |
385 | netif_dbg(dev, rx_err, dev->net, "no rx skb\n"); | 391 | netif_dbg(dev, rx_err, dev->net, "no rx skb\n"); |
@@ -539,6 +545,17 @@ block: | |||
539 | break; | 545 | break; |
540 | } | 546 | } |
541 | 547 | ||
548 | /* stop rx if packet error rate is high */ | ||
549 | if (++dev->pkt_cnt > 30) { | ||
550 | dev->pkt_cnt = 0; | ||
551 | dev->pkt_err = 0; | ||
552 | } else { | ||
553 | if (state == rx_cleanup) | ||
554 | dev->pkt_err++; | ||
555 | if (dev->pkt_err > 20) | ||
556 | set_bit(EVENT_RX_KILL, &dev->flags); | ||
557 | } | ||
558 | |||
542 | state = defer_bh(dev, skb, &dev->rxq, state); | 559 | state = defer_bh(dev, skb, &dev->rxq, state); |
543 | 560 | ||
544 | if (urb) { | 561 | if (urb) { |
@@ -791,6 +808,11 @@ int usbnet_open (struct net_device *net) | |||
791 | (dev->driver_info->flags & FLAG_FRAMING_AX) ? "ASIX" : | 808 | (dev->driver_info->flags & FLAG_FRAMING_AX) ? "ASIX" : |
792 | "simple"); | 809 | "simple"); |
793 | 810 | ||
811 | /* reset rx error state */ | ||
812 | dev->pkt_cnt = 0; | ||
813 | dev->pkt_err = 0; | ||
814 | clear_bit(EVENT_RX_KILL, &dev->flags); | ||
815 | |||
794 | // delay posting reads until we're fully open | 816 | // delay posting reads until we're fully open |
795 | tasklet_schedule (&dev->bh); | 817 | tasklet_schedule (&dev->bh); |
796 | if (info->manage_power) { | 818 | if (info->manage_power) { |
@@ -1103,13 +1125,11 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1103 | if (info->tx_fixup) { | 1125 | if (info->tx_fixup) { |
1104 | skb = info->tx_fixup (dev, skb, GFP_ATOMIC); | 1126 | skb = info->tx_fixup (dev, skb, GFP_ATOMIC); |
1105 | if (!skb) { | 1127 | if (!skb) { |
1106 | if (netif_msg_tx_err(dev)) { | 1128 | /* packet collected; minidriver waiting for more */ |
1107 | netif_dbg(dev, tx_err, dev->net, "can't tx_fixup skb\n"); | 1129 | if (info->flags & FLAG_MULTI_PACKET) |
1108 | goto drop; | ||
1109 | } else { | ||
1110 | /* cdc_ncm collected packet; waits for more */ | ||
1111 | goto not_drop; | 1130 | goto not_drop; |
1112 | } | 1131 | netif_dbg(dev, tx_err, dev->net, "can't tx_fixup skb\n"); |
1132 | goto drop; | ||
1113 | } | 1133 | } |
1114 | } | 1134 | } |
1115 | length = skb->len; | 1135 | length = skb->len; |
@@ -1254,6 +1274,9 @@ static void usbnet_bh (unsigned long param) | |||
1254 | } | 1274 | } |
1255 | } | 1275 | } |
1256 | 1276 | ||
1277 | /* restart RX again after disabling due to high error rate */ | ||
1278 | clear_bit(EVENT_RX_KILL, &dev->flags); | ||
1279 | |||
1257 | // waiting for all pending urbs to complete? | 1280 | // waiting for all pending urbs to complete? |
1258 | if (dev->wait) { | 1281 | if (dev->wait) { |
1259 | if ((dev->txq.qlen + dev->rxq.qlen + dev->done.qlen) == 0) { | 1282 | if ((dev->txq.qlen + dev->rxq.qlen + dev->done.qlen) == 0) { |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index dc8913c6238c..12c6440d1649 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -154,8 +154,7 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue) | |||
154 | if (ret & 1) { /* Link is up. */ | 154 | if (ret & 1) { /* Link is up. */ |
155 | printk(KERN_INFO "%s: NIC Link is Up %d Mbps\n", | 155 | printk(KERN_INFO "%s: NIC Link is Up %d Mbps\n", |
156 | adapter->netdev->name, adapter->link_speed); | 156 | adapter->netdev->name, adapter->link_speed); |
157 | if (!netif_carrier_ok(adapter->netdev)) | 157 | netif_carrier_on(adapter->netdev); |
158 | netif_carrier_on(adapter->netdev); | ||
159 | 158 | ||
160 | if (affectTxQueue) { | 159 | if (affectTxQueue) { |
161 | for (i = 0; i < adapter->num_tx_queues; i++) | 160 | for (i = 0; i < adapter->num_tx_queues; i++) |
@@ -165,8 +164,7 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue) | |||
165 | } else { | 164 | } else { |
166 | printk(KERN_INFO "%s: NIC Link is Down\n", | 165 | printk(KERN_INFO "%s: NIC Link is Down\n", |
167 | adapter->netdev->name); | 166 | adapter->netdev->name); |
168 | if (netif_carrier_ok(adapter->netdev)) | 167 | netif_carrier_off(adapter->netdev); |
169 | netif_carrier_off(adapter->netdev); | ||
170 | 168 | ||
171 | if (affectTxQueue) { | 169 | if (affectTxQueue) { |
172 | for (i = 0; i < adapter->num_tx_queues; i++) | 170 | for (i = 0; i < adapter->num_tx_queues; i++) |
@@ -3061,6 +3059,7 @@ vmxnet3_probe_device(struct pci_dev *pdev, | |||
3061 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); | 3059 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); |
3062 | netif_set_real_num_rx_queues(adapter->netdev, adapter->num_rx_queues); | 3060 | netif_set_real_num_rx_queues(adapter->netdev, adapter->num_rx_queues); |
3063 | 3061 | ||
3062 | netif_carrier_off(netdev); | ||
3064 | err = register_netdev(netdev); | 3063 | err = register_netdev(netdev); |
3065 | 3064 | ||
3066 | if (err) { | 3065 | if (err) { |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c index 0f71d1d4339d..e5fd20994bec 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "debug.h" | 36 | #include "debug.h" |
37 | 37 | ||
38 | #define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */ | 38 | #define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */ |
39 | #define BRCMS_FLUSH_TIMEOUT 500 /* msec */ | ||
39 | 40 | ||
40 | /* Flags we support */ | 41 | /* Flags we support */ |
41 | #define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ | 42 | #define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ |
@@ -708,16 +709,29 @@ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw) | |||
708 | wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); | 709 | wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); |
709 | } | 710 | } |
710 | 711 | ||
712 | static bool brcms_tx_flush_completed(struct brcms_info *wl) | ||
713 | { | ||
714 | bool result; | ||
715 | |||
716 | spin_lock_bh(&wl->lock); | ||
717 | result = brcms_c_tx_flush_completed(wl->wlc); | ||
718 | spin_unlock_bh(&wl->lock); | ||
719 | return result; | ||
720 | } | ||
721 | |||
711 | static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop) | 722 | static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop) |
712 | { | 723 | { |
713 | struct brcms_info *wl = hw->priv; | 724 | struct brcms_info *wl = hw->priv; |
725 | int ret; | ||
714 | 726 | ||
715 | no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false"); | 727 | no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false"); |
716 | 728 | ||
717 | /* wait for packet queue and dma fifos to run empty */ | 729 | ret = wait_event_timeout(wl->tx_flush_wq, |
718 | spin_lock_bh(&wl->lock); | 730 | brcms_tx_flush_completed(wl), |
719 | brcms_c_wait_for_tx_completion(wl->wlc, drop); | 731 | msecs_to_jiffies(BRCMS_FLUSH_TIMEOUT)); |
720 | spin_unlock_bh(&wl->lock); | 732 | |
733 | brcms_dbg_mac80211(wl->wlc->hw->d11core, | ||
734 | "ret=%d\n", jiffies_to_msecs(ret)); | ||
721 | } | 735 | } |
722 | 736 | ||
723 | static const struct ieee80211_ops brcms_ops = { | 737 | static const struct ieee80211_ops brcms_ops = { |
@@ -772,6 +786,7 @@ void brcms_dpc(unsigned long data) | |||
772 | 786 | ||
773 | done: | 787 | done: |
774 | spin_unlock_bh(&wl->lock); | 788 | spin_unlock_bh(&wl->lock); |
789 | wake_up(&wl->tx_flush_wq); | ||
775 | } | 790 | } |
776 | 791 | ||
777 | /* | 792 | /* |
@@ -1020,6 +1035,8 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev) | |||
1020 | 1035 | ||
1021 | atomic_set(&wl->callbacks, 0); | 1036 | atomic_set(&wl->callbacks, 0); |
1022 | 1037 | ||
1038 | init_waitqueue_head(&wl->tx_flush_wq); | ||
1039 | |||
1023 | /* setup the bottom half handler */ | 1040 | /* setup the bottom half handler */ |
1024 | tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl); | 1041 | tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl); |
1025 | 1042 | ||
@@ -1609,13 +1626,3 @@ bool brcms_rfkill_set_hw_state(struct brcms_info *wl) | |||
1609 | spin_lock_bh(&wl->lock); | 1626 | spin_lock_bh(&wl->lock); |
1610 | return blocked; | 1627 | return blocked; |
1611 | } | 1628 | } |
1612 | |||
1613 | /* | ||
1614 | * precondition: perimeter lock has been acquired | ||
1615 | */ | ||
1616 | void brcms_msleep(struct brcms_info *wl, uint ms) | ||
1617 | { | ||
1618 | spin_unlock_bh(&wl->lock); | ||
1619 | msleep(ms); | ||
1620 | spin_lock_bh(&wl->lock); | ||
1621 | } | ||
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h index 9358bd5ebd35..947ccacf43e6 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h | |||
@@ -68,6 +68,8 @@ struct brcms_info { | |||
68 | spinlock_t lock; /* per-device perimeter lock */ | 68 | spinlock_t lock; /* per-device perimeter lock */ |
69 | spinlock_t isr_lock; /* per-device ISR synchronization lock */ | 69 | spinlock_t isr_lock; /* per-device ISR synchronization lock */ |
70 | 70 | ||
71 | /* tx flush */ | ||
72 | wait_queue_head_t tx_flush_wq; | ||
71 | 73 | ||
72 | /* timer related fields */ | 74 | /* timer related fields */ |
73 | atomic_t callbacks; /* # outstanding callback functions */ | 75 | atomic_t callbacks; /* # outstanding callback functions */ |
@@ -100,7 +102,6 @@ extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl, | |||
100 | extern void brcms_free_timer(struct brcms_timer *timer); | 102 | extern void brcms_free_timer(struct brcms_timer *timer); |
101 | extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic); | 103 | extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic); |
102 | extern bool brcms_del_timer(struct brcms_timer *timer); | 104 | extern bool brcms_del_timer(struct brcms_timer *timer); |
103 | extern void brcms_msleep(struct brcms_info *wl, uint ms); | ||
104 | extern void brcms_dpc(unsigned long data); | 105 | extern void brcms_dpc(unsigned long data); |
105 | extern void brcms_timer(struct brcms_timer *t); | 106 | extern void brcms_timer(struct brcms_timer *t); |
106 | extern void brcms_fatal_error(struct brcms_info *wl); | 107 | extern void brcms_fatal_error(struct brcms_info *wl); |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c index 17594de4199e..8b5839008af3 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c | |||
@@ -1027,7 +1027,6 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs) | |||
1027 | static bool | 1027 | static bool |
1028 | brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal) | 1028 | brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal) |
1029 | { | 1029 | { |
1030 | bool morepending = false; | ||
1031 | struct bcma_device *core; | 1030 | struct bcma_device *core; |
1032 | struct tx_status txstatus, *txs; | 1031 | struct tx_status txstatus, *txs; |
1033 | u32 s1, s2; | 1032 | u32 s1, s2; |
@@ -1041,23 +1040,20 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal) | |||
1041 | txs = &txstatus; | 1040 | txs = &txstatus; |
1042 | core = wlc_hw->d11core; | 1041 | core = wlc_hw->d11core; |
1043 | *fatal = false; | 1042 | *fatal = false; |
1044 | s1 = bcma_read32(core, D11REGOFFS(frmtxstatus)); | ||
1045 | while (!(*fatal) | ||
1046 | && (s1 & TXS_V)) { | ||
1047 | /* !give others some time to run! */ | ||
1048 | if (n >= max_tx_num) { | ||
1049 | morepending = true; | ||
1050 | break; | ||
1051 | } | ||
1052 | 1043 | ||
1044 | while (n < max_tx_num) { | ||
1045 | s1 = bcma_read32(core, D11REGOFFS(frmtxstatus)); | ||
1053 | if (s1 == 0xffffffff) { | 1046 | if (s1 == 0xffffffff) { |
1054 | brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit, | 1047 | brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit, |
1055 | __func__); | 1048 | __func__); |
1056 | *fatal = true; | 1049 | *fatal = true; |
1057 | return false; | 1050 | return false; |
1058 | } | 1051 | } |
1059 | s2 = bcma_read32(core, D11REGOFFS(frmtxstatus2)); | 1052 | /* only process when valid */ |
1053 | if (!(s1 & TXS_V)) | ||
1054 | break; | ||
1060 | 1055 | ||
1056 | s2 = bcma_read32(core, D11REGOFFS(frmtxstatus2)); | ||
1061 | txs->status = s1 & TXS_STATUS_MASK; | 1057 | txs->status = s1 & TXS_STATUS_MASK; |
1062 | txs->frameid = (s1 & TXS_FID_MASK) >> TXS_FID_SHIFT; | 1058 | txs->frameid = (s1 & TXS_FID_MASK) >> TXS_FID_SHIFT; |
1063 | txs->sequence = s2 & TXS_SEQ_MASK; | 1059 | txs->sequence = s2 & TXS_SEQ_MASK; |
@@ -1065,15 +1061,12 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal) | |||
1065 | txs->lasttxtime = 0; | 1061 | txs->lasttxtime = 0; |
1066 | 1062 | ||
1067 | *fatal = brcms_c_dotxstatus(wlc_hw->wlc, txs); | 1063 | *fatal = brcms_c_dotxstatus(wlc_hw->wlc, txs); |
1068 | 1064 | if (*fatal == true) | |
1069 | s1 = bcma_read32(core, D11REGOFFS(frmtxstatus)); | 1065 | return false; |
1070 | n++; | 1066 | n++; |
1071 | } | 1067 | } |
1072 | 1068 | ||
1073 | if (*fatal) | 1069 | return n >= max_tx_num; |
1074 | return false; | ||
1075 | |||
1076 | return morepending; | ||
1077 | } | 1070 | } |
1078 | 1071 | ||
1079 | static void brcms_c_tbtt(struct brcms_c_info *wlc) | 1072 | static void brcms_c_tbtt(struct brcms_c_info *wlc) |
@@ -7518,25 +7511,16 @@ int brcms_c_get_curband(struct brcms_c_info *wlc) | |||
7518 | return wlc->band->bandunit; | 7511 | return wlc->band->bandunit; |
7519 | } | 7512 | } |
7520 | 7513 | ||
7521 | void brcms_c_wait_for_tx_completion(struct brcms_c_info *wlc, bool drop) | 7514 | bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc) |
7522 | { | 7515 | { |
7523 | int timeout = 20; | ||
7524 | int i; | 7516 | int i; |
7525 | 7517 | ||
7526 | /* Kick DMA to send any pending AMPDU */ | 7518 | /* Kick DMA to send any pending AMPDU */ |
7527 | for (i = 0; i < ARRAY_SIZE(wlc->hw->di); i++) | 7519 | for (i = 0; i < ARRAY_SIZE(wlc->hw->di); i++) |
7528 | if (wlc->hw->di[i]) | 7520 | if (wlc->hw->di[i]) |
7529 | dma_txflush(wlc->hw->di[i]); | 7521 | dma_kick_tx(wlc->hw->di[i]); |
7530 | |||
7531 | /* wait for queue and DMA fifos to run dry */ | ||
7532 | while (brcms_txpktpendtot(wlc) > 0) { | ||
7533 | brcms_msleep(wlc->wl, 1); | ||
7534 | |||
7535 | if (--timeout == 0) | ||
7536 | break; | ||
7537 | } | ||
7538 | 7522 | ||
7539 | WARN_ON_ONCE(timeout == 0); | 7523 | return !brcms_txpktpendtot(wlc); |
7540 | } | 7524 | } |
7541 | 7525 | ||
7542 | void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval) | 7526 | void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval) |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pub.h b/drivers/net/wireless/brcm80211/brcmsmac/pub.h index 4fb2834f4e64..b0f14b7b8616 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/pub.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/pub.h | |||
@@ -314,8 +314,6 @@ extern void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state); | |||
314 | extern void brcms_c_scan_start(struct brcms_c_info *wlc); | 314 | extern void brcms_c_scan_start(struct brcms_c_info *wlc); |
315 | extern void brcms_c_scan_stop(struct brcms_c_info *wlc); | 315 | extern void brcms_c_scan_stop(struct brcms_c_info *wlc); |
316 | extern int brcms_c_get_curband(struct brcms_c_info *wlc); | 316 | extern int brcms_c_get_curband(struct brcms_c_info *wlc); |
317 | extern void brcms_c_wait_for_tx_completion(struct brcms_c_info *wlc, | ||
318 | bool drop); | ||
319 | extern int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel); | 317 | extern int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel); |
320 | extern int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl); | 318 | extern int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl); |
321 | extern void brcms_c_get_current_rateset(struct brcms_c_info *wlc, | 319 | extern void brcms_c_get_current_rateset(struct brcms_c_info *wlc, |
@@ -332,5 +330,6 @@ extern int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr); | |||
332 | extern int brcms_c_get_tx_power(struct brcms_c_info *wlc); | 330 | extern int brcms_c_get_tx_power(struct brcms_c_info *wlc); |
333 | extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc); | 331 | extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc); |
334 | extern void brcms_c_mute(struct brcms_c_info *wlc, bool on); | 332 | extern void brcms_c_mute(struct brcms_c_info *wlc, bool on); |
333 | extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc); | ||
335 | 334 | ||
336 | #endif /* _BRCM_PUB_H_ */ | 335 | #endif /* _BRCM_PUB_H_ */ |
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c index 31534f7c0548..279796419ea0 100644 --- a/drivers/net/wireless/iwlwifi/dvm/tx.c +++ b/drivers/net/wireless/iwlwifi/dvm/tx.c | |||
@@ -1153,6 +1153,13 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, | |||
1153 | next_reclaimed = ssn; | 1153 | next_reclaimed = ssn; |
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | if (tid != IWL_TID_NON_QOS) { | ||
1157 | priv->tid_data[sta_id][tid].next_reclaimed = | ||
1158 | next_reclaimed; | ||
1159 | IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d\n", | ||
1160 | next_reclaimed); | ||
1161 | } | ||
1162 | |||
1156 | iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs); | 1163 | iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs); |
1157 | 1164 | ||
1158 | iwlagn_check_ratid_empty(priv, sta_id, tid); | 1165 | iwlagn_check_ratid_empty(priv, sta_id, tid); |
@@ -1203,28 +1210,11 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, | |||
1203 | if (!is_agg) | 1210 | if (!is_agg) |
1204 | iwlagn_non_agg_tx_status(priv, ctx, hdr->addr1); | 1211 | iwlagn_non_agg_tx_status(priv, ctx, hdr->addr1); |
1205 | 1212 | ||
1206 | /* | ||
1207 | * W/A for FW bug - the seq_ctl isn't updated when the | ||
1208 | * queues are flushed. Fetch it from the packet itself | ||
1209 | */ | ||
1210 | if (!is_agg && status == TX_STATUS_FAIL_FIFO_FLUSHED) { | ||
1211 | next_reclaimed = le16_to_cpu(hdr->seq_ctrl); | ||
1212 | next_reclaimed = | ||
1213 | SEQ_TO_SN(next_reclaimed + 0x10); | ||
1214 | } | ||
1215 | |||
1216 | is_offchannel_skb = | 1213 | is_offchannel_skb = |
1217 | (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN); | 1214 | (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN); |
1218 | freed++; | 1215 | freed++; |
1219 | } | 1216 | } |
1220 | 1217 | ||
1221 | if (tid != IWL_TID_NON_QOS) { | ||
1222 | priv->tid_data[sta_id][tid].next_reclaimed = | ||
1223 | next_reclaimed; | ||
1224 | IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d\n", | ||
1225 | next_reclaimed); | ||
1226 | } | ||
1227 | |||
1228 | WARN_ON(!is_agg && freed != 1); | 1218 | WARN_ON(!is_agg && freed != 1); |
1229 | 1219 | ||
1230 | /* | 1220 | /* |
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 9189a32b7844..973a9d90e9ea 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -1563,7 +1563,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, | |||
1563 | dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n", | 1563 | dev_err(adapter->dev, "SCAN_RESP: too many AP returned (%d)\n", |
1564 | scan_rsp->number_of_sets); | 1564 | scan_rsp->number_of_sets); |
1565 | ret = -1; | 1565 | ret = -1; |
1566 | goto done; | 1566 | goto check_next_scan; |
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | bytes_left = le16_to_cpu(scan_rsp->bss_descript_size); | 1569 | bytes_left = le16_to_cpu(scan_rsp->bss_descript_size); |
@@ -1634,7 +1634,8 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, | |||
1634 | if (!beacon_size || beacon_size > bytes_left) { | 1634 | if (!beacon_size || beacon_size > bytes_left) { |
1635 | bss_info += bytes_left; | 1635 | bss_info += bytes_left; |
1636 | bytes_left = 0; | 1636 | bytes_left = 0; |
1637 | return -1; | 1637 | ret = -1; |
1638 | goto check_next_scan; | ||
1638 | } | 1639 | } |
1639 | 1640 | ||
1640 | /* Initialize the current working beacon pointer for this BSS | 1641 | /* Initialize the current working beacon pointer for this BSS |
@@ -1690,7 +1691,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, | |||
1690 | dev_err(priv->adapter->dev, | 1691 | dev_err(priv->adapter->dev, |
1691 | "%s: bytes left < IE length\n", | 1692 | "%s: bytes left < IE length\n", |
1692 | __func__); | 1693 | __func__); |
1693 | goto done; | 1694 | goto check_next_scan; |
1694 | } | 1695 | } |
1695 | if (element_id == WLAN_EID_DS_PARAMS) { | 1696 | if (element_id == WLAN_EID_DS_PARAMS) { |
1696 | channel = *(current_ptr + sizeof(struct ieee_types_header)); | 1697 | channel = *(current_ptr + sizeof(struct ieee_types_header)); |
@@ -1753,6 +1754,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, | |||
1753 | } | 1754 | } |
1754 | } | 1755 | } |
1755 | 1756 | ||
1757 | check_next_scan: | ||
1756 | spin_lock_irqsave(&adapter->scan_pending_q_lock, flags); | 1758 | spin_lock_irqsave(&adapter->scan_pending_q_lock, flags); |
1757 | if (list_empty(&adapter->scan_pending_q)) { | 1759 | if (list_empty(&adapter->scan_pending_q)) { |
1758 | spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags); | 1760 | spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags); |
@@ -1813,7 +1815,6 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, | |||
1813 | } | 1815 | } |
1814 | } | 1816 | } |
1815 | 1817 | ||
1816 | done: | ||
1817 | return ret; | 1818 | return ret; |
1818 | } | 1819 | } |
1819 | 1820 | ||
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index 4494d130b37c..0f8b05185eda 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -1004,7 +1004,8 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) | |||
1004 | is_tx ? "Tx" : "Rx"); | 1004 | is_tx ? "Tx" : "Rx"); |
1005 | 1005 | ||
1006 | if (is_tx) { | 1006 | if (is_tx) { |
1007 | rtl_lps_leave(hw); | 1007 | schedule_work(&rtlpriv-> |
1008 | works.lps_leave_work); | ||
1008 | ppsc->last_delaylps_stamp_jiffies = | 1009 | ppsc->last_delaylps_stamp_jiffies = |
1009 | jiffies; | 1010 | jiffies; |
1010 | } | 1011 | } |
@@ -1014,7 +1015,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) | |||
1014 | } | 1015 | } |
1015 | } else if (ETH_P_ARP == ether_type) { | 1016 | } else if (ETH_P_ARP == ether_type) { |
1016 | if (is_tx) { | 1017 | if (is_tx) { |
1017 | rtl_lps_leave(hw); | 1018 | schedule_work(&rtlpriv->works.lps_leave_work); |
1018 | ppsc->last_delaylps_stamp_jiffies = jiffies; | 1019 | ppsc->last_delaylps_stamp_jiffies = jiffies; |
1019 | } | 1020 | } |
1020 | 1021 | ||
@@ -1024,7 +1025,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) | |||
1024 | "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx"); | 1025 | "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx"); |
1025 | 1026 | ||
1026 | if (is_tx) { | 1027 | if (is_tx) { |
1027 | rtl_lps_leave(hw); | 1028 | schedule_work(&rtlpriv->works.lps_leave_work); |
1028 | ppsc->last_delaylps_stamp_jiffies = jiffies; | 1029 | ppsc->last_delaylps_stamp_jiffies = jiffies; |
1029 | } | 1030 | } |
1030 | 1031 | ||
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index f2ecdeb3a90d..1535efda3d52 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -542,8 +542,8 @@ static void _rtl_rx_pre_process(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
542 | WARN_ON(skb_queue_empty(&rx_queue)); | 542 | WARN_ON(skb_queue_empty(&rx_queue)); |
543 | while (!skb_queue_empty(&rx_queue)) { | 543 | while (!skb_queue_empty(&rx_queue)) { |
544 | _skb = skb_dequeue(&rx_queue); | 544 | _skb = skb_dequeue(&rx_queue); |
545 | _rtl_usb_rx_process_agg(hw, skb); | 545 | _rtl_usb_rx_process_agg(hw, _skb); |
546 | ieee80211_rx_irqsafe(hw, skb); | 546 | ieee80211_rx_irqsafe(hw, _skb); |
547 | } | 547 | } |
548 | } | 548 | } |
549 | 549 | ||
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 94b79c3338c4..9d7f1723dd8f 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h | |||
@@ -151,6 +151,9 @@ void xen_netbk_queue_tx_skb(struct xenvif *vif, struct sk_buff *skb); | |||
151 | /* Notify xenvif that ring now has space to send an skb to the frontend */ | 151 | /* Notify xenvif that ring now has space to send an skb to the frontend */ |
152 | void xenvif_notify_tx_completion(struct xenvif *vif); | 152 | void xenvif_notify_tx_completion(struct xenvif *vif); |
153 | 153 | ||
154 | /* Prevent the device from generating any further traffic. */ | ||
155 | void xenvif_carrier_off(struct xenvif *vif); | ||
156 | |||
154 | /* Returns number of ring slots required to send an skb to the frontend */ | 157 | /* Returns number of ring slots required to send an skb to the frontend */ |
155 | unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb); | 158 | unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb); |
156 | 159 | ||
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index b7d41f8c338a..b8c5193bd420 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -343,17 +343,22 @@ err: | |||
343 | return err; | 343 | return err; |
344 | } | 344 | } |
345 | 345 | ||
346 | void xenvif_disconnect(struct xenvif *vif) | 346 | void xenvif_carrier_off(struct xenvif *vif) |
347 | { | 347 | { |
348 | struct net_device *dev = vif->dev; | 348 | struct net_device *dev = vif->dev; |
349 | if (netif_carrier_ok(dev)) { | 349 | |
350 | rtnl_lock(); | 350 | rtnl_lock(); |
351 | netif_carrier_off(dev); /* discard queued packets */ | 351 | netif_carrier_off(dev); /* discard queued packets */ |
352 | if (netif_running(dev)) | 352 | if (netif_running(dev)) |
353 | xenvif_down(vif); | 353 | xenvif_down(vif); |
354 | rtnl_unlock(); | 354 | rtnl_unlock(); |
355 | xenvif_put(vif); | 355 | xenvif_put(vif); |
356 | } | 356 | } |
357 | |||
358 | void xenvif_disconnect(struct xenvif *vif) | ||
359 | { | ||
360 | if (netif_carrier_ok(vif->dev)) | ||
361 | xenvif_carrier_off(vif); | ||
357 | 362 | ||
358 | atomic_dec(&vif->refcnt); | 363 | atomic_dec(&vif->refcnt); |
359 | wait_event(vif->waiting_to_free, atomic_read(&vif->refcnt) == 0); | 364 | wait_event(vif->waiting_to_free, atomic_read(&vif->refcnt) == 0); |
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index f2d6b78d901d..2b9520c46e97 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -147,7 +147,8 @@ void xen_netbk_remove_xenvif(struct xenvif *vif) | |||
147 | atomic_dec(&netbk->netfront_count); | 147 | atomic_dec(&netbk->netfront_count); |
148 | } | 148 | } |
149 | 149 | ||
150 | static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx); | 150 | static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx, |
151 | u8 status); | ||
151 | static void make_tx_response(struct xenvif *vif, | 152 | static void make_tx_response(struct xenvif *vif, |
152 | struct xen_netif_tx_request *txp, | 153 | struct xen_netif_tx_request *txp, |
153 | s8 st); | 154 | s8 st); |
@@ -879,7 +880,7 @@ static void netbk_tx_err(struct xenvif *vif, | |||
879 | 880 | ||
880 | do { | 881 | do { |
881 | make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR); | 882 | make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR); |
882 | if (cons >= end) | 883 | if (cons == end) |
883 | break; | 884 | break; |
884 | txp = RING_GET_REQUEST(&vif->tx, cons++); | 885 | txp = RING_GET_REQUEST(&vif->tx, cons++); |
885 | } while (1); | 886 | } while (1); |
@@ -888,6 +889,13 @@ static void netbk_tx_err(struct xenvif *vif, | |||
888 | xenvif_put(vif); | 889 | xenvif_put(vif); |
889 | } | 890 | } |
890 | 891 | ||
892 | static void netbk_fatal_tx_err(struct xenvif *vif) | ||
893 | { | ||
894 | netdev_err(vif->dev, "fatal error; disabling device\n"); | ||
895 | xenvif_carrier_off(vif); | ||
896 | xenvif_put(vif); | ||
897 | } | ||
898 | |||
891 | static int netbk_count_requests(struct xenvif *vif, | 899 | static int netbk_count_requests(struct xenvif *vif, |
892 | struct xen_netif_tx_request *first, | 900 | struct xen_netif_tx_request *first, |
893 | struct xen_netif_tx_request *txp, | 901 | struct xen_netif_tx_request *txp, |
@@ -901,19 +909,22 @@ static int netbk_count_requests(struct xenvif *vif, | |||
901 | 909 | ||
902 | do { | 910 | do { |
903 | if (frags >= work_to_do) { | 911 | if (frags >= work_to_do) { |
904 | netdev_dbg(vif->dev, "Need more frags\n"); | 912 | netdev_err(vif->dev, "Need more frags\n"); |
913 | netbk_fatal_tx_err(vif); | ||
905 | return -frags; | 914 | return -frags; |
906 | } | 915 | } |
907 | 916 | ||
908 | if (unlikely(frags >= MAX_SKB_FRAGS)) { | 917 | if (unlikely(frags >= MAX_SKB_FRAGS)) { |
909 | netdev_dbg(vif->dev, "Too many frags\n"); | 918 | netdev_err(vif->dev, "Too many frags\n"); |
919 | netbk_fatal_tx_err(vif); | ||
910 | return -frags; | 920 | return -frags; |
911 | } | 921 | } |
912 | 922 | ||
913 | memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + frags), | 923 | memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + frags), |
914 | sizeof(*txp)); | 924 | sizeof(*txp)); |
915 | if (txp->size > first->size) { | 925 | if (txp->size > first->size) { |
916 | netdev_dbg(vif->dev, "Frags galore\n"); | 926 | netdev_err(vif->dev, "Frag is bigger than frame.\n"); |
927 | netbk_fatal_tx_err(vif); | ||
917 | return -frags; | 928 | return -frags; |
918 | } | 929 | } |
919 | 930 | ||
@@ -921,8 +932,9 @@ static int netbk_count_requests(struct xenvif *vif, | |||
921 | frags++; | 932 | frags++; |
922 | 933 | ||
923 | if (unlikely((txp->offset + txp->size) > PAGE_SIZE)) { | 934 | if (unlikely((txp->offset + txp->size) > PAGE_SIZE)) { |
924 | netdev_dbg(vif->dev, "txp->offset: %x, size: %u\n", | 935 | netdev_err(vif->dev, "txp->offset: %x, size: %u\n", |
925 | txp->offset, txp->size); | 936 | txp->offset, txp->size); |
937 | netbk_fatal_tx_err(vif); | ||
926 | return -frags; | 938 | return -frags; |
927 | } | 939 | } |
928 | } while ((txp++)->flags & XEN_NETTXF_more_data); | 940 | } while ((txp++)->flags & XEN_NETTXF_more_data); |
@@ -966,7 +978,7 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk, | |||
966 | pending_idx = netbk->pending_ring[index]; | 978 | pending_idx = netbk->pending_ring[index]; |
967 | page = xen_netbk_alloc_page(netbk, skb, pending_idx); | 979 | page = xen_netbk_alloc_page(netbk, skb, pending_idx); |
968 | if (!page) | 980 | if (!page) |
969 | return NULL; | 981 | goto err; |
970 | 982 | ||
971 | gop->source.u.ref = txp->gref; | 983 | gop->source.u.ref = txp->gref; |
972 | gop->source.domid = vif->domid; | 984 | gop->source.domid = vif->domid; |
@@ -988,6 +1000,17 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk, | |||
988 | } | 1000 | } |
989 | 1001 | ||
990 | return gop; | 1002 | return gop; |
1003 | err: | ||
1004 | /* Unwind, freeing all pages and sending error responses. */ | ||
1005 | while (i-- > start) { | ||
1006 | xen_netbk_idx_release(netbk, frag_get_pending_idx(&frags[i]), | ||
1007 | XEN_NETIF_RSP_ERROR); | ||
1008 | } | ||
1009 | /* The head too, if necessary. */ | ||
1010 | if (start) | ||
1011 | xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR); | ||
1012 | |||
1013 | return NULL; | ||
991 | } | 1014 | } |
992 | 1015 | ||
993 | static int xen_netbk_tx_check_gop(struct xen_netbk *netbk, | 1016 | static int xen_netbk_tx_check_gop(struct xen_netbk *netbk, |
@@ -996,30 +1019,20 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk, | |||
996 | { | 1019 | { |
997 | struct gnttab_copy *gop = *gopp; | 1020 | struct gnttab_copy *gop = *gopp; |
998 | u16 pending_idx = *((u16 *)skb->data); | 1021 | u16 pending_idx = *((u16 *)skb->data); |
999 | struct pending_tx_info *pending_tx_info = netbk->pending_tx_info; | ||
1000 | struct xenvif *vif = pending_tx_info[pending_idx].vif; | ||
1001 | struct xen_netif_tx_request *txp; | ||
1002 | struct skb_shared_info *shinfo = skb_shinfo(skb); | 1022 | struct skb_shared_info *shinfo = skb_shinfo(skb); |
1003 | int nr_frags = shinfo->nr_frags; | 1023 | int nr_frags = shinfo->nr_frags; |
1004 | int i, err, start; | 1024 | int i, err, start; |
1005 | 1025 | ||
1006 | /* Check status of header. */ | 1026 | /* Check status of header. */ |
1007 | err = gop->status; | 1027 | err = gop->status; |
1008 | if (unlikely(err)) { | 1028 | if (unlikely(err)) |
1009 | pending_ring_idx_t index; | 1029 | xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR); |
1010 | index = pending_index(netbk->pending_prod++); | ||
1011 | txp = &pending_tx_info[pending_idx].req; | ||
1012 | make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR); | ||
1013 | netbk->pending_ring[index] = pending_idx; | ||
1014 | xenvif_put(vif); | ||
1015 | } | ||
1016 | 1030 | ||
1017 | /* Skip first skb fragment if it is on same page as header fragment. */ | 1031 | /* Skip first skb fragment if it is on same page as header fragment. */ |
1018 | start = (frag_get_pending_idx(&shinfo->frags[0]) == pending_idx); | 1032 | start = (frag_get_pending_idx(&shinfo->frags[0]) == pending_idx); |
1019 | 1033 | ||
1020 | for (i = start; i < nr_frags; i++) { | 1034 | for (i = start; i < nr_frags; i++) { |
1021 | int j, newerr; | 1035 | int j, newerr; |
1022 | pending_ring_idx_t index; | ||
1023 | 1036 | ||
1024 | pending_idx = frag_get_pending_idx(&shinfo->frags[i]); | 1037 | pending_idx = frag_get_pending_idx(&shinfo->frags[i]); |
1025 | 1038 | ||
@@ -1028,16 +1041,12 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk, | |||
1028 | if (likely(!newerr)) { | 1041 | if (likely(!newerr)) { |
1029 | /* Had a previous error? Invalidate this fragment. */ | 1042 | /* Had a previous error? Invalidate this fragment. */ |
1030 | if (unlikely(err)) | 1043 | if (unlikely(err)) |
1031 | xen_netbk_idx_release(netbk, pending_idx); | 1044 | xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); |
1032 | continue; | 1045 | continue; |
1033 | } | 1046 | } |
1034 | 1047 | ||
1035 | /* Error on this fragment: respond to client with an error. */ | 1048 | /* Error on this fragment: respond to client with an error. */ |
1036 | txp = &netbk->pending_tx_info[pending_idx].req; | 1049 | xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_ERROR); |
1037 | make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR); | ||
1038 | index = pending_index(netbk->pending_prod++); | ||
1039 | netbk->pending_ring[index] = pending_idx; | ||
1040 | xenvif_put(vif); | ||
1041 | 1050 | ||
1042 | /* Not the first error? Preceding frags already invalidated. */ | 1051 | /* Not the first error? Preceding frags already invalidated. */ |
1043 | if (err) | 1052 | if (err) |
@@ -1045,10 +1054,10 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk, | |||
1045 | 1054 | ||
1046 | /* First error: invalidate header and preceding fragments. */ | 1055 | /* First error: invalidate header and preceding fragments. */ |
1047 | pending_idx = *((u16 *)skb->data); | 1056 | pending_idx = *((u16 *)skb->data); |
1048 | xen_netbk_idx_release(netbk, pending_idx); | 1057 | xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); |
1049 | for (j = start; j < i; j++) { | 1058 | for (j = start; j < i; j++) { |
1050 | pending_idx = frag_get_pending_idx(&shinfo->frags[j]); | 1059 | pending_idx = frag_get_pending_idx(&shinfo->frags[j]); |
1051 | xen_netbk_idx_release(netbk, pending_idx); | 1060 | xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); |
1052 | } | 1061 | } |
1053 | 1062 | ||
1054 | /* Remember the error: invalidate all subsequent fragments. */ | 1063 | /* Remember the error: invalidate all subsequent fragments. */ |
@@ -1082,7 +1091,7 @@ static void xen_netbk_fill_frags(struct xen_netbk *netbk, struct sk_buff *skb) | |||
1082 | 1091 | ||
1083 | /* Take an extra reference to offset xen_netbk_idx_release */ | 1092 | /* Take an extra reference to offset xen_netbk_idx_release */ |
1084 | get_page(netbk->mmap_pages[pending_idx]); | 1093 | get_page(netbk->mmap_pages[pending_idx]); |
1085 | xen_netbk_idx_release(netbk, pending_idx); | 1094 | xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); |
1086 | } | 1095 | } |
1087 | } | 1096 | } |
1088 | 1097 | ||
@@ -1095,7 +1104,8 @@ static int xen_netbk_get_extras(struct xenvif *vif, | |||
1095 | 1104 | ||
1096 | do { | 1105 | do { |
1097 | if (unlikely(work_to_do-- <= 0)) { | 1106 | if (unlikely(work_to_do-- <= 0)) { |
1098 | netdev_dbg(vif->dev, "Missing extra info\n"); | 1107 | netdev_err(vif->dev, "Missing extra info\n"); |
1108 | netbk_fatal_tx_err(vif); | ||
1099 | return -EBADR; | 1109 | return -EBADR; |
1100 | } | 1110 | } |
1101 | 1111 | ||
@@ -1104,8 +1114,9 @@ static int xen_netbk_get_extras(struct xenvif *vif, | |||
1104 | if (unlikely(!extra.type || | 1114 | if (unlikely(!extra.type || |
1105 | extra.type >= XEN_NETIF_EXTRA_TYPE_MAX)) { | 1115 | extra.type >= XEN_NETIF_EXTRA_TYPE_MAX)) { |
1106 | vif->tx.req_cons = ++cons; | 1116 | vif->tx.req_cons = ++cons; |
1107 | netdev_dbg(vif->dev, | 1117 | netdev_err(vif->dev, |
1108 | "Invalid extra type: %d\n", extra.type); | 1118 | "Invalid extra type: %d\n", extra.type); |
1119 | netbk_fatal_tx_err(vif); | ||
1109 | return -EINVAL; | 1120 | return -EINVAL; |
1110 | } | 1121 | } |
1111 | 1122 | ||
@@ -1121,13 +1132,15 @@ static int netbk_set_skb_gso(struct xenvif *vif, | |||
1121 | struct xen_netif_extra_info *gso) | 1132 | struct xen_netif_extra_info *gso) |
1122 | { | 1133 | { |
1123 | if (!gso->u.gso.size) { | 1134 | if (!gso->u.gso.size) { |
1124 | netdev_dbg(vif->dev, "GSO size must not be zero.\n"); | 1135 | netdev_err(vif->dev, "GSO size must not be zero.\n"); |
1136 | netbk_fatal_tx_err(vif); | ||
1125 | return -EINVAL; | 1137 | return -EINVAL; |
1126 | } | 1138 | } |
1127 | 1139 | ||
1128 | /* Currently only TCPv4 S.O. is supported. */ | 1140 | /* Currently only TCPv4 S.O. is supported. */ |
1129 | if (gso->u.gso.type != XEN_NETIF_GSO_TYPE_TCPV4) { | 1141 | if (gso->u.gso.type != XEN_NETIF_GSO_TYPE_TCPV4) { |
1130 | netdev_dbg(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type); | 1142 | netdev_err(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type); |
1143 | netbk_fatal_tx_err(vif); | ||
1131 | return -EINVAL; | 1144 | return -EINVAL; |
1132 | } | 1145 | } |
1133 | 1146 | ||
@@ -1264,9 +1277,25 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk) | |||
1264 | 1277 | ||
1265 | /* Get a netif from the list with work to do. */ | 1278 | /* Get a netif from the list with work to do. */ |
1266 | vif = poll_net_schedule_list(netbk); | 1279 | vif = poll_net_schedule_list(netbk); |
1280 | /* This can sometimes happen because the test of | ||
1281 | * list_empty(net_schedule_list) at the top of the | ||
1282 | * loop is unlocked. Just go back and have another | ||
1283 | * look. | ||
1284 | */ | ||
1267 | if (!vif) | 1285 | if (!vif) |
1268 | continue; | 1286 | continue; |
1269 | 1287 | ||
1288 | if (vif->tx.sring->req_prod - vif->tx.req_cons > | ||
1289 | XEN_NETIF_TX_RING_SIZE) { | ||
1290 | netdev_err(vif->dev, | ||
1291 | "Impossible number of requests. " | ||
1292 | "req_prod %d, req_cons %d, size %ld\n", | ||
1293 | vif->tx.sring->req_prod, vif->tx.req_cons, | ||
1294 | XEN_NETIF_TX_RING_SIZE); | ||
1295 | netbk_fatal_tx_err(vif); | ||
1296 | continue; | ||
1297 | } | ||
1298 | |||
1270 | RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, work_to_do); | 1299 | RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, work_to_do); |
1271 | if (!work_to_do) { | 1300 | if (!work_to_do) { |
1272 | xenvif_put(vif); | 1301 | xenvif_put(vif); |
@@ -1294,17 +1323,14 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk) | |||
1294 | work_to_do = xen_netbk_get_extras(vif, extras, | 1323 | work_to_do = xen_netbk_get_extras(vif, extras, |
1295 | work_to_do); | 1324 | work_to_do); |
1296 | idx = vif->tx.req_cons; | 1325 | idx = vif->tx.req_cons; |
1297 | if (unlikely(work_to_do < 0)) { | 1326 | if (unlikely(work_to_do < 0)) |
1298 | netbk_tx_err(vif, &txreq, idx); | ||
1299 | continue; | 1327 | continue; |
1300 | } | ||
1301 | } | 1328 | } |
1302 | 1329 | ||
1303 | ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do); | 1330 | ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do); |
1304 | if (unlikely(ret < 0)) { | 1331 | if (unlikely(ret < 0)) |
1305 | netbk_tx_err(vif, &txreq, idx - ret); | ||
1306 | continue; | 1332 | continue; |
1307 | } | 1333 | |
1308 | idx += ret; | 1334 | idx += ret; |
1309 | 1335 | ||
1310 | if (unlikely(txreq.size < ETH_HLEN)) { | 1336 | if (unlikely(txreq.size < ETH_HLEN)) { |
@@ -1316,11 +1342,11 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk) | |||
1316 | 1342 | ||
1317 | /* No crossing a page as the payload mustn't fragment. */ | 1343 | /* No crossing a page as the payload mustn't fragment. */ |
1318 | if (unlikely((txreq.offset + txreq.size) > PAGE_SIZE)) { | 1344 | if (unlikely((txreq.offset + txreq.size) > PAGE_SIZE)) { |
1319 | netdev_dbg(vif->dev, | 1345 | netdev_err(vif->dev, |
1320 | "txreq.offset: %x, size: %u, end: %lu\n", | 1346 | "txreq.offset: %x, size: %u, end: %lu\n", |
1321 | txreq.offset, txreq.size, | 1347 | txreq.offset, txreq.size, |
1322 | (txreq.offset&~PAGE_MASK) + txreq.size); | 1348 | (txreq.offset&~PAGE_MASK) + txreq.size); |
1323 | netbk_tx_err(vif, &txreq, idx); | 1349 | netbk_fatal_tx_err(vif); |
1324 | continue; | 1350 | continue; |
1325 | } | 1351 | } |
1326 | 1352 | ||
@@ -1348,8 +1374,8 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk) | |||
1348 | gso = &extras[XEN_NETIF_EXTRA_TYPE_GSO - 1]; | 1374 | gso = &extras[XEN_NETIF_EXTRA_TYPE_GSO - 1]; |
1349 | 1375 | ||
1350 | if (netbk_set_skb_gso(vif, skb, gso)) { | 1376 | if (netbk_set_skb_gso(vif, skb, gso)) { |
1377 | /* Failure in netbk_set_skb_gso is fatal. */ | ||
1351 | kfree_skb(skb); | 1378 | kfree_skb(skb); |
1352 | netbk_tx_err(vif, &txreq, idx); | ||
1353 | continue; | 1379 | continue; |
1354 | } | 1380 | } |
1355 | } | 1381 | } |
@@ -1448,7 +1474,7 @@ static void xen_netbk_tx_submit(struct xen_netbk *netbk) | |||
1448 | txp->size -= data_len; | 1474 | txp->size -= data_len; |
1449 | } else { | 1475 | } else { |
1450 | /* Schedule a response immediately. */ | 1476 | /* Schedule a response immediately. */ |
1451 | xen_netbk_idx_release(netbk, pending_idx); | 1477 | xen_netbk_idx_release(netbk, pending_idx, XEN_NETIF_RSP_OKAY); |
1452 | } | 1478 | } |
1453 | 1479 | ||
1454 | if (txp->flags & XEN_NETTXF_csum_blank) | 1480 | if (txp->flags & XEN_NETTXF_csum_blank) |
@@ -1500,7 +1526,8 @@ static void xen_netbk_tx_action(struct xen_netbk *netbk) | |||
1500 | xen_netbk_tx_submit(netbk); | 1526 | xen_netbk_tx_submit(netbk); |
1501 | } | 1527 | } |
1502 | 1528 | ||
1503 | static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx) | 1529 | static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx, |
1530 | u8 status) | ||
1504 | { | 1531 | { |
1505 | struct xenvif *vif; | 1532 | struct xenvif *vif; |
1506 | struct pending_tx_info *pending_tx_info; | 1533 | struct pending_tx_info *pending_tx_info; |
@@ -1514,7 +1541,7 @@ static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx) | |||
1514 | 1541 | ||
1515 | vif = pending_tx_info->vif; | 1542 | vif = pending_tx_info->vif; |
1516 | 1543 | ||
1517 | make_tx_response(vif, &pending_tx_info->req, XEN_NETIF_RSP_OKAY); | 1544 | make_tx_response(vif, &pending_tx_info->req, status); |
1518 | 1545 | ||
1519 | index = pending_index(netbk->pending_prod++); | 1546 | index = pending_index(netbk->pending_prod++); |
1520 | netbk->pending_ring[index] = pending_idx; | 1547 | netbk->pending_ring[index] = pending_idx; |
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index efaecefe3f8c..a5f3c8ca480e 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig | |||
@@ -184,8 +184,8 @@ config PINCTRL_SAMSUNG | |||
184 | select PINMUX | 184 | select PINMUX |
185 | select PINCONF | 185 | select PINCONF |
186 | 186 | ||
187 | config PINCTRL_EXYNOS4 | 187 | config PINCTRL_EXYNOS |
188 | bool "Pinctrl driver data for Exynos4 SoC" | 188 | bool "Pinctrl driver data for Samsung EXYNOS SoCs" |
189 | depends on OF && GPIOLIB | 189 | depends on OF && GPIOLIB |
190 | select PINCTRL_SAMSUNG | 190 | select PINCTRL_SAMSUNG |
191 | 191 | ||
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index fc4606f27dc7..6e87e52eab5d 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile | |||
@@ -36,7 +36,7 @@ obj-$(CONFIG_PINCTRL_TEGRA30) += pinctrl-tegra30.o | |||
36 | obj-$(CONFIG_PINCTRL_U300) += pinctrl-u300.o | 36 | obj-$(CONFIG_PINCTRL_U300) += pinctrl-u300.o |
37 | obj-$(CONFIG_PINCTRL_COH901) += pinctrl-coh901.o | 37 | obj-$(CONFIG_PINCTRL_COH901) += pinctrl-coh901.o |
38 | obj-$(CONFIG_PINCTRL_SAMSUNG) += pinctrl-samsung.o | 38 | obj-$(CONFIG_PINCTRL_SAMSUNG) += pinctrl-samsung.o |
39 | obj-$(CONFIG_PINCTRL_EXYNOS4) += pinctrl-exynos.o | 39 | obj-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o |
40 | obj-$(CONFIG_PINCTRL_EXYNOS5440) += pinctrl-exynos5440.o | 40 | obj-$(CONFIG_PINCTRL_EXYNOS5440) += pinctrl-exynos5440.o |
41 | obj-$(CONFIG_PINCTRL_XWAY) += pinctrl-xway.o | 41 | obj-$(CONFIG_PINCTRL_XWAY) += pinctrl-xway.o |
42 | obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o | 42 | obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o |
diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c index 498b2ba905de..d02498b30c6e 100644 --- a/drivers/pinctrl/pinctrl-sirf.c +++ b/drivers/pinctrl/pinctrl-sirf.c | |||
@@ -1246,6 +1246,22 @@ static void __iomem *sirfsoc_rsc_of_iomap(void) | |||
1246 | return of_iomap(np, 0); | 1246 | return of_iomap(np, 0); |
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | static int sirfsoc_gpio_of_xlate(struct gpio_chip *gc, | ||
1250 | const struct of_phandle_args *gpiospec, | ||
1251 | u32 *flags) | ||
1252 | { | ||
1253 | if (gpiospec->args[0] > SIRFSOC_GPIO_NO_OF_BANKS * SIRFSOC_GPIO_BANK_SIZE) | ||
1254 | return -EINVAL; | ||
1255 | |||
1256 | if (gc != &sgpio_bank[gpiospec->args[0] / SIRFSOC_GPIO_BANK_SIZE].chip.gc) | ||
1257 | return -EINVAL; | ||
1258 | |||
1259 | if (flags) | ||
1260 | *flags = gpiospec->args[1]; | ||
1261 | |||
1262 | return gpiospec->args[0] % SIRFSOC_GPIO_BANK_SIZE; | ||
1263 | } | ||
1264 | |||
1249 | static int sirfsoc_pinmux_probe(struct platform_device *pdev) | 1265 | static int sirfsoc_pinmux_probe(struct platform_device *pdev) |
1250 | { | 1266 | { |
1251 | int ret; | 1267 | int ret; |
@@ -1736,6 +1752,8 @@ static int sirfsoc_gpio_probe(struct device_node *np) | |||
1736 | bank->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE; | 1752 | bank->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE; |
1737 | bank->chip.gc.label = kstrdup(np->full_name, GFP_KERNEL); | 1753 | bank->chip.gc.label = kstrdup(np->full_name, GFP_KERNEL); |
1738 | bank->chip.gc.of_node = np; | 1754 | bank->chip.gc.of_node = np; |
1755 | bank->chip.gc.of_xlate = sirfsoc_gpio_of_xlate; | ||
1756 | bank->chip.gc.of_gpio_n_cells = 2; | ||
1739 | bank->chip.regs = regs; | 1757 | bank->chip.regs = regs; |
1740 | bank->id = i; | 1758 | bank->id = i; |
1741 | bank->is_marco = is_marco; | 1759 | bank->is_marco = is_marco; |
diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c index b85040caaea3..cca18a3c0294 100644 --- a/drivers/regulator/max77686.c +++ b/drivers/regulator/max77686.c | |||
@@ -379,9 +379,10 @@ static struct regulator_desc regulators[] = { | |||
379 | }; | 379 | }; |
380 | 380 | ||
381 | #ifdef CONFIG_OF | 381 | #ifdef CONFIG_OF |
382 | static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, | 382 | static int max77686_pmic_dt_parse_pdata(struct platform_device *pdev, |
383 | struct max77686_platform_data *pdata) | 383 | struct max77686_platform_data *pdata) |
384 | { | 384 | { |
385 | struct max77686_dev *iodev = dev_get_drvdata(pdev->dev.parent); | ||
385 | struct device_node *pmic_np, *regulators_np; | 386 | struct device_node *pmic_np, *regulators_np; |
386 | struct max77686_regulator_data *rdata; | 387 | struct max77686_regulator_data *rdata; |
387 | struct of_regulator_match rmatch; | 388 | struct of_regulator_match rmatch; |
@@ -390,15 +391,15 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, | |||
390 | pmic_np = iodev->dev->of_node; | 391 | pmic_np = iodev->dev->of_node; |
391 | regulators_np = of_find_node_by_name(pmic_np, "voltage-regulators"); | 392 | regulators_np = of_find_node_by_name(pmic_np, "voltage-regulators"); |
392 | if (!regulators_np) { | 393 | if (!regulators_np) { |
393 | dev_err(iodev->dev, "could not find regulators sub-node\n"); | 394 | dev_err(&pdev->dev, "could not find regulators sub-node\n"); |
394 | return -EINVAL; | 395 | return -EINVAL; |
395 | } | 396 | } |
396 | 397 | ||
397 | pdata->num_regulators = ARRAY_SIZE(regulators); | 398 | pdata->num_regulators = ARRAY_SIZE(regulators); |
398 | rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * | 399 | rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * |
399 | pdata->num_regulators, GFP_KERNEL); | 400 | pdata->num_regulators, GFP_KERNEL); |
400 | if (!rdata) { | 401 | if (!rdata) { |
401 | dev_err(iodev->dev, | 402 | dev_err(&pdev->dev, |
402 | "could not allocate memory for regulator data\n"); | 403 | "could not allocate memory for regulator data\n"); |
403 | return -ENOMEM; | 404 | return -ENOMEM; |
404 | } | 405 | } |
@@ -407,7 +408,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, | |||
407 | rmatch.name = regulators[i].name; | 408 | rmatch.name = regulators[i].name; |
408 | rmatch.init_data = NULL; | 409 | rmatch.init_data = NULL; |
409 | rmatch.of_node = NULL; | 410 | rmatch.of_node = NULL; |
410 | of_regulator_match(iodev->dev, regulators_np, &rmatch, 1); | 411 | of_regulator_match(&pdev->dev, regulators_np, &rmatch, 1); |
411 | rdata[i].initdata = rmatch.init_data; | 412 | rdata[i].initdata = rmatch.init_data; |
412 | rdata[i].of_node = rmatch.of_node; | 413 | rdata[i].of_node = rmatch.of_node; |
413 | } | 414 | } |
@@ -417,7 +418,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, | |||
417 | return 0; | 418 | return 0; |
418 | } | 419 | } |
419 | #else | 420 | #else |
420 | static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, | 421 | static int max77686_pmic_dt_parse_pdata(struct platform_device *pdev, |
421 | struct max77686_platform_data *pdata) | 422 | struct max77686_platform_data *pdata) |
422 | { | 423 | { |
423 | return 0; | 424 | return 0; |
@@ -440,7 +441,7 @@ static int max77686_pmic_probe(struct platform_device *pdev) | |||
440 | } | 441 | } |
441 | 442 | ||
442 | if (iodev->dev->of_node) { | 443 | if (iodev->dev->of_node) { |
443 | ret = max77686_pmic_dt_parse_pdata(iodev, pdata); | 444 | ret = max77686_pmic_dt_parse_pdata(pdev, pdata); |
444 | if (ret) | 445 | if (ret) |
445 | return ret; | 446 | return ret; |
446 | } | 447 | } |
diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c index d1a77512d83e..d40cf7fdb546 100644 --- a/drivers/regulator/max8907-regulator.c +++ b/drivers/regulator/max8907-regulator.c | |||
@@ -237,8 +237,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev) | |||
237 | return -EINVAL; | 237 | return -EINVAL; |
238 | } | 238 | } |
239 | 239 | ||
240 | ret = of_regulator_match(pdev->dev.parent, regulators, | 240 | ret = of_regulator_match(&pdev->dev, regulators, max8907_matches, |
241 | max8907_matches, | ||
242 | ARRAY_SIZE(max8907_matches)); | 241 | ARRAY_SIZE(max8907_matches)); |
243 | if (ret < 0) { | 242 | if (ret < 0) { |
244 | dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", | 243 | dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", |
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 02be7fcae32f..836908ce505e 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c | |||
@@ -934,7 +934,7 @@ static struct regulator_desc regulators[] = { | |||
934 | }; | 934 | }; |
935 | 935 | ||
936 | #ifdef CONFIG_OF | 936 | #ifdef CONFIG_OF |
937 | static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev, | 937 | static int max8997_pmic_dt_parse_dvs_gpio(struct platform_device *pdev, |
938 | struct max8997_platform_data *pdata, | 938 | struct max8997_platform_data *pdata, |
939 | struct device_node *pmic_np) | 939 | struct device_node *pmic_np) |
940 | { | 940 | { |
@@ -944,7 +944,7 @@ static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev, | |||
944 | gpio = of_get_named_gpio(pmic_np, | 944 | gpio = of_get_named_gpio(pmic_np, |
945 | "max8997,pmic-buck125-dvs-gpios", i); | 945 | "max8997,pmic-buck125-dvs-gpios", i); |
946 | if (!gpio_is_valid(gpio)) { | 946 | if (!gpio_is_valid(gpio)) { |
947 | dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio); | 947 | dev_err(&pdev->dev, "invalid gpio[%d]: %d\n", i, gpio); |
948 | return -EINVAL; | 948 | return -EINVAL; |
949 | } | 949 | } |
950 | pdata->buck125_gpios[i] = gpio; | 950 | pdata->buck125_gpios[i] = gpio; |
@@ -952,22 +952,23 @@ static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev, | |||
952 | return 0; | 952 | return 0; |
953 | } | 953 | } |
954 | 954 | ||
955 | static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, | 955 | static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, |
956 | struct max8997_platform_data *pdata) | 956 | struct max8997_platform_data *pdata) |
957 | { | 957 | { |
958 | struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); | ||
958 | struct device_node *pmic_np, *regulators_np, *reg_np; | 959 | struct device_node *pmic_np, *regulators_np, *reg_np; |
959 | struct max8997_regulator_data *rdata; | 960 | struct max8997_regulator_data *rdata; |
960 | unsigned int i, dvs_voltage_nr = 1, ret; | 961 | unsigned int i, dvs_voltage_nr = 1, ret; |
961 | 962 | ||
962 | pmic_np = iodev->dev->of_node; | 963 | pmic_np = iodev->dev->of_node; |
963 | if (!pmic_np) { | 964 | if (!pmic_np) { |
964 | dev_err(iodev->dev, "could not find pmic sub-node\n"); | 965 | dev_err(&pdev->dev, "could not find pmic sub-node\n"); |
965 | return -ENODEV; | 966 | return -ENODEV; |
966 | } | 967 | } |
967 | 968 | ||
968 | regulators_np = of_find_node_by_name(pmic_np, "regulators"); | 969 | regulators_np = of_find_node_by_name(pmic_np, "regulators"); |
969 | if (!regulators_np) { | 970 | if (!regulators_np) { |
970 | dev_err(iodev->dev, "could not find regulators sub-node\n"); | 971 | dev_err(&pdev->dev, "could not find regulators sub-node\n"); |
971 | return -EINVAL; | 972 | return -EINVAL; |
972 | } | 973 | } |
973 | 974 | ||
@@ -976,11 +977,10 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, | |||
976 | for_each_child_of_node(regulators_np, reg_np) | 977 | for_each_child_of_node(regulators_np, reg_np) |
977 | pdata->num_regulators++; | 978 | pdata->num_regulators++; |
978 | 979 | ||
979 | rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * | 980 | rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * |
980 | pdata->num_regulators, GFP_KERNEL); | 981 | pdata->num_regulators, GFP_KERNEL); |
981 | if (!rdata) { | 982 | if (!rdata) { |
982 | dev_err(iodev->dev, "could not allocate memory for " | 983 | dev_err(&pdev->dev, "could not allocate memory for regulator data\n"); |
983 | "regulator data\n"); | ||
984 | return -ENOMEM; | 984 | return -ENOMEM; |
985 | } | 985 | } |
986 | 986 | ||
@@ -991,14 +991,14 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, | |||
991 | break; | 991 | break; |
992 | 992 | ||
993 | if (i == ARRAY_SIZE(regulators)) { | 993 | if (i == ARRAY_SIZE(regulators)) { |
994 | dev_warn(iodev->dev, "don't know how to configure " | 994 | dev_warn(&pdev->dev, "don't know how to configure regulator %s\n", |
995 | "regulator %s\n", reg_np->name); | 995 | reg_np->name); |
996 | continue; | 996 | continue; |
997 | } | 997 | } |
998 | 998 | ||
999 | rdata->id = i; | 999 | rdata->id = i; |
1000 | rdata->initdata = of_get_regulator_init_data( | 1000 | rdata->initdata = of_get_regulator_init_data(&pdev->dev, |
1001 | iodev->dev, reg_np); | 1001 | reg_np); |
1002 | rdata->reg_node = reg_np; | 1002 | rdata->reg_node = reg_np; |
1003 | rdata++; | 1003 | rdata++; |
1004 | } | 1004 | } |
@@ -1014,7 +1014,7 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, | |||
1014 | 1014 | ||
1015 | if (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs || | 1015 | if (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs || |
1016 | pdata->buck5_gpiodvs) { | 1016 | pdata->buck5_gpiodvs) { |
1017 | ret = max8997_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np); | 1017 | ret = max8997_pmic_dt_parse_dvs_gpio(pdev, pdata, pmic_np); |
1018 | if (ret) | 1018 | if (ret) |
1019 | return -EINVAL; | 1019 | return -EINVAL; |
1020 | 1020 | ||
@@ -1025,8 +1025,7 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, | |||
1025 | } else { | 1025 | } else { |
1026 | if (pdata->buck125_default_idx >= 8) { | 1026 | if (pdata->buck125_default_idx >= 8) { |
1027 | pdata->buck125_default_idx = 0; | 1027 | pdata->buck125_default_idx = 0; |
1028 | dev_info(iodev->dev, "invalid value for " | 1028 | dev_info(&pdev->dev, "invalid value for default dvs index, using 0 instead\n"); |
1029 | "default dvs index, using 0 instead\n"); | ||
1030 | } | 1029 | } |
1031 | } | 1030 | } |
1032 | 1031 | ||
@@ -1040,28 +1039,28 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, | |||
1040 | if (of_property_read_u32_array(pmic_np, | 1039 | if (of_property_read_u32_array(pmic_np, |
1041 | "max8997,pmic-buck1-dvs-voltage", | 1040 | "max8997,pmic-buck1-dvs-voltage", |
1042 | pdata->buck1_voltage, dvs_voltage_nr)) { | 1041 | pdata->buck1_voltage, dvs_voltage_nr)) { |
1043 | dev_err(iodev->dev, "buck1 voltages not specified\n"); | 1042 | dev_err(&pdev->dev, "buck1 voltages not specified\n"); |
1044 | return -EINVAL; | 1043 | return -EINVAL; |
1045 | } | 1044 | } |
1046 | 1045 | ||
1047 | if (of_property_read_u32_array(pmic_np, | 1046 | if (of_property_read_u32_array(pmic_np, |
1048 | "max8997,pmic-buck2-dvs-voltage", | 1047 | "max8997,pmic-buck2-dvs-voltage", |
1049 | pdata->buck2_voltage, dvs_voltage_nr)) { | 1048 | pdata->buck2_voltage, dvs_voltage_nr)) { |
1050 | dev_err(iodev->dev, "buck2 voltages not specified\n"); | 1049 | dev_err(&pdev->dev, "buck2 voltages not specified\n"); |
1051 | return -EINVAL; | 1050 | return -EINVAL; |
1052 | } | 1051 | } |
1053 | 1052 | ||
1054 | if (of_property_read_u32_array(pmic_np, | 1053 | if (of_property_read_u32_array(pmic_np, |
1055 | "max8997,pmic-buck5-dvs-voltage", | 1054 | "max8997,pmic-buck5-dvs-voltage", |
1056 | pdata->buck5_voltage, dvs_voltage_nr)) { | 1055 | pdata->buck5_voltage, dvs_voltage_nr)) { |
1057 | dev_err(iodev->dev, "buck5 voltages not specified\n"); | 1056 | dev_err(&pdev->dev, "buck5 voltages not specified\n"); |
1058 | return -EINVAL; | 1057 | return -EINVAL; |
1059 | } | 1058 | } |
1060 | 1059 | ||
1061 | return 0; | 1060 | return 0; |
1062 | } | 1061 | } |
1063 | #else | 1062 | #else |
1064 | static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, | 1063 | static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, |
1065 | struct max8997_platform_data *pdata) | 1064 | struct max8997_platform_data *pdata) |
1066 | { | 1065 | { |
1067 | return 0; | 1066 | return 0; |
@@ -1085,7 +1084,7 @@ static int max8997_pmic_probe(struct platform_device *pdev) | |||
1085 | } | 1084 | } |
1086 | 1085 | ||
1087 | if (iodev->dev->of_node) { | 1086 | if (iodev->dev->of_node) { |
1088 | ret = max8997_pmic_dt_parse_pdata(iodev, pdata); | 1087 | ret = max8997_pmic_dt_parse_pdata(pdev, pdata); |
1089 | if (ret) | 1088 | if (ret) |
1090 | return ret; | 1089 | return ret; |
1091 | } | 1090 | } |
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c index 1f0df4046b86..0a8dd1cbee6f 100644 --- a/drivers/regulator/max8998.c +++ b/drivers/regulator/max8998.c | |||
@@ -65,7 +65,7 @@ static const struct voltage_map_desc ldo9_voltage_map_desc = { | |||
65 | .min = 2800000, .step = 100000, .max = 3100000, | 65 | .min = 2800000, .step = 100000, .max = 3100000, |
66 | }; | 66 | }; |
67 | static const struct voltage_map_desc ldo10_voltage_map_desc = { | 67 | static const struct voltage_map_desc ldo10_voltage_map_desc = { |
68 | .min = 95000, .step = 50000, .max = 1300000, | 68 | .min = 950000, .step = 50000, .max = 1300000, |
69 | }; | 69 | }; |
70 | static const struct voltage_map_desc ldo1213_voltage_map_desc = { | 70 | static const struct voltage_map_desc ldo1213_voltage_map_desc = { |
71 | .min = 800000, .step = 100000, .max = 3300000, | 71 | .min = 800000, .step = 100000, .max = 3300000, |
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 6f684916fd79..66ca769287ab 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c | |||
@@ -120,6 +120,12 @@ int of_regulator_match(struct device *dev, struct device_node *node, | |||
120 | if (!dev || !node) | 120 | if (!dev || !node) |
121 | return -EINVAL; | 121 | return -EINVAL; |
122 | 122 | ||
123 | for (i = 0; i < num_matches; i++) { | ||
124 | struct of_regulator_match *match = &matches[i]; | ||
125 | match->init_data = NULL; | ||
126 | match->of_node = NULL; | ||
127 | } | ||
128 | |||
123 | for_each_child_of_node(node, child) { | 129 | for_each_child_of_node(node, child) { |
124 | name = of_get_property(child, | 130 | name = of_get_property(child, |
125 | "regulator-compatible", NULL); | 131 | "regulator-compatible", NULL); |
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c index bd062a2ffbe2..cd9ea2ea1826 100644 --- a/drivers/regulator/s2mps11.c +++ b/drivers/regulator/s2mps11.c | |||
@@ -174,9 +174,9 @@ static struct regulator_ops s2mps11_buck_ops = { | |||
174 | .min_uV = S2MPS11_BUCK_MIN2, \ | 174 | .min_uV = S2MPS11_BUCK_MIN2, \ |
175 | .uV_step = S2MPS11_BUCK_STEP2, \ | 175 | .uV_step = S2MPS11_BUCK_STEP2, \ |
176 | .n_voltages = S2MPS11_BUCK_N_VOLTAGES, \ | 176 | .n_voltages = S2MPS11_BUCK_N_VOLTAGES, \ |
177 | .vsel_reg = S2MPS11_REG_B9CTRL2, \ | 177 | .vsel_reg = S2MPS11_REG_B10CTRL2, \ |
178 | .vsel_mask = S2MPS11_BUCK_VSEL_MASK, \ | 178 | .vsel_mask = S2MPS11_BUCK_VSEL_MASK, \ |
179 | .enable_reg = S2MPS11_REG_B9CTRL1, \ | 179 | .enable_reg = S2MPS11_REG_B10CTRL1, \ |
180 | .enable_mask = S2MPS11_ENABLE_MASK \ | 180 | .enable_mask = S2MPS11_ENABLE_MASK \ |
181 | } | 181 | } |
182 | 182 | ||
diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c index 73dce7664126..df395187c063 100644 --- a/drivers/regulator/tps65217-regulator.c +++ b/drivers/regulator/tps65217-regulator.c | |||
@@ -305,8 +305,8 @@ static struct tps65217_board *tps65217_parse_dt(struct platform_device *pdev) | |||
305 | if (!regs) | 305 | if (!regs) |
306 | return NULL; | 306 | return NULL; |
307 | 307 | ||
308 | count = of_regulator_match(pdev->dev.parent, regs, | 308 | count = of_regulator_match(&pdev->dev, regs, reg_matches, |
309 | reg_matches, TPS65217_NUM_REGULATOR); | 309 | TPS65217_NUM_REGULATOR); |
310 | of_node_put(regs); | 310 | of_node_put(regs); |
311 | if ((count < 0) || (count > TPS65217_NUM_REGULATOR)) | 311 | if ((count < 0) || (count > TPS65217_NUM_REGULATOR)) |
312 | return NULL; | 312 | return NULL; |
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index 59c3770fa77d..b0e4c0bc85c3 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c | |||
@@ -998,7 +998,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( | |||
998 | return NULL; | 998 | return NULL; |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | ret = of_regulator_match(pdev->dev.parent, regulators, matches, count); | 1001 | ret = of_regulator_match(&pdev->dev, regulators, matches, count); |
1002 | if (ret < 0) { | 1002 | if (ret < 0) { |
1003 | dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", | 1003 | dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", |
1004 | ret); | 1004 | ret); |
diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c index afb7cfa85ccc..c016ad81767a 100644 --- a/drivers/rtc/rtc-isl1208.c +++ b/drivers/rtc/rtc-isl1208.c | |||
@@ -506,6 +506,7 @@ isl1208_rtc_interrupt(int irq, void *data) | |||
506 | { | 506 | { |
507 | unsigned long timeout = jiffies + msecs_to_jiffies(1000); | 507 | unsigned long timeout = jiffies + msecs_to_jiffies(1000); |
508 | struct i2c_client *client = data; | 508 | struct i2c_client *client = data; |
509 | struct rtc_device *rtc = i2c_get_clientdata(client); | ||
509 | int handled = 0, sr, err; | 510 | int handled = 0, sr, err; |
510 | 511 | ||
511 | /* | 512 | /* |
@@ -528,6 +529,8 @@ isl1208_rtc_interrupt(int irq, void *data) | |||
528 | if (sr & ISL1208_REG_SR_ALM) { | 529 | if (sr & ISL1208_REG_SR_ALM) { |
529 | dev_dbg(&client->dev, "alarm!\n"); | 530 | dev_dbg(&client->dev, "alarm!\n"); |
530 | 531 | ||
532 | rtc_update_irq(rtc, 1, RTC_IRQF | RTC_AF); | ||
533 | |||
531 | /* Clear the alarm */ | 534 | /* Clear the alarm */ |
532 | sr &= ~ISL1208_REG_SR_ALM; | 535 | sr &= ~ISL1208_REG_SR_ALM; |
533 | sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, sr); | 536 | sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, sr); |
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 08378e3cc21c..10c1a3454e48 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #define RTC_YMR 0x34 /* Year match register */ | 44 | #define RTC_YMR 0x34 /* Year match register */ |
45 | #define RTC_YLR 0x38 /* Year data load register */ | 45 | #define RTC_YLR 0x38 /* Year data load register */ |
46 | 46 | ||
47 | #define RTC_CR_EN (1 << 0) /* counter enable bit */ | ||
47 | #define RTC_CR_CWEN (1 << 26) /* Clockwatch enable bit */ | 48 | #define RTC_CR_CWEN (1 << 26) /* Clockwatch enable bit */ |
48 | 49 | ||
49 | #define RTC_TCR_EN (1 << 1) /* Periodic timer enable bit */ | 50 | #define RTC_TCR_EN (1 << 1) /* Periodic timer enable bit */ |
@@ -320,7 +321,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) | |||
320 | struct pl031_local *ldata; | 321 | struct pl031_local *ldata; |
321 | struct pl031_vendor_data *vendor = id->data; | 322 | struct pl031_vendor_data *vendor = id->data; |
322 | struct rtc_class_ops *ops = &vendor->ops; | 323 | struct rtc_class_ops *ops = &vendor->ops; |
323 | unsigned long time; | 324 | unsigned long time, data; |
324 | 325 | ||
325 | ret = amba_request_regions(adev, NULL); | 326 | ret = amba_request_regions(adev, NULL); |
326 | if (ret) | 327 | if (ret) |
@@ -345,10 +346,11 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) | |||
345 | dev_dbg(&adev->dev, "designer ID = 0x%02x\n", amba_manf(adev)); | 346 | dev_dbg(&adev->dev, "designer ID = 0x%02x\n", amba_manf(adev)); |
346 | dev_dbg(&adev->dev, "revision = 0x%01x\n", amba_rev(adev)); | 347 | dev_dbg(&adev->dev, "revision = 0x%01x\n", amba_rev(adev)); |
347 | 348 | ||
349 | data = readl(ldata->base + RTC_CR); | ||
348 | /* Enable the clockwatch on ST Variants */ | 350 | /* Enable the clockwatch on ST Variants */ |
349 | if (vendor->clockwatch) | 351 | if (vendor->clockwatch) |
350 | writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN, | 352 | data |= RTC_CR_CWEN; |
351 | ldata->base + RTC_CR); | 353 | writel(data | RTC_CR_EN, ldata->base + RTC_CR); |
352 | 354 | ||
353 | /* | 355 | /* |
354 | * On ST PL031 variants, the RTC reset value does not provide correct | 356 | * On ST PL031 variants, the RTC reset value does not provide correct |
diff --git a/drivers/rtc/rtc-vt8500.c b/drivers/rtc/rtc-vt8500.c index 00c930f4b6f3..2730533e2d2d 100644 --- a/drivers/rtc/rtc-vt8500.c +++ b/drivers/rtc/rtc-vt8500.c | |||
@@ -137,7 +137,7 @@ static int vt8500_rtc_set_time(struct device *dev, struct rtc_time *tm) | |||
137 | return -EINVAL; | 137 | return -EINVAL; |
138 | } | 138 | } |
139 | 139 | ||
140 | writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S) | 140 | writel((bin2bcd(tm->tm_year % 100) << DATE_YEAR_S) |
141 | | (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S) | 141 | | (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S) |
142 | | (bin2bcd(tm->tm_mday)) | 142 | | (bin2bcd(tm->tm_mday)) |
143 | | ((tm->tm_year >= 200) << DATE_CENTURY_S), | 143 | | ((tm->tm_year >= 200) << DATE_CENTURY_S), |
diff --git a/drivers/ssb/driver_gpio.c b/drivers/ssb/driver_gpio.c index 97ac0a38e3d0..eb2753008ef0 100644 --- a/drivers/ssb/driver_gpio.c +++ b/drivers/ssb/driver_gpio.c | |||
@@ -174,3 +174,15 @@ int ssb_gpio_init(struct ssb_bus *bus) | |||
174 | 174 | ||
175 | return -1; | 175 | return -1; |
176 | } | 176 | } |
177 | |||
178 | int ssb_gpio_unregister(struct ssb_bus *bus) | ||
179 | { | ||
180 | if (ssb_chipco_available(&bus->chipco) || | ||
181 | ssb_extif_available(&bus->extif)) { | ||
182 | return gpiochip_remove(&bus->gpio); | ||
183 | } else { | ||
184 | SSB_WARN_ON(1); | ||
185 | } | ||
186 | |||
187 | return -1; | ||
188 | } | ||
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index 772ad9b5c304..24dc331b4701 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
@@ -443,6 +443,15 @@ static void ssb_devices_unregister(struct ssb_bus *bus) | |||
443 | 443 | ||
444 | void ssb_bus_unregister(struct ssb_bus *bus) | 444 | void ssb_bus_unregister(struct ssb_bus *bus) |
445 | { | 445 | { |
446 | int err; | ||
447 | |||
448 | err = ssb_gpio_unregister(bus); | ||
449 | if (err == -EBUSY) | ||
450 | ssb_dprintk(KERN_ERR PFX "Some GPIOs are still in use.\n"); | ||
451 | else if (err) | ||
452 | ssb_dprintk(KERN_ERR PFX | ||
453 | "Can not unregister GPIO driver: %i\n", err); | ||
454 | |||
446 | ssb_buses_lock(); | 455 | ssb_buses_lock(); |
447 | ssb_devices_unregister(bus); | 456 | ssb_devices_unregister(bus); |
448 | list_del(&bus->list); | 457 | list_del(&bus->list); |
diff --git a/drivers/ssb/ssb_private.h b/drivers/ssb/ssb_private.h index 6c10b66c796c..da38305a2d22 100644 --- a/drivers/ssb/ssb_private.h +++ b/drivers/ssb/ssb_private.h | |||
@@ -252,11 +252,16 @@ static inline void ssb_extif_init(struct ssb_extif *extif) | |||
252 | 252 | ||
253 | #ifdef CONFIG_SSB_DRIVER_GPIO | 253 | #ifdef CONFIG_SSB_DRIVER_GPIO |
254 | extern int ssb_gpio_init(struct ssb_bus *bus); | 254 | extern int ssb_gpio_init(struct ssb_bus *bus); |
255 | extern int ssb_gpio_unregister(struct ssb_bus *bus); | ||
255 | #else /* CONFIG_SSB_DRIVER_GPIO */ | 256 | #else /* CONFIG_SSB_DRIVER_GPIO */ |
256 | static inline int ssb_gpio_init(struct ssb_bus *bus) | 257 | static inline int ssb_gpio_init(struct ssb_bus *bus) |
257 | { | 258 | { |
258 | return -ENOTSUPP; | 259 | return -ENOTSUPP; |
259 | } | 260 | } |
261 | static inline int ssb_gpio_unregister(struct ssb_bus *bus) | ||
262 | { | ||
263 | return 0; | ||
264 | } | ||
260 | #endif /* CONFIG_SSB_DRIVER_GPIO */ | 265 | #endif /* CONFIG_SSB_DRIVER_GPIO */ |
261 | 266 | ||
262 | #endif /* LINUX_SSB_PRIVATE_H_ */ | 267 | #endif /* LINUX_SSB_PRIVATE_H_ */ |
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index e2695101bb99..f2aa7543d20a 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c | |||
@@ -941,6 +941,8 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth) | |||
941 | 941 | ||
942 | int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors) | 942 | int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors) |
943 | { | 943 | { |
944 | int block_size = dev->dev_attrib.block_size; | ||
945 | |||
944 | if (dev->export_count) { | 946 | if (dev->export_count) { |
945 | pr_err("dev[%p]: Unable to change SE Device" | 947 | pr_err("dev[%p]: Unable to change SE Device" |
946 | " fabric_max_sectors while export_count is %d\n", | 948 | " fabric_max_sectors while export_count is %d\n", |
@@ -978,8 +980,12 @@ int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors) | |||
978 | /* | 980 | /* |
979 | * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks() | 981 | * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks() |
980 | */ | 982 | */ |
983 | if (!block_size) { | ||
984 | block_size = 512; | ||
985 | pr_warn("Defaulting to 512 for zero block_size\n"); | ||
986 | } | ||
981 | fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors, | 987 | fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors, |
982 | dev->dev_attrib.block_size); | 988 | block_size); |
983 | 989 | ||
984 | dev->dev_attrib.fabric_max_sectors = fabric_max_sectors; | 990 | dev->dev_attrib.fabric_max_sectors = fabric_max_sectors; |
985 | pr_debug("dev[%p]: SE Device max_sectors changed to %u\n", | 991 | pr_debug("dev[%p]: SE Device max_sectors changed to %u\n", |
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 810263dfa4a1..c57bbbc7a7d1 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c | |||
@@ -754,6 +754,11 @@ static int target_fabric_port_link( | |||
754 | return -EFAULT; | 754 | return -EFAULT; |
755 | } | 755 | } |
756 | 756 | ||
757 | if (!(dev->dev_flags & DF_CONFIGURED)) { | ||
758 | pr_err("se_device not configured yet, cannot port link\n"); | ||
759 | return -ENODEV; | ||
760 | } | ||
761 | |||
757 | tpg_ci = &lun_ci->ci_parent->ci_group->cg_item; | 762 | tpg_ci = &lun_ci->ci_parent->ci_group->cg_item; |
758 | se_tpg = container_of(to_config_group(tpg_ci), | 763 | se_tpg = container_of(to_config_group(tpg_ci), |
759 | struct se_portal_group, tpg_group); | 764 | struct se_portal_group, tpg_group); |
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 26a6d183ccb1..a664c664a31a 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c | |||
@@ -58,11 +58,10 @@ sbc_emulate_readcapacity(struct se_cmd *cmd) | |||
58 | buf[7] = dev->dev_attrib.block_size & 0xff; | 58 | buf[7] = dev->dev_attrib.block_size & 0xff; |
59 | 59 | ||
60 | rbuf = transport_kmap_data_sg(cmd); | 60 | rbuf = transport_kmap_data_sg(cmd); |
61 | if (!rbuf) | 61 | if (rbuf) { |
62 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 62 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); |
63 | 63 | transport_kunmap_data_sg(cmd); | |
64 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); | 64 | } |
65 | transport_kunmap_data_sg(cmd); | ||
66 | 65 | ||
67 | target_complete_cmd(cmd, GOOD); | 66 | target_complete_cmd(cmd, GOOD); |
68 | return 0; | 67 | return 0; |
@@ -97,11 +96,10 @@ sbc_emulate_readcapacity_16(struct se_cmd *cmd) | |||
97 | buf[14] = 0x80; | 96 | buf[14] = 0x80; |
98 | 97 | ||
99 | rbuf = transport_kmap_data_sg(cmd); | 98 | rbuf = transport_kmap_data_sg(cmd); |
100 | if (!rbuf) | 99 | if (rbuf) { |
101 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 100 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); |
102 | 101 | transport_kunmap_data_sg(cmd); | |
103 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); | 102 | } |
104 | transport_kunmap_data_sg(cmd); | ||
105 | 103 | ||
106 | target_complete_cmd(cmd, GOOD); | 104 | target_complete_cmd(cmd, GOOD); |
107 | return 0; | 105 | return 0; |
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 84f9e96e8ace..2d88f087d961 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c | |||
@@ -641,11 +641,10 @@ spc_emulate_inquiry(struct se_cmd *cmd) | |||
641 | 641 | ||
642 | out: | 642 | out: |
643 | rbuf = transport_kmap_data_sg(cmd); | 643 | rbuf = transport_kmap_data_sg(cmd); |
644 | if (!rbuf) | 644 | if (rbuf) { |
645 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 645 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); |
646 | 646 | transport_kunmap_data_sg(cmd); | |
647 | memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); | 647 | } |
648 | transport_kunmap_data_sg(cmd); | ||
649 | 648 | ||
650 | if (!ret) | 649 | if (!ret) |
651 | target_complete_cmd(cmd, GOOD); | 650 | target_complete_cmd(cmd, GOOD); |
@@ -851,7 +850,7 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd) | |||
851 | { | 850 | { |
852 | struct se_device *dev = cmd->se_dev; | 851 | struct se_device *dev = cmd->se_dev; |
853 | char *cdb = cmd->t_task_cdb; | 852 | char *cdb = cmd->t_task_cdb; |
854 | unsigned char *buf, *map_buf; | 853 | unsigned char buf[SE_MODE_PAGE_BUF], *rbuf; |
855 | int type = dev->transport->get_device_type(dev); | 854 | int type = dev->transport->get_device_type(dev); |
856 | int ten = (cmd->t_task_cdb[0] == MODE_SENSE_10); | 855 | int ten = (cmd->t_task_cdb[0] == MODE_SENSE_10); |
857 | bool dbd = !!(cdb[1] & 0x08); | 856 | bool dbd = !!(cdb[1] & 0x08); |
@@ -863,26 +862,8 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd) | |||
863 | int ret; | 862 | int ret; |
864 | int i; | 863 | int i; |
865 | 864 | ||
866 | map_buf = transport_kmap_data_sg(cmd); | 865 | memset(buf, 0, SE_MODE_PAGE_BUF); |
867 | if (!map_buf) | 866 | |
868 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | ||
869 | /* | ||
870 | * If SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC is not set, then we | ||
871 | * know we actually allocated a full page. Otherwise, if the | ||
872 | * data buffer is too small, allocate a temporary buffer so we | ||
873 | * don't have to worry about overruns in all our INQUIRY | ||
874 | * emulation handling. | ||
875 | */ | ||
876 | if (cmd->data_length < SE_MODE_PAGE_BUF && | ||
877 | (cmd->se_cmd_flags & SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC)) { | ||
878 | buf = kzalloc(SE_MODE_PAGE_BUF, GFP_KERNEL); | ||
879 | if (!buf) { | ||
880 | transport_kunmap_data_sg(cmd); | ||
881 | return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | ||
882 | } | ||
883 | } else { | ||
884 | buf = map_buf; | ||
885 | } | ||
886 | /* | 867 | /* |
887 | * Skip over MODE DATA LENGTH + MEDIUM TYPE fields to byte 3 for | 868 | * Skip over MODE DATA LENGTH + MEDIUM TYPE fields to byte 3 for |
888 | * MODE_SENSE_10 and byte 2 for MODE_SENSE (6). | 869 | * MODE_SENSE_10 and byte 2 for MODE_SENSE (6). |
@@ -934,8 +915,6 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd) | |||
934 | if (page == 0x3f) { | 915 | if (page == 0x3f) { |
935 | if (subpage != 0x00 && subpage != 0xff) { | 916 | if (subpage != 0x00 && subpage != 0xff) { |
936 | pr_warn("MODE_SENSE: Invalid subpage code: 0x%02x\n", subpage); | 917 | pr_warn("MODE_SENSE: Invalid subpage code: 0x%02x\n", subpage); |
937 | kfree(buf); | ||
938 | transport_kunmap_data_sg(cmd); | ||
939 | return TCM_INVALID_CDB_FIELD; | 918 | return TCM_INVALID_CDB_FIELD; |
940 | } | 919 | } |
941 | 920 | ||
@@ -972,7 +951,6 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd) | |||
972 | pr_err("MODE SENSE: unimplemented page/subpage: 0x%02x/0x%02x\n", | 951 | pr_err("MODE SENSE: unimplemented page/subpage: 0x%02x/0x%02x\n", |
973 | page, subpage); | 952 | page, subpage); |
974 | 953 | ||
975 | transport_kunmap_data_sg(cmd); | ||
976 | return TCM_UNKNOWN_MODE_PAGE; | 954 | return TCM_UNKNOWN_MODE_PAGE; |
977 | 955 | ||
978 | set_length: | 956 | set_length: |
@@ -981,12 +959,12 @@ set_length: | |||
981 | else | 959 | else |
982 | buf[0] = length - 1; | 960 | buf[0] = length - 1; |
983 | 961 | ||
984 | if (buf != map_buf) { | 962 | rbuf = transport_kmap_data_sg(cmd); |
985 | memcpy(map_buf, buf, cmd->data_length); | 963 | if (rbuf) { |
986 | kfree(buf); | 964 | memcpy(rbuf, buf, min_t(u32, SE_MODE_PAGE_BUF, cmd->data_length)); |
965 | transport_kunmap_data_sg(cmd); | ||
987 | } | 966 | } |
988 | 967 | ||
989 | transport_kunmap_data_sg(cmd); | ||
990 | target_complete_cmd(cmd, GOOD); | 968 | target_complete_cmd(cmd, GOOD); |
991 | return 0; | 969 | return 0; |
992 | } | 970 | } |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 4225d5e72131..8e64adf8e4d5 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <asm/unaligned.h> | 39 | #include <asm/unaligned.h> |
40 | #include <linux/platform_device.h> | 40 | #include <linux/platform_device.h> |
41 | #include <linux/workqueue.h> | 41 | #include <linux/workqueue.h> |
42 | #include <linux/pm_runtime.h> | ||
42 | 43 | ||
43 | #include <linux/usb.h> | 44 | #include <linux/usb.h> |
44 | #include <linux/usb/hcd.h> | 45 | #include <linux/usb/hcd.h> |
@@ -1025,6 +1026,49 @@ static int register_root_hub(struct usb_hcd *hcd) | |||
1025 | return retval; | 1026 | return retval; |
1026 | } | 1027 | } |
1027 | 1028 | ||
1029 | /* | ||
1030 | * usb_hcd_start_port_resume - a root-hub port is sending a resume signal | ||
1031 | * @bus: the bus which the root hub belongs to | ||
1032 | * @portnum: the port which is being resumed | ||
1033 | * | ||
1034 | * HCDs should call this function when they know that a resume signal is | ||
1035 | * being sent to a root-hub port. The root hub will be prevented from | ||
1036 | * going into autosuspend until usb_hcd_end_port_resume() is called. | ||
1037 | * | ||
1038 | * The bus's private lock must be held by the caller. | ||
1039 | */ | ||
1040 | void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum) | ||
1041 | { | ||
1042 | unsigned bit = 1 << portnum; | ||
1043 | |||
1044 | if (!(bus->resuming_ports & bit)) { | ||
1045 | bus->resuming_ports |= bit; | ||
1046 | pm_runtime_get_noresume(&bus->root_hub->dev); | ||
1047 | } | ||
1048 | } | ||
1049 | EXPORT_SYMBOL_GPL(usb_hcd_start_port_resume); | ||
1050 | |||
1051 | /* | ||
1052 | * usb_hcd_end_port_resume - a root-hub port has stopped sending a resume signal | ||
1053 | * @bus: the bus which the root hub belongs to | ||
1054 | * @portnum: the port which is being resumed | ||
1055 | * | ||
1056 | * HCDs should call this function when they know that a resume signal has | ||
1057 | * stopped being sent to a root-hub port. The root hub will be allowed to | ||
1058 | * autosuspend again. | ||
1059 | * | ||
1060 | * The bus's private lock must be held by the caller. | ||
1061 | */ | ||
1062 | void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum) | ||
1063 | { | ||
1064 | unsigned bit = 1 << portnum; | ||
1065 | |||
1066 | if (bus->resuming_ports & bit) { | ||
1067 | bus->resuming_ports &= ~bit; | ||
1068 | pm_runtime_put_noidle(&bus->root_hub->dev); | ||
1069 | } | ||
1070 | } | ||
1071 | EXPORT_SYMBOL_GPL(usb_hcd_end_port_resume); | ||
1028 | 1072 | ||
1029 | /*-------------------------------------------------------------------------*/ | 1073 | /*-------------------------------------------------------------------------*/ |
1030 | 1074 | ||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 957ed2c41482..cbf7168e3ce7 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -2838,6 +2838,23 @@ void usb_enable_ltm(struct usb_device *udev) | |||
2838 | EXPORT_SYMBOL_GPL(usb_enable_ltm); | 2838 | EXPORT_SYMBOL_GPL(usb_enable_ltm); |
2839 | 2839 | ||
2840 | #ifdef CONFIG_USB_SUSPEND | 2840 | #ifdef CONFIG_USB_SUSPEND |
2841 | /* | ||
2842 | * usb_disable_function_remotewakeup - disable usb3.0 | ||
2843 | * device's function remote wakeup | ||
2844 | * @udev: target device | ||
2845 | * | ||
2846 | * Assume there's only one function on the USB 3.0 | ||
2847 | * device and disable remote wake for the first | ||
2848 | * interface. FIXME if the interface association | ||
2849 | * descriptor shows there's more than one function. | ||
2850 | */ | ||
2851 | static int usb_disable_function_remotewakeup(struct usb_device *udev) | ||
2852 | { | ||
2853 | return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | ||
2854 | USB_REQ_CLEAR_FEATURE, USB_RECIP_INTERFACE, | ||
2855 | USB_INTRF_FUNC_SUSPEND, 0, NULL, 0, | ||
2856 | USB_CTRL_SET_TIMEOUT); | ||
2857 | } | ||
2841 | 2858 | ||
2842 | /* | 2859 | /* |
2843 | * usb_port_suspend - suspend a usb device's upstream port | 2860 | * usb_port_suspend - suspend a usb device's upstream port |
@@ -2955,12 +2972,19 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg) | |||
2955 | dev_dbg(hub->intfdev, "can't suspend port %d, status %d\n", | 2972 | dev_dbg(hub->intfdev, "can't suspend port %d, status %d\n", |
2956 | port1, status); | 2973 | port1, status); |
2957 | /* paranoia: "should not happen" */ | 2974 | /* paranoia: "should not happen" */ |
2958 | if (udev->do_remote_wakeup) | 2975 | if (udev->do_remote_wakeup) { |
2959 | (void) usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 2976 | if (!hub_is_superspeed(hub->hdev)) { |
2960 | USB_REQ_CLEAR_FEATURE, USB_RECIP_DEVICE, | 2977 | (void) usb_control_msg(udev, |
2961 | USB_DEVICE_REMOTE_WAKEUP, 0, | 2978 | usb_sndctrlpipe(udev, 0), |
2962 | NULL, 0, | 2979 | USB_REQ_CLEAR_FEATURE, |
2963 | USB_CTRL_SET_TIMEOUT); | 2980 | USB_RECIP_DEVICE, |
2981 | USB_DEVICE_REMOTE_WAKEUP, 0, | ||
2982 | NULL, 0, | ||
2983 | USB_CTRL_SET_TIMEOUT); | ||
2984 | } else | ||
2985 | (void) usb_disable_function_remotewakeup(udev); | ||
2986 | |||
2987 | } | ||
2964 | 2988 | ||
2965 | /* Try to enable USB2 hardware LPM again */ | 2989 | /* Try to enable USB2 hardware LPM again */ |
2966 | if (udev->usb2_hw_lpm_capable == 1) | 2990 | if (udev->usb2_hw_lpm_capable == 1) |
@@ -3052,20 +3076,30 @@ static int finish_port_resume(struct usb_device *udev) | |||
3052 | * udev->reset_resume | 3076 | * udev->reset_resume |
3053 | */ | 3077 | */ |
3054 | } else if (udev->actconfig && !udev->reset_resume) { | 3078 | } else if (udev->actconfig && !udev->reset_resume) { |
3055 | le16_to_cpus(&devstatus); | 3079 | if (!hub_is_superspeed(udev->parent)) { |
3056 | if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) { | 3080 | le16_to_cpus(&devstatus); |
3057 | status = usb_control_msg(udev, | 3081 | if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) |
3058 | usb_sndctrlpipe(udev, 0), | 3082 | status = usb_control_msg(udev, |
3059 | USB_REQ_CLEAR_FEATURE, | 3083 | usb_sndctrlpipe(udev, 0), |
3084 | USB_REQ_CLEAR_FEATURE, | ||
3060 | USB_RECIP_DEVICE, | 3085 | USB_RECIP_DEVICE, |
3061 | USB_DEVICE_REMOTE_WAKEUP, 0, | 3086 | USB_DEVICE_REMOTE_WAKEUP, 0, |
3062 | NULL, 0, | 3087 | NULL, 0, |
3063 | USB_CTRL_SET_TIMEOUT); | 3088 | USB_CTRL_SET_TIMEOUT); |
3064 | if (status) | 3089 | } else { |
3065 | dev_dbg(&udev->dev, | 3090 | status = usb_get_status(udev, USB_RECIP_INTERFACE, 0, |
3066 | "disable remote wakeup, status %d\n", | 3091 | &devstatus); |
3067 | status); | 3092 | le16_to_cpus(&devstatus); |
3093 | if (!status && devstatus & (USB_INTRF_STAT_FUNC_RW_CAP | ||
3094 | | USB_INTRF_STAT_FUNC_RW)) | ||
3095 | status = | ||
3096 | usb_disable_function_remotewakeup(udev); | ||
3068 | } | 3097 | } |
3098 | |||
3099 | if (status) | ||
3100 | dev_dbg(&udev->dev, | ||
3101 | "disable remote wakeup, status %d\n", | ||
3102 | status); | ||
3069 | status = 0; | 3103 | status = 0; |
3070 | } | 3104 | } |
3071 | return status; | 3105 | return status; |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 09537b2f1002..b416a3fc9959 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -797,6 +797,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | |||
797 | ehci->reset_done[i] = jiffies + msecs_to_jiffies(25); | 797 | ehci->reset_done[i] = jiffies + msecs_to_jiffies(25); |
798 | set_bit(i, &ehci->resuming_ports); | 798 | set_bit(i, &ehci->resuming_ports); |
799 | ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); | 799 | ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); |
800 | usb_hcd_start_port_resume(&hcd->self, i); | ||
800 | mod_timer(&hcd->rh_timer, ehci->reset_done[i]); | 801 | mod_timer(&hcd->rh_timer, ehci->reset_done[i]); |
801 | } | 802 | } |
802 | } | 803 | } |
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 4ccb97c0678f..4d3b294f203e 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -649,7 +649,11 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf) | |||
649 | status = STS_PCD; | 649 | status = STS_PCD; |
650 | } | 650 | } |
651 | } | 651 | } |
652 | /* FIXME autosuspend idle root hubs */ | 652 | |
653 | /* If a resume is in progress, make sure it can finish */ | ||
654 | if (ehci->resuming_ports) | ||
655 | mod_timer(&hcd->rh_timer, jiffies + msecs_to_jiffies(25)); | ||
656 | |||
653 | spin_unlock_irqrestore (&ehci->lock, flags); | 657 | spin_unlock_irqrestore (&ehci->lock, flags); |
654 | return status ? retval : 0; | 658 | return status ? retval : 0; |
655 | } | 659 | } |
@@ -851,6 +855,7 @@ static int ehci_hub_control ( | |||
851 | /* resume signaling for 20 msec */ | 855 | /* resume signaling for 20 msec */ |
852 | ehci->reset_done[wIndex] = jiffies | 856 | ehci->reset_done[wIndex] = jiffies |
853 | + msecs_to_jiffies(20); | 857 | + msecs_to_jiffies(20); |
858 | usb_hcd_start_port_resume(&hcd->self, wIndex); | ||
854 | /* check the port again */ | 859 | /* check the port again */ |
855 | mod_timer(&ehci_to_hcd(ehci)->rh_timer, | 860 | mod_timer(&ehci_to_hcd(ehci)->rh_timer, |
856 | ehci->reset_done[wIndex]); | 861 | ehci->reset_done[wIndex]); |
@@ -862,6 +867,7 @@ static int ehci_hub_control ( | |||
862 | clear_bit(wIndex, &ehci->suspended_ports); | 867 | clear_bit(wIndex, &ehci->suspended_ports); |
863 | set_bit(wIndex, &ehci->port_c_suspend); | 868 | set_bit(wIndex, &ehci->port_c_suspend); |
864 | ehci->reset_done[wIndex] = 0; | 869 | ehci->reset_done[wIndex] = 0; |
870 | usb_hcd_end_port_resume(&hcd->self, wIndex); | ||
865 | 871 | ||
866 | /* stop resume signaling */ | 872 | /* stop resume signaling */ |
867 | temp = ehci_readl(ehci, status_reg); | 873 | temp = ehci_readl(ehci, status_reg); |
@@ -950,6 +956,7 @@ static int ehci_hub_control ( | |||
950 | ehci->reset_done[wIndex] = 0; | 956 | ehci->reset_done[wIndex] = 0; |
951 | if (temp & PORT_PE) | 957 | if (temp & PORT_PE) |
952 | set_bit(wIndex, &ehci->port_c_suspend); | 958 | set_bit(wIndex, &ehci->port_c_suspend); |
959 | usb_hcd_end_port_resume(&hcd->self, wIndex); | ||
953 | } | 960 | } |
954 | 961 | ||
955 | if (temp & PORT_OC) | 962 | if (temp & PORT_OC) |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 3d989028c836..fd252f0cfb3a 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -1197,17 +1197,26 @@ static void start_iaa_cycle(struct ehci_hcd *ehci, bool nested) | |||
1197 | if (ehci->async_iaa || ehci->async_unlinking) | 1197 | if (ehci->async_iaa || ehci->async_unlinking) |
1198 | return; | 1198 | return; |
1199 | 1199 | ||
1200 | /* Do all the waiting QHs at once */ | ||
1201 | ehci->async_iaa = ehci->async_unlink; | ||
1202 | ehci->async_unlink = NULL; | ||
1203 | |||
1204 | /* If the controller isn't running, we don't have to wait for it */ | 1200 | /* If the controller isn't running, we don't have to wait for it */ |
1205 | if (unlikely(ehci->rh_state < EHCI_RH_RUNNING)) { | 1201 | if (unlikely(ehci->rh_state < EHCI_RH_RUNNING)) { |
1202 | |||
1203 | /* Do all the waiting QHs */ | ||
1204 | ehci->async_iaa = ehci->async_unlink; | ||
1205 | ehci->async_unlink = NULL; | ||
1206 | |||
1206 | if (!nested) /* Avoid recursion */ | 1207 | if (!nested) /* Avoid recursion */ |
1207 | end_unlink_async(ehci); | 1208 | end_unlink_async(ehci); |
1208 | 1209 | ||
1209 | /* Otherwise start a new IAA cycle */ | 1210 | /* Otherwise start a new IAA cycle */ |
1210 | } else if (likely(ehci->rh_state == EHCI_RH_RUNNING)) { | 1211 | } else if (likely(ehci->rh_state == EHCI_RH_RUNNING)) { |
1212 | struct ehci_qh *qh; | ||
1213 | |||
1214 | /* Do only the first waiting QH (nVidia bug?) */ | ||
1215 | qh = ehci->async_unlink; | ||
1216 | ehci->async_iaa = qh; | ||
1217 | ehci->async_unlink = qh->unlink_next; | ||
1218 | qh->unlink_next = NULL; | ||
1219 | |||
1211 | /* Make sure the unlinks are all visible to the hardware */ | 1220 | /* Make sure the unlinks are all visible to the hardware */ |
1212 | wmb(); | 1221 | wmb(); |
1213 | 1222 | ||
@@ -1255,34 +1264,35 @@ static void end_unlink_async(struct ehci_hcd *ehci) | |||
1255 | } | 1264 | } |
1256 | } | 1265 | } |
1257 | 1266 | ||
1267 | static void start_unlink_async(struct ehci_hcd *ehci, struct ehci_qh *qh); | ||
1268 | |||
1258 | static void unlink_empty_async(struct ehci_hcd *ehci) | 1269 | static void unlink_empty_async(struct ehci_hcd *ehci) |
1259 | { | 1270 | { |
1260 | struct ehci_qh *qh, *next; | 1271 | struct ehci_qh *qh; |
1261 | bool stopped = (ehci->rh_state < EHCI_RH_RUNNING); | 1272 | struct ehci_qh *qh_to_unlink = NULL; |
1262 | bool check_unlinks_later = false; | 1273 | bool check_unlinks_later = false; |
1274 | int count = 0; | ||
1263 | 1275 | ||
1264 | /* Unlink all the async QHs that have been empty for a timer cycle */ | 1276 | /* Find the last async QH which has been empty for a timer cycle */ |
1265 | next = ehci->async->qh_next.qh; | 1277 | for (qh = ehci->async->qh_next.qh; qh; qh = qh->qh_next.qh) { |
1266 | while (next) { | ||
1267 | qh = next; | ||
1268 | next = qh->qh_next.qh; | ||
1269 | |||
1270 | if (list_empty(&qh->qtd_list) && | 1278 | if (list_empty(&qh->qtd_list) && |
1271 | qh->qh_state == QH_STATE_LINKED) { | 1279 | qh->qh_state == QH_STATE_LINKED) { |
1272 | if (!stopped && qh->unlink_cycle == | 1280 | ++count; |
1273 | ehci->async_unlink_cycle) | 1281 | if (qh->unlink_cycle == ehci->async_unlink_cycle) |
1274 | check_unlinks_later = true; | 1282 | check_unlinks_later = true; |
1275 | else | 1283 | else |
1276 | single_unlink_async(ehci, qh); | 1284 | qh_to_unlink = qh; |
1277 | } | 1285 | } |
1278 | } | 1286 | } |
1279 | 1287 | ||
1280 | /* Start a new IAA cycle if any QHs are waiting for it */ | 1288 | /* If nothing else is being unlinked, unlink the last empty QH */ |
1281 | if (ehci->async_unlink) | 1289 | if (!ehci->async_iaa && !ehci->async_unlink && qh_to_unlink) { |
1282 | start_iaa_cycle(ehci, false); | 1290 | start_unlink_async(ehci, qh_to_unlink); |
1291 | --count; | ||
1292 | } | ||
1283 | 1293 | ||
1284 | /* QHs that haven't been empty for long enough will be handled later */ | 1294 | /* Other QHs will be handled later */ |
1285 | if (check_unlinks_later) { | 1295 | if (count > 0) { |
1286 | ehci_enable_event(ehci, EHCI_HRTIMER_ASYNC_UNLINKS, true); | 1296 | ehci_enable_event(ehci, EHCI_HRTIMER_ASYNC_UNLINKS, true); |
1287 | ++ehci->async_unlink_cycle; | 1297 | ++ehci->async_unlink_cycle; |
1288 | } | 1298 | } |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 69ebee73c0c1..b476daf49f6f 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -213,7 +213,7 @@ static inline unsigned char tt_start_uframe(struct ehci_hcd *ehci, __hc32 mask) | |||
213 | } | 213 | } |
214 | 214 | ||
215 | static const unsigned char | 215 | static const unsigned char |
216 | max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 30, 0 }; | 216 | max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 125, 25 }; |
217 | 217 | ||
218 | /* carryover low/fullspeed bandwidth that crosses uframe boundries */ | 218 | /* carryover low/fullspeed bandwidth that crosses uframe boundries */ |
219 | static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]) | 219 | static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]) |
@@ -2212,11 +2212,11 @@ static void scan_isoc(struct ehci_hcd *ehci) | |||
2212 | } | 2212 | } |
2213 | ehci->now_frame = now_frame; | 2213 | ehci->now_frame = now_frame; |
2214 | 2214 | ||
2215 | frame = ehci->last_iso_frame; | ||
2215 | for (;;) { | 2216 | for (;;) { |
2216 | union ehci_shadow q, *q_p; | 2217 | union ehci_shadow q, *q_p; |
2217 | __hc32 type, *hw_p; | 2218 | __hc32 type, *hw_p; |
2218 | 2219 | ||
2219 | frame = ehci->last_iso_frame; | ||
2220 | restart: | 2220 | restart: |
2221 | /* scan each element in frame's queue for completions */ | 2221 | /* scan each element in frame's queue for completions */ |
2222 | q_p = &ehci->pshadow [frame]; | 2222 | q_p = &ehci->pshadow [frame]; |
@@ -2321,6 +2321,9 @@ restart: | |||
2321 | /* Stop when we have reached the current frame */ | 2321 | /* Stop when we have reached the current frame */ |
2322 | if (frame == now_frame) | 2322 | if (frame == now_frame) |
2323 | break; | 2323 | break; |
2324 | ehci->last_iso_frame = (frame + 1) & fmask; | 2324 | |
2325 | /* The last frame may still have active siTDs */ | ||
2326 | ehci->last_iso_frame = frame; | ||
2327 | frame = (frame + 1) & fmask; | ||
2325 | } | 2328 | } |
2326 | } | 2329 | } |
diff --git a/drivers/usb/host/ehci-timer.c b/drivers/usb/host/ehci-timer.c index 20dbdcbe9b0f..f904071d70df 100644 --- a/drivers/usb/host/ehci-timer.c +++ b/drivers/usb/host/ehci-timer.c | |||
@@ -113,14 +113,15 @@ static void ehci_poll_ASS(struct ehci_hcd *ehci) | |||
113 | 113 | ||
114 | if (want != actual) { | 114 | if (want != actual) { |
115 | 115 | ||
116 | /* Poll again later, but give up after about 20 ms */ | 116 | /* Poll again later */ |
117 | if (ehci->ASS_poll_count++ < 20) { | 117 | ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true); |
118 | ehci_enable_event(ehci, EHCI_HRTIMER_POLL_ASS, true); | 118 | ++ehci->ASS_poll_count; |
119 | return; | 119 | return; |
120 | } | ||
121 | ehci_dbg(ehci, "Waited too long for the async schedule status (%x/%x), giving up\n", | ||
122 | want, actual); | ||
123 | } | 120 | } |
121 | |||
122 | if (ehci->ASS_poll_count > 20) | ||
123 | ehci_dbg(ehci, "ASS poll count reached %d\n", | ||
124 | ehci->ASS_poll_count); | ||
124 | ehci->ASS_poll_count = 0; | 125 | ehci->ASS_poll_count = 0; |
125 | 126 | ||
126 | /* The status is up-to-date; restart or stop the schedule as needed */ | 127 | /* The status is up-to-date; restart or stop the schedule as needed */ |
@@ -159,14 +160,14 @@ static void ehci_poll_PSS(struct ehci_hcd *ehci) | |||
159 | 160 | ||
160 | if (want != actual) { | 161 | if (want != actual) { |
161 | 162 | ||
162 | /* Poll again later, but give up after about 20 ms */ | 163 | /* Poll again later */ |
163 | if (ehci->PSS_poll_count++ < 20) { | 164 | ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true); |
164 | ehci_enable_event(ehci, EHCI_HRTIMER_POLL_PSS, true); | 165 | return; |
165 | return; | ||
166 | } | ||
167 | ehci_dbg(ehci, "Waited too long for the periodic schedule status (%x/%x), giving up\n", | ||
168 | want, actual); | ||
169 | } | 166 | } |
167 | |||
168 | if (ehci->PSS_poll_count > 20) | ||
169 | ehci_dbg(ehci, "PSS poll count reached %d\n", | ||
170 | ehci->PSS_poll_count); | ||
170 | ehci->PSS_poll_count = 0; | 171 | ehci->PSS_poll_count = 0; |
171 | 172 | ||
172 | /* The status is up-to-date; restart or stop the schedule as needed */ | 173 | /* The status is up-to-date; restart or stop the schedule as needed */ |
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index a3b6d7104ae2..4c338ec03a07 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
@@ -780,6 +780,7 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev) | |||
780 | "defaulting to EHCI.\n"); | 780 | "defaulting to EHCI.\n"); |
781 | dev_warn(&xhci_pdev->dev, | 781 | dev_warn(&xhci_pdev->dev, |
782 | "USB 3.0 devices will work at USB 2.0 speeds.\n"); | 782 | "USB 3.0 devices will work at USB 2.0 speeds.\n"); |
783 | usb_disable_xhci_ports(xhci_pdev); | ||
783 | return; | 784 | return; |
784 | } | 785 | } |
785 | 786 | ||
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c index 768d54295a20..15d13229ddbb 100644 --- a/drivers/usb/host/uhci-hub.c +++ b/drivers/usb/host/uhci-hub.c | |||
@@ -116,6 +116,7 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, | |||
116 | } | 116 | } |
117 | } | 117 | } |
118 | clear_bit(port, &uhci->resuming_ports); | 118 | clear_bit(port, &uhci->resuming_ports); |
119 | usb_hcd_end_port_resume(&uhci_to_hcd(uhci)->self, port); | ||
119 | } | 120 | } |
120 | 121 | ||
121 | /* Wait for the UHCI controller in HP's iLO2 server management chip. | 122 | /* Wait for the UHCI controller in HP's iLO2 server management chip. |
@@ -167,6 +168,8 @@ static void uhci_check_ports(struct uhci_hcd *uhci) | |||
167 | set_bit(port, &uhci->resuming_ports); | 168 | set_bit(port, &uhci->resuming_ports); |
168 | uhci->ports_timeout = jiffies + | 169 | uhci->ports_timeout = jiffies + |
169 | msecs_to_jiffies(25); | 170 | msecs_to_jiffies(25); |
171 | usb_hcd_start_port_resume( | ||
172 | &uhci_to_hcd(uhci)->self, port); | ||
170 | 173 | ||
171 | /* Make sure we see the port again | 174 | /* Make sure we see the port again |
172 | * after the resuming period is over. */ | 175 | * after the resuming period is over. */ |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 59fb5c677dbe..7f76a49e90d3 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -1698,7 +1698,7 @@ static void handle_port_status(struct xhci_hcd *xhci, | |||
1698 | faked_port_index + 1); | 1698 | faked_port_index + 1); |
1699 | if (slot_id && xhci->devs[slot_id]) | 1699 | if (slot_id && xhci->devs[slot_id]) |
1700 | xhci_ring_device(xhci, slot_id); | 1700 | xhci_ring_device(xhci, slot_id); |
1701 | if (bus_state->port_remote_wakeup && (1 << faked_port_index)) { | 1701 | if (bus_state->port_remote_wakeup & (1 << faked_port_index)) { |
1702 | bus_state->port_remote_wakeup &= | 1702 | bus_state->port_remote_wakeup &= |
1703 | ~(1 << faked_port_index); | 1703 | ~(1 << faked_port_index); |
1704 | xhci_test_and_clear_bit(xhci, port_array, | 1704 | xhci_test_and_clear_bit(xhci, port_array, |
@@ -2589,6 +2589,8 @@ cleanup: | |||
2589 | (trb_comp_code != COMP_STALL && | 2589 | (trb_comp_code != COMP_STALL && |
2590 | trb_comp_code != COMP_BABBLE)) | 2590 | trb_comp_code != COMP_BABBLE)) |
2591 | xhci_urb_free_priv(xhci, urb_priv); | 2591 | xhci_urb_free_priv(xhci, urb_priv); |
2592 | else | ||
2593 | kfree(urb_priv); | ||
2592 | 2594 | ||
2593 | usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb); | 2595 | usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb); |
2594 | if ((urb->actual_length != urb->transfer_buffer_length && | 2596 | if ((urb->actual_length != urb->transfer_buffer_length && |
@@ -3108,7 +3110,7 @@ static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len, | |||
3108 | * running_total. | 3110 | * running_total. |
3109 | */ | 3111 | */ |
3110 | packets_transferred = (running_total + trb_buff_len) / | 3112 | packets_transferred = (running_total + trb_buff_len) / |
3111 | usb_endpoint_maxp(&urb->ep->desc); | 3113 | GET_MAX_PACKET(usb_endpoint_maxp(&urb->ep->desc)); |
3112 | 3114 | ||
3113 | if ((total_packet_count - packets_transferred) > 31) | 3115 | if ((total_packet_count - packets_transferred) > 31) |
3114 | return 31 << 17; | 3116 | return 31 << 17; |
@@ -3642,7 +3644,8 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
3642 | td_len = urb->iso_frame_desc[i].length; | 3644 | td_len = urb->iso_frame_desc[i].length; |
3643 | td_remain_len = td_len; | 3645 | td_remain_len = td_len; |
3644 | total_packet_count = DIV_ROUND_UP(td_len, | 3646 | total_packet_count = DIV_ROUND_UP(td_len, |
3645 | usb_endpoint_maxp(&urb->ep->desc)); | 3647 | GET_MAX_PACKET( |
3648 | usb_endpoint_maxp(&urb->ep->desc))); | ||
3646 | /* A zero-length transfer still involves at least one packet. */ | 3649 | /* A zero-length transfer still involves at least one packet. */ |
3647 | if (total_packet_count == 0) | 3650 | if (total_packet_count == 0) |
3648 | total_packet_count++; | 3651 | total_packet_count++; |
@@ -3664,9 +3667,11 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
3664 | td = urb_priv->td[i]; | 3667 | td = urb_priv->td[i]; |
3665 | for (j = 0; j < trbs_per_td; j++) { | 3668 | for (j = 0; j < trbs_per_td; j++) { |
3666 | u32 remainder = 0; | 3669 | u32 remainder = 0; |
3667 | field = TRB_TBC(burst_count) | TRB_TLBPC(residue); | 3670 | field = 0; |
3668 | 3671 | ||
3669 | if (first_trb) { | 3672 | if (first_trb) { |
3673 | field = TRB_TBC(burst_count) | | ||
3674 | TRB_TLBPC(residue); | ||
3670 | /* Queue the isoc TRB */ | 3675 | /* Queue the isoc TRB */ |
3671 | field |= TRB_TYPE(TRB_ISOC); | 3676 | field |= TRB_TYPE(TRB_ISOC); |
3672 | /* Assume URB_ISO_ASAP is set */ | 3677 | /* Assume URB_ISO_ASAP is set */ |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index f14736f647ff..edc0f0dcad83 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -60,6 +60,7 @@ static const struct usb_device_id id_table[] = { | |||
60 | { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ | 60 | { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ |
61 | { USB_DEVICE(0x0FCF, 0x1004) }, /* Dynastream ANT2USB */ | 61 | { USB_DEVICE(0x0FCF, 0x1004) }, /* Dynastream ANT2USB */ |
62 | { USB_DEVICE(0x0FCF, 0x1006) }, /* Dynastream ANT development board */ | 62 | { USB_DEVICE(0x0FCF, 0x1006) }, /* Dynastream ANT development board */ |
63 | { USB_DEVICE(0x0FDE, 0xCA05) }, /* OWL Wireless Electricity Monitor CM-160 */ | ||
63 | { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */ | 64 | { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */ |
64 | { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */ | 65 | { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */ |
65 | { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */ | 66 | { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */ |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index ba68835d06a6..90ceef1776c3 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -584,6 +584,7 @@ static struct usb_device_id id_table_combined [] = { | |||
584 | /* | 584 | /* |
585 | * ELV devices: | 585 | * ELV devices: |
586 | */ | 586 | */ |
587 | { USB_DEVICE(FTDI_ELV_VID, FTDI_ELV_WS300_PID) }, | ||
587 | { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, | 588 | { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, |
588 | { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, | 589 | { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, |
589 | { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) }, | 590 | { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) }, |
@@ -670,6 +671,7 @@ static struct usb_device_id id_table_combined [] = { | |||
670 | { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, | 671 | { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, |
671 | { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, | 672 | { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, |
672 | { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, | 673 | { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, |
674 | { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, | ||
673 | { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, | 675 | { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, |
674 | { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, | 676 | { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, |
675 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, | 677 | { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index fa5d56038276..9d359e189a64 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -147,6 +147,11 @@ | |||
147 | #define XSENS_CONVERTER_6_PID 0xD38E | 147 | #define XSENS_CONVERTER_6_PID 0xD38E |
148 | #define XSENS_CONVERTER_7_PID 0xD38F | 148 | #define XSENS_CONVERTER_7_PID 0xD38F |
149 | 149 | ||
150 | /** | ||
151 | * Zolix (www.zolix.com.cb) product ids | ||
152 | */ | ||
153 | #define FTDI_OMNI1509 0xD491 /* Omni1509 embedded USB-serial */ | ||
154 | |||
150 | /* | 155 | /* |
151 | * NDI (www.ndigital.com) product ids | 156 | * NDI (www.ndigital.com) product ids |
152 | */ | 157 | */ |
@@ -204,7 +209,7 @@ | |||
204 | 209 | ||
205 | /* | 210 | /* |
206 | * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). | 211 | * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). |
207 | * All of these devices use FTDI's vendor ID (0x0403). | 212 | * Almost all of these devices use FTDI's vendor ID (0x0403). |
208 | * Further IDs taken from ELV Windows .inf file. | 213 | * Further IDs taken from ELV Windows .inf file. |
209 | * | 214 | * |
210 | * The previously included PID for the UO 100 module was incorrect. | 215 | * The previously included PID for the UO 100 module was incorrect. |
@@ -212,6 +217,8 @@ | |||
212 | * | 217 | * |
213 | * Armin Laeuger originally sent the PID for the UM 100 module. | 218 | * Armin Laeuger originally sent the PID for the UM 100 module. |
214 | */ | 219 | */ |
220 | #define FTDI_ELV_VID 0x1B1F /* ELV AG */ | ||
221 | #define FTDI_ELV_WS300_PID 0xC006 /* eQ3 WS 300 PC II */ | ||
215 | #define FTDI_ELV_USR_PID 0xE000 /* ELV Universal-Sound-Recorder */ | 222 | #define FTDI_ELV_USR_PID 0xE000 /* ELV Universal-Sound-Recorder */ |
216 | #define FTDI_ELV_MSM1_PID 0xE001 /* ELV Mini-Sound-Modul */ | 223 | #define FTDI_ELV_MSM1_PID 0xE001 /* ELV Mini-Sound-Modul */ |
217 | #define FTDI_ELV_KL100_PID 0xE002 /* ELV Kfz-Leistungsmesser KL 100 */ | 224 | #define FTDI_ELV_KL100_PID 0xE002 /* ELV Kfz-Leistungsmesser KL 100 */ |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 0d9dac9e7f93..567bc77d6397 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -242,6 +242,7 @@ static void option_instat_callback(struct urb *urb); | |||
242 | #define TELIT_PRODUCT_CC864_DUAL 0x1005 | 242 | #define TELIT_PRODUCT_CC864_DUAL 0x1005 |
243 | #define TELIT_PRODUCT_CC864_SINGLE 0x1006 | 243 | #define TELIT_PRODUCT_CC864_SINGLE 0x1006 |
244 | #define TELIT_PRODUCT_DE910_DUAL 0x1010 | 244 | #define TELIT_PRODUCT_DE910_DUAL 0x1010 |
245 | #define TELIT_PRODUCT_LE920 0x1200 | ||
245 | 246 | ||
246 | /* ZTE PRODUCTS */ | 247 | /* ZTE PRODUCTS */ |
247 | #define ZTE_VENDOR_ID 0x19d2 | 248 | #define ZTE_VENDOR_ID 0x19d2 |
@@ -453,6 +454,10 @@ static void option_instat_callback(struct urb *urb); | |||
453 | #define TPLINK_VENDOR_ID 0x2357 | 454 | #define TPLINK_VENDOR_ID 0x2357 |
454 | #define TPLINK_PRODUCT_MA180 0x0201 | 455 | #define TPLINK_PRODUCT_MA180 0x0201 |
455 | 456 | ||
457 | /* Changhong products */ | ||
458 | #define CHANGHONG_VENDOR_ID 0x2077 | ||
459 | #define CHANGHONG_PRODUCT_CH690 0x7001 | ||
460 | |||
456 | /* some devices interfaces need special handling due to a number of reasons */ | 461 | /* some devices interfaces need special handling due to a number of reasons */ |
457 | enum option_blacklist_reason { | 462 | enum option_blacklist_reason { |
458 | OPTION_BLACKLIST_NONE = 0, | 463 | OPTION_BLACKLIST_NONE = 0, |
@@ -534,6 +539,11 @@ static const struct option_blacklist_info zte_1255_blacklist = { | |||
534 | .reserved = BIT(3) | BIT(4), | 539 | .reserved = BIT(3) | BIT(4), |
535 | }; | 540 | }; |
536 | 541 | ||
542 | static const struct option_blacklist_info telit_le920_blacklist = { | ||
543 | .sendsetup = BIT(0), | ||
544 | .reserved = BIT(1) | BIT(5), | ||
545 | }; | ||
546 | |||
537 | static const struct usb_device_id option_ids[] = { | 547 | static const struct usb_device_id option_ids[] = { |
538 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, | 548 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
539 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, | 549 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, |
@@ -784,6 +794,8 @@ static const struct usb_device_id option_ids[] = { | |||
784 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) }, | 794 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) }, |
785 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) }, | 795 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) }, |
786 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) }, | 796 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) }, |
797 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), | ||
798 | .driver_info = (kernel_ulong_t)&telit_le920_blacklist }, | ||
787 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ | 799 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ |
788 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff), | 800 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff), |
789 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, | 801 | .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, |
@@ -1318,6 +1330,7 @@ static const struct usb_device_id option_ids[] = { | |||
1318 | { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, | 1330 | { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, |
1319 | { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), | 1331 | { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), |
1320 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 1332 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1333 | { USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) }, | ||
1321 | { } /* Terminating entry */ | 1334 | { } /* Terminating entry */ |
1322 | }; | 1335 | }; |
1323 | MODULE_DEVICE_TABLE(usb, option_ids); | 1336 | MODULE_DEVICE_TABLE(usb, option_ids); |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index aa148c21ea40..24662547dc5b 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -53,6 +53,7 @@ static const struct usb_device_id id_table[] = { | |||
53 | {DEVICE_G1K(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ | 53 | {DEVICE_G1K(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ |
54 | {DEVICE_G1K(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ | 54 | {DEVICE_G1K(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ |
55 | {DEVICE_G1K(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ | 55 | {DEVICE_G1K(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ |
56 | {DEVICE_G1K(0x1bc7, 0x900e)}, /* Telit Gobi QDL device */ | ||
56 | 57 | ||
57 | /* Gobi 2000 devices */ | 58 | /* Gobi 2000 devices */ |
58 | {USB_DEVICE(0x1410, 0xa010)}, /* Novatel Gobi 2000 QDL device */ | 59 | {USB_DEVICE(0x1410, 0xa010)}, /* Novatel Gobi 2000 QDL device */ |
diff --git a/drivers/usb/storage/initializers.c b/drivers/usb/storage/initializers.c index 105d900150c1..16b0bf055eeb 100644 --- a/drivers/usb/storage/initializers.c +++ b/drivers/usb/storage/initializers.c | |||
@@ -92,8 +92,8 @@ int usb_stor_ucr61s2b_init(struct us_data *us) | |||
92 | return 0; | 92 | return 0; |
93 | } | 93 | } |
94 | 94 | ||
95 | /* This places the HUAWEI E220 devices in multi-port mode */ | 95 | /* This places the HUAWEI usb dongles in multi-port mode */ |
96 | int usb_stor_huawei_e220_init(struct us_data *us) | 96 | static int usb_stor_huawei_feature_init(struct us_data *us) |
97 | { | 97 | { |
98 | int result; | 98 | int result; |
99 | 99 | ||
@@ -104,3 +104,75 @@ int usb_stor_huawei_e220_init(struct us_data *us) | |||
104 | US_DEBUGP("Huawei mode set result is %d\n", result); | 104 | US_DEBUGP("Huawei mode set result is %d\n", result); |
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | |||
108 | /* | ||
109 | * It will send a scsi switch command called rewind' to huawei dongle. | ||
110 | * When the dongle receives this command at the first time, | ||
111 | * it will reboot immediately. After rebooted, it will ignore this command. | ||
112 | * So it is unnecessary to read its response. | ||
113 | */ | ||
114 | static int usb_stor_huawei_scsi_init(struct us_data *us) | ||
115 | { | ||
116 | int result = 0; | ||
117 | int act_len = 0; | ||
118 | struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf; | ||
119 | char rewind_cmd[] = {0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00, | ||
120 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; | ||
121 | |||
122 | bcbw->Signature = cpu_to_le32(US_BULK_CB_SIGN); | ||
123 | bcbw->Tag = 0; | ||
124 | bcbw->DataTransferLength = 0; | ||
125 | bcbw->Flags = bcbw->Lun = 0; | ||
126 | bcbw->Length = sizeof(rewind_cmd); | ||
127 | memset(bcbw->CDB, 0, sizeof(bcbw->CDB)); | ||
128 | memcpy(bcbw->CDB, rewind_cmd, sizeof(rewind_cmd)); | ||
129 | |||
130 | result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcbw, | ||
131 | US_BULK_CB_WRAP_LEN, &act_len); | ||
132 | US_DEBUGP("transfer actual length=%d, result=%d\n", act_len, result); | ||
133 | return result; | ||
134 | } | ||
135 | |||
136 | /* | ||
137 | * It tries to find the supported Huawei USB dongles. | ||
138 | * In Huawei, they assign the following product IDs | ||
139 | * for all of their mobile broadband dongles, | ||
140 | * including the new dongles in the future. | ||
141 | * So if the product ID is not included in this list, | ||
142 | * it means it is not Huawei's mobile broadband dongles. | ||
143 | */ | ||
144 | static int usb_stor_huawei_dongles_pid(struct us_data *us) | ||
145 | { | ||
146 | struct usb_interface_descriptor *idesc; | ||
147 | int idProduct; | ||
148 | |||
149 | idesc = &us->pusb_intf->cur_altsetting->desc; | ||
150 | idProduct = us->pusb_dev->descriptor.idProduct; | ||
151 | /* The first port is CDROM, | ||
152 | * means the dongle in the single port mode, | ||
153 | * and a switch command is required to be sent. */ | ||
154 | if (idesc && idesc->bInterfaceNumber == 0) { | ||
155 | if ((idProduct == 0x1001) | ||
156 | || (idProduct == 0x1003) | ||
157 | || (idProduct == 0x1004) | ||
158 | || (idProduct >= 0x1401 && idProduct <= 0x1500) | ||
159 | || (idProduct >= 0x1505 && idProduct <= 0x1600) | ||
160 | || (idProduct >= 0x1c02 && idProduct <= 0x2202)) { | ||
161 | return 1; | ||
162 | } | ||
163 | } | ||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | int usb_stor_huawei_init(struct us_data *us) | ||
168 | { | ||
169 | int result = 0; | ||
170 | |||
171 | if (usb_stor_huawei_dongles_pid(us)) { | ||
172 | if (us->pusb_dev->descriptor.idProduct >= 0x1446) | ||
173 | result = usb_stor_huawei_scsi_init(us); | ||
174 | else | ||
175 | result = usb_stor_huawei_feature_init(us); | ||
176 | } | ||
177 | return result; | ||
178 | } | ||
diff --git a/drivers/usb/storage/initializers.h b/drivers/usb/storage/initializers.h index 529327fbb06b..5376d4fc76f0 100644 --- a/drivers/usb/storage/initializers.h +++ b/drivers/usb/storage/initializers.h | |||
@@ -46,5 +46,5 @@ int usb_stor_euscsi_init(struct us_data *us); | |||
46 | * flash reader */ | 46 | * flash reader */ |
47 | int usb_stor_ucr61s2b_init(struct us_data *us); | 47 | int usb_stor_ucr61s2b_init(struct us_data *us); |
48 | 48 | ||
49 | /* This places the HUAWEI E220 devices in multi-port mode */ | 49 | /* This places the HUAWEI usb dongles in multi-port mode */ |
50 | int usb_stor_huawei_e220_init(struct us_data *us); | 50 | int usb_stor_huawei_init(struct us_data *us); |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index d305a5aa3a5d..72923b56bbf6 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -1527,335 +1527,10 @@ UNUSUAL_DEV( 0x1210, 0x0003, 0x0100, 0x0100, | |||
1527 | /* Reported by fangxiaozhi <huananhu@huawei.com> | 1527 | /* Reported by fangxiaozhi <huananhu@huawei.com> |
1528 | * This brings the HUAWEI data card devices into multi-port mode | 1528 | * This brings the HUAWEI data card devices into multi-port mode |
1529 | */ | 1529 | */ |
1530 | UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000, | 1530 | UNUSUAL_VENDOR_INTF(0x12d1, 0x08, 0x06, 0x50, |
1531 | "HUAWEI MOBILE", | 1531 | "HUAWEI MOBILE", |
1532 | "Mass Storage", | 1532 | "Mass Storage", |
1533 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | 1533 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_init, |
1534 | 0), | ||
1535 | UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000, | ||
1536 | "HUAWEI MOBILE", | ||
1537 | "Mass Storage", | ||
1538 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1539 | 0), | ||
1540 | UNUSUAL_DEV( 0x12d1, 0x1004, 0x0000, 0x0000, | ||
1541 | "HUAWEI MOBILE", | ||
1542 | "Mass Storage", | ||
1543 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1544 | 0), | ||
1545 | UNUSUAL_DEV( 0x12d1, 0x1401, 0x0000, 0x0000, | ||
1546 | "HUAWEI MOBILE", | ||
1547 | "Mass Storage", | ||
1548 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1549 | 0), | ||
1550 | UNUSUAL_DEV( 0x12d1, 0x1402, 0x0000, 0x0000, | ||
1551 | "HUAWEI MOBILE", | ||
1552 | "Mass Storage", | ||
1553 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1554 | 0), | ||
1555 | UNUSUAL_DEV( 0x12d1, 0x1403, 0x0000, 0x0000, | ||
1556 | "HUAWEI MOBILE", | ||
1557 | "Mass Storage", | ||
1558 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1559 | 0), | ||
1560 | UNUSUAL_DEV( 0x12d1, 0x1404, 0x0000, 0x0000, | ||
1561 | "HUAWEI MOBILE", | ||
1562 | "Mass Storage", | ||
1563 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1564 | 0), | ||
1565 | UNUSUAL_DEV( 0x12d1, 0x1405, 0x0000, 0x0000, | ||
1566 | "HUAWEI MOBILE", | ||
1567 | "Mass Storage", | ||
1568 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1569 | 0), | ||
1570 | UNUSUAL_DEV( 0x12d1, 0x1406, 0x0000, 0x0000, | ||
1571 | "HUAWEI MOBILE", | ||
1572 | "Mass Storage", | ||
1573 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1574 | 0), | ||
1575 | UNUSUAL_DEV( 0x12d1, 0x1407, 0x0000, 0x0000, | ||
1576 | "HUAWEI MOBILE", | ||
1577 | "Mass Storage", | ||
1578 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1579 | 0), | ||
1580 | UNUSUAL_DEV( 0x12d1, 0x1408, 0x0000, 0x0000, | ||
1581 | "HUAWEI MOBILE", | ||
1582 | "Mass Storage", | ||
1583 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1584 | 0), | ||
1585 | UNUSUAL_DEV( 0x12d1, 0x1409, 0x0000, 0x0000, | ||
1586 | "HUAWEI MOBILE", | ||
1587 | "Mass Storage", | ||
1588 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1589 | 0), | ||
1590 | UNUSUAL_DEV( 0x12d1, 0x140A, 0x0000, 0x0000, | ||
1591 | "HUAWEI MOBILE", | ||
1592 | "Mass Storage", | ||
1593 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1594 | 0), | ||
1595 | UNUSUAL_DEV( 0x12d1, 0x140B, 0x0000, 0x0000, | ||
1596 | "HUAWEI MOBILE", | ||
1597 | "Mass Storage", | ||
1598 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1599 | 0), | ||
1600 | UNUSUAL_DEV( 0x12d1, 0x140C, 0x0000, 0x0000, | ||
1601 | "HUAWEI MOBILE", | ||
1602 | "Mass Storage", | ||
1603 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1604 | 0), | ||
1605 | UNUSUAL_DEV( 0x12d1, 0x140D, 0x0000, 0x0000, | ||
1606 | "HUAWEI MOBILE", | ||
1607 | "Mass Storage", | ||
1608 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1609 | 0), | ||
1610 | UNUSUAL_DEV( 0x12d1, 0x140E, 0x0000, 0x0000, | ||
1611 | "HUAWEI MOBILE", | ||
1612 | "Mass Storage", | ||
1613 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1614 | 0), | ||
1615 | UNUSUAL_DEV( 0x12d1, 0x140F, 0x0000, 0x0000, | ||
1616 | "HUAWEI MOBILE", | ||
1617 | "Mass Storage", | ||
1618 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1619 | 0), | ||
1620 | UNUSUAL_DEV( 0x12d1, 0x1410, 0x0000, 0x0000, | ||
1621 | "HUAWEI MOBILE", | ||
1622 | "Mass Storage", | ||
1623 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1624 | 0), | ||
1625 | UNUSUAL_DEV( 0x12d1, 0x1411, 0x0000, 0x0000, | ||
1626 | "HUAWEI MOBILE", | ||
1627 | "Mass Storage", | ||
1628 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1629 | 0), | ||
1630 | UNUSUAL_DEV( 0x12d1, 0x1412, 0x0000, 0x0000, | ||
1631 | "HUAWEI MOBILE", | ||
1632 | "Mass Storage", | ||
1633 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1634 | 0), | ||
1635 | UNUSUAL_DEV( 0x12d1, 0x1413, 0x0000, 0x0000, | ||
1636 | "HUAWEI MOBILE", | ||
1637 | "Mass Storage", | ||
1638 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1639 | 0), | ||
1640 | UNUSUAL_DEV( 0x12d1, 0x1414, 0x0000, 0x0000, | ||
1641 | "HUAWEI MOBILE", | ||
1642 | "Mass Storage", | ||
1643 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1644 | 0), | ||
1645 | UNUSUAL_DEV( 0x12d1, 0x1415, 0x0000, 0x0000, | ||
1646 | "HUAWEI MOBILE", | ||
1647 | "Mass Storage", | ||
1648 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1649 | 0), | ||
1650 | UNUSUAL_DEV( 0x12d1, 0x1416, 0x0000, 0x0000, | ||
1651 | "HUAWEI MOBILE", | ||
1652 | "Mass Storage", | ||
1653 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1654 | 0), | ||
1655 | UNUSUAL_DEV( 0x12d1, 0x1417, 0x0000, 0x0000, | ||
1656 | "HUAWEI MOBILE", | ||
1657 | "Mass Storage", | ||
1658 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1659 | 0), | ||
1660 | UNUSUAL_DEV( 0x12d1, 0x1418, 0x0000, 0x0000, | ||
1661 | "HUAWEI MOBILE", | ||
1662 | "Mass Storage", | ||
1663 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1664 | 0), | ||
1665 | UNUSUAL_DEV( 0x12d1, 0x1419, 0x0000, 0x0000, | ||
1666 | "HUAWEI MOBILE", | ||
1667 | "Mass Storage", | ||
1668 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1669 | 0), | ||
1670 | UNUSUAL_DEV( 0x12d1, 0x141A, 0x0000, 0x0000, | ||
1671 | "HUAWEI MOBILE", | ||
1672 | "Mass Storage", | ||
1673 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1674 | 0), | ||
1675 | UNUSUAL_DEV( 0x12d1, 0x141B, 0x0000, 0x0000, | ||
1676 | "HUAWEI MOBILE", | ||
1677 | "Mass Storage", | ||
1678 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1679 | 0), | ||
1680 | UNUSUAL_DEV( 0x12d1, 0x141C, 0x0000, 0x0000, | ||
1681 | "HUAWEI MOBILE", | ||
1682 | "Mass Storage", | ||
1683 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1684 | 0), | ||
1685 | UNUSUAL_DEV( 0x12d1, 0x141D, 0x0000, 0x0000, | ||
1686 | "HUAWEI MOBILE", | ||
1687 | "Mass Storage", | ||
1688 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1689 | 0), | ||
1690 | UNUSUAL_DEV( 0x12d1, 0x141E, 0x0000, 0x0000, | ||
1691 | "HUAWEI MOBILE", | ||
1692 | "Mass Storage", | ||
1693 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1694 | 0), | ||
1695 | UNUSUAL_DEV( 0x12d1, 0x141F, 0x0000, 0x0000, | ||
1696 | "HUAWEI MOBILE", | ||
1697 | "Mass Storage", | ||
1698 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1699 | 0), | ||
1700 | UNUSUAL_DEV( 0x12d1, 0x1420, 0x0000, 0x0000, | ||
1701 | "HUAWEI MOBILE", | ||
1702 | "Mass Storage", | ||
1703 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1704 | 0), | ||
1705 | UNUSUAL_DEV( 0x12d1, 0x1421, 0x0000, 0x0000, | ||
1706 | "HUAWEI MOBILE", | ||
1707 | "Mass Storage", | ||
1708 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1709 | 0), | ||
1710 | UNUSUAL_DEV( 0x12d1, 0x1422, 0x0000, 0x0000, | ||
1711 | "HUAWEI MOBILE", | ||
1712 | "Mass Storage", | ||
1713 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1714 | 0), | ||
1715 | UNUSUAL_DEV( 0x12d1, 0x1423, 0x0000, 0x0000, | ||
1716 | "HUAWEI MOBILE", | ||
1717 | "Mass Storage", | ||
1718 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1719 | 0), | ||
1720 | UNUSUAL_DEV( 0x12d1, 0x1424, 0x0000, 0x0000, | ||
1721 | "HUAWEI MOBILE", | ||
1722 | "Mass Storage", | ||
1723 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1724 | 0), | ||
1725 | UNUSUAL_DEV( 0x12d1, 0x1425, 0x0000, 0x0000, | ||
1726 | "HUAWEI MOBILE", | ||
1727 | "Mass Storage", | ||
1728 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1729 | 0), | ||
1730 | UNUSUAL_DEV( 0x12d1, 0x1426, 0x0000, 0x0000, | ||
1731 | "HUAWEI MOBILE", | ||
1732 | "Mass Storage", | ||
1733 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1734 | 0), | ||
1735 | UNUSUAL_DEV( 0x12d1, 0x1427, 0x0000, 0x0000, | ||
1736 | "HUAWEI MOBILE", | ||
1737 | "Mass Storage", | ||
1738 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1739 | 0), | ||
1740 | UNUSUAL_DEV( 0x12d1, 0x1428, 0x0000, 0x0000, | ||
1741 | "HUAWEI MOBILE", | ||
1742 | "Mass Storage", | ||
1743 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1744 | 0), | ||
1745 | UNUSUAL_DEV( 0x12d1, 0x1429, 0x0000, 0x0000, | ||
1746 | "HUAWEI MOBILE", | ||
1747 | "Mass Storage", | ||
1748 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1749 | 0), | ||
1750 | UNUSUAL_DEV( 0x12d1, 0x142A, 0x0000, 0x0000, | ||
1751 | "HUAWEI MOBILE", | ||
1752 | "Mass Storage", | ||
1753 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1754 | 0), | ||
1755 | UNUSUAL_DEV( 0x12d1, 0x142B, 0x0000, 0x0000, | ||
1756 | "HUAWEI MOBILE", | ||
1757 | "Mass Storage", | ||
1758 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1759 | 0), | ||
1760 | UNUSUAL_DEV( 0x12d1, 0x142C, 0x0000, 0x0000, | ||
1761 | "HUAWEI MOBILE", | ||
1762 | "Mass Storage", | ||
1763 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1764 | 0), | ||
1765 | UNUSUAL_DEV( 0x12d1, 0x142D, 0x0000, 0x0000, | ||
1766 | "HUAWEI MOBILE", | ||
1767 | "Mass Storage", | ||
1768 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1769 | 0), | ||
1770 | UNUSUAL_DEV( 0x12d1, 0x142E, 0x0000, 0x0000, | ||
1771 | "HUAWEI MOBILE", | ||
1772 | "Mass Storage", | ||
1773 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1774 | 0), | ||
1775 | UNUSUAL_DEV( 0x12d1, 0x142F, 0x0000, 0x0000, | ||
1776 | "HUAWEI MOBILE", | ||
1777 | "Mass Storage", | ||
1778 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1779 | 0), | ||
1780 | UNUSUAL_DEV( 0x12d1, 0x1430, 0x0000, 0x0000, | ||
1781 | "HUAWEI MOBILE", | ||
1782 | "Mass Storage", | ||
1783 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1784 | 0), | ||
1785 | UNUSUAL_DEV( 0x12d1, 0x1431, 0x0000, 0x0000, | ||
1786 | "HUAWEI MOBILE", | ||
1787 | "Mass Storage", | ||
1788 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1789 | 0), | ||
1790 | UNUSUAL_DEV( 0x12d1, 0x1432, 0x0000, 0x0000, | ||
1791 | "HUAWEI MOBILE", | ||
1792 | "Mass Storage", | ||
1793 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1794 | 0), | ||
1795 | UNUSUAL_DEV( 0x12d1, 0x1433, 0x0000, 0x0000, | ||
1796 | "HUAWEI MOBILE", | ||
1797 | "Mass Storage", | ||
1798 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1799 | 0), | ||
1800 | UNUSUAL_DEV( 0x12d1, 0x1434, 0x0000, 0x0000, | ||
1801 | "HUAWEI MOBILE", | ||
1802 | "Mass Storage", | ||
1803 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1804 | 0), | ||
1805 | UNUSUAL_DEV( 0x12d1, 0x1435, 0x0000, 0x0000, | ||
1806 | "HUAWEI MOBILE", | ||
1807 | "Mass Storage", | ||
1808 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1809 | 0), | ||
1810 | UNUSUAL_DEV( 0x12d1, 0x1436, 0x0000, 0x0000, | ||
1811 | "HUAWEI MOBILE", | ||
1812 | "Mass Storage", | ||
1813 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1814 | 0), | ||
1815 | UNUSUAL_DEV( 0x12d1, 0x1437, 0x0000, 0x0000, | ||
1816 | "HUAWEI MOBILE", | ||
1817 | "Mass Storage", | ||
1818 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1819 | 0), | ||
1820 | UNUSUAL_DEV( 0x12d1, 0x1438, 0x0000, 0x0000, | ||
1821 | "HUAWEI MOBILE", | ||
1822 | "Mass Storage", | ||
1823 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1824 | 0), | ||
1825 | UNUSUAL_DEV( 0x12d1, 0x1439, 0x0000, 0x0000, | ||
1826 | "HUAWEI MOBILE", | ||
1827 | "Mass Storage", | ||
1828 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1829 | 0), | ||
1830 | UNUSUAL_DEV( 0x12d1, 0x143A, 0x0000, 0x0000, | ||
1831 | "HUAWEI MOBILE", | ||
1832 | "Mass Storage", | ||
1833 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1834 | 0), | ||
1835 | UNUSUAL_DEV( 0x12d1, 0x143B, 0x0000, 0x0000, | ||
1836 | "HUAWEI MOBILE", | ||
1837 | "Mass Storage", | ||
1838 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1839 | 0), | ||
1840 | UNUSUAL_DEV( 0x12d1, 0x143C, 0x0000, 0x0000, | ||
1841 | "HUAWEI MOBILE", | ||
1842 | "Mass Storage", | ||
1843 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1844 | 0), | ||
1845 | UNUSUAL_DEV( 0x12d1, 0x143D, 0x0000, 0x0000, | ||
1846 | "HUAWEI MOBILE", | ||
1847 | "Mass Storage", | ||
1848 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1849 | 0), | ||
1850 | UNUSUAL_DEV( 0x12d1, 0x143E, 0x0000, 0x0000, | ||
1851 | "HUAWEI MOBILE", | ||
1852 | "Mass Storage", | ||
1853 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1854 | 0), | ||
1855 | UNUSUAL_DEV( 0x12d1, 0x143F, 0x0000, 0x0000, | ||
1856 | "HUAWEI MOBILE", | ||
1857 | "Mass Storage", | ||
1858 | USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init, | ||
1859 | 0), | 1534 | 0), |
1860 | 1535 | ||
1861 | /* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */ | 1536 | /* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */ |
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 31b3e1a61bbd..cf09b6ba71ff 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental list of device IDs and their quirks"); | |||
120 | .useTransport = use_transport, \ | 120 | .useTransport = use_transport, \ |
121 | } | 121 | } |
122 | 122 | ||
123 | #define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \ | ||
124 | vendor_name, product_name, use_protocol, use_transport, \ | ||
125 | init_function, Flags) \ | ||
126 | { \ | ||
127 | .vendorName = vendor_name, \ | ||
128 | .productName = product_name, \ | ||
129 | .useProtocol = use_protocol, \ | ||
130 | .useTransport = use_transport, \ | ||
131 | .initFunction = init_function, \ | ||
132 | } | ||
133 | |||
123 | static struct us_unusual_dev us_unusual_dev_list[] = { | 134 | static struct us_unusual_dev us_unusual_dev_list[] = { |
124 | # include "unusual_devs.h" | 135 | # include "unusual_devs.h" |
125 | { } /* Terminating entry */ | 136 | { } /* Terminating entry */ |
@@ -131,6 +142,7 @@ static struct us_unusual_dev for_dynamic_ids = | |||
131 | #undef UNUSUAL_DEV | 142 | #undef UNUSUAL_DEV |
132 | #undef COMPLIANT_DEV | 143 | #undef COMPLIANT_DEV |
133 | #undef USUAL_DEV | 144 | #undef USUAL_DEV |
145 | #undef UNUSUAL_VENDOR_INTF | ||
134 | 146 | ||
135 | #ifdef CONFIG_LOCKDEP | 147 | #ifdef CONFIG_LOCKDEP |
136 | 148 | ||
diff --git a/drivers/usb/storage/usual-tables.c b/drivers/usb/storage/usual-tables.c index b78a526910fb..5ef8ce74aae4 100644 --- a/drivers/usb/storage/usual-tables.c +++ b/drivers/usb/storage/usual-tables.c | |||
@@ -41,6 +41,20 @@ | |||
41 | #define USUAL_DEV(useProto, useTrans) \ | 41 | #define USUAL_DEV(useProto, useTrans) \ |
42 | { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) } | 42 | { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans) } |
43 | 43 | ||
44 | /* Define the device is matched with Vendor ID and interface descriptors */ | ||
45 | #define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \ | ||
46 | vendorName, productName, useProtocol, useTransport, \ | ||
47 | initFunction, flags) \ | ||
48 | { \ | ||
49 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ | ||
50 | | USB_DEVICE_ID_MATCH_VENDOR, \ | ||
51 | .idVendor = (id_vendor), \ | ||
52 | .bInterfaceClass = (cl), \ | ||
53 | .bInterfaceSubClass = (sc), \ | ||
54 | .bInterfaceProtocol = (pr), \ | ||
55 | .driver_info = (flags) \ | ||
56 | } | ||
57 | |||
44 | struct usb_device_id usb_storage_usb_ids[] = { | 58 | struct usb_device_id usb_storage_usb_ids[] = { |
45 | # include "unusual_devs.h" | 59 | # include "unusual_devs.h" |
46 | { } /* Terminating entry */ | 60 | { } /* Terminating entry */ |
@@ -50,6 +64,7 @@ MODULE_DEVICE_TABLE(usb, usb_storage_usb_ids); | |||
50 | #undef UNUSUAL_DEV | 64 | #undef UNUSUAL_DEV |
51 | #undef COMPLIANT_DEV | 65 | #undef COMPLIANT_DEV |
52 | #undef USUAL_DEV | 66 | #undef USUAL_DEV |
67 | #undef UNUSUAL_VENDOR_INTF | ||
53 | 68 | ||
54 | /* | 69 | /* |
55 | * The table of devices to ignore | 70 | * The table of devices to ignore |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index ebd08b21b234..959b1cd89e6a 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -165,12 +165,16 @@ static void tx_poll_stop(struct vhost_net *net) | |||
165 | } | 165 | } |
166 | 166 | ||
167 | /* Caller must have TX VQ lock */ | 167 | /* Caller must have TX VQ lock */ |
168 | static void tx_poll_start(struct vhost_net *net, struct socket *sock) | 168 | static int tx_poll_start(struct vhost_net *net, struct socket *sock) |
169 | { | 169 | { |
170 | int ret; | ||
171 | |||
170 | if (unlikely(net->tx_poll_state != VHOST_NET_POLL_STOPPED)) | 172 | if (unlikely(net->tx_poll_state != VHOST_NET_POLL_STOPPED)) |
171 | return; | 173 | return 0; |
172 | vhost_poll_start(net->poll + VHOST_NET_VQ_TX, sock->file); | 174 | ret = vhost_poll_start(net->poll + VHOST_NET_VQ_TX, sock->file); |
173 | net->tx_poll_state = VHOST_NET_POLL_STARTED; | 175 | if (!ret) |
176 | net->tx_poll_state = VHOST_NET_POLL_STARTED; | ||
177 | return ret; | ||
174 | } | 178 | } |
175 | 179 | ||
176 | /* In case of DMA done not in order in lower device driver for some reason. | 180 | /* In case of DMA done not in order in lower device driver for some reason. |
@@ -642,20 +646,23 @@ static void vhost_net_disable_vq(struct vhost_net *n, | |||
642 | vhost_poll_stop(n->poll + VHOST_NET_VQ_RX); | 646 | vhost_poll_stop(n->poll + VHOST_NET_VQ_RX); |
643 | } | 647 | } |
644 | 648 | ||
645 | static void vhost_net_enable_vq(struct vhost_net *n, | 649 | static int vhost_net_enable_vq(struct vhost_net *n, |
646 | struct vhost_virtqueue *vq) | 650 | struct vhost_virtqueue *vq) |
647 | { | 651 | { |
648 | struct socket *sock; | 652 | struct socket *sock; |
653 | int ret; | ||
649 | 654 | ||
650 | sock = rcu_dereference_protected(vq->private_data, | 655 | sock = rcu_dereference_protected(vq->private_data, |
651 | lockdep_is_held(&vq->mutex)); | 656 | lockdep_is_held(&vq->mutex)); |
652 | if (!sock) | 657 | if (!sock) |
653 | return; | 658 | return 0; |
654 | if (vq == n->vqs + VHOST_NET_VQ_TX) { | 659 | if (vq == n->vqs + VHOST_NET_VQ_TX) { |
655 | n->tx_poll_state = VHOST_NET_POLL_STOPPED; | 660 | n->tx_poll_state = VHOST_NET_POLL_STOPPED; |
656 | tx_poll_start(n, sock); | 661 | ret = tx_poll_start(n, sock); |
657 | } else | 662 | } else |
658 | vhost_poll_start(n->poll + VHOST_NET_VQ_RX, sock->file); | 663 | ret = vhost_poll_start(n->poll + VHOST_NET_VQ_RX, sock->file); |
664 | |||
665 | return ret; | ||
659 | } | 666 | } |
660 | 667 | ||
661 | static struct socket *vhost_net_stop_vq(struct vhost_net *n, | 668 | static struct socket *vhost_net_stop_vq(struct vhost_net *n, |
@@ -827,15 +834,18 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
827 | r = PTR_ERR(ubufs); | 834 | r = PTR_ERR(ubufs); |
828 | goto err_ubufs; | 835 | goto err_ubufs; |
829 | } | 836 | } |
830 | oldubufs = vq->ubufs; | 837 | |
831 | vq->ubufs = ubufs; | ||
832 | vhost_net_disable_vq(n, vq); | 838 | vhost_net_disable_vq(n, vq); |
833 | rcu_assign_pointer(vq->private_data, sock); | 839 | rcu_assign_pointer(vq->private_data, sock); |
834 | vhost_net_enable_vq(n, vq); | ||
835 | |||
836 | r = vhost_init_used(vq); | 840 | r = vhost_init_used(vq); |
837 | if (r) | 841 | if (r) |
838 | goto err_vq; | 842 | goto err_used; |
843 | r = vhost_net_enable_vq(n, vq); | ||
844 | if (r) | ||
845 | goto err_used; | ||
846 | |||
847 | oldubufs = vq->ubufs; | ||
848 | vq->ubufs = ubufs; | ||
839 | 849 | ||
840 | n->tx_packets = 0; | 850 | n->tx_packets = 0; |
841 | n->tx_zcopy_err = 0; | 851 | n->tx_zcopy_err = 0; |
@@ -859,6 +869,11 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
859 | mutex_unlock(&n->dev.mutex); | 869 | mutex_unlock(&n->dev.mutex); |
860 | return 0; | 870 | return 0; |
861 | 871 | ||
872 | err_used: | ||
873 | rcu_assign_pointer(vq->private_data, oldsock); | ||
874 | vhost_net_enable_vq(n, vq); | ||
875 | if (ubufs) | ||
876 | vhost_ubuf_put_and_wait(ubufs); | ||
862 | err_ubufs: | 877 | err_ubufs: |
863 | fput(sock->file); | 878 | fput(sock->file); |
864 | err_vq: | 879 | err_vq: |
diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index b20df5c829f5..22321cf84fbe 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c | |||
@@ -575,10 +575,8 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs) | |||
575 | 575 | ||
576 | /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */ | 576 | /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */ |
577 | tv_tpg = vs->vs_tpg; | 577 | tv_tpg = vs->vs_tpg; |
578 | if (unlikely(!tv_tpg)) { | 578 | if (unlikely(!tv_tpg)) |
579 | pr_err("%s endpoint not set\n", __func__); | ||
580 | return; | 579 | return; |
581 | } | ||
582 | 580 | ||
583 | mutex_lock(&vq->mutex); | 581 | mutex_lock(&vq->mutex); |
584 | vhost_disable_notify(&vs->dev, vq); | 582 | vhost_disable_notify(&vs->dev, vq); |
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 34389f75fe65..9759249e6d90 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -77,26 +77,38 @@ void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, | |||
77 | init_poll_funcptr(&poll->table, vhost_poll_func); | 77 | init_poll_funcptr(&poll->table, vhost_poll_func); |
78 | poll->mask = mask; | 78 | poll->mask = mask; |
79 | poll->dev = dev; | 79 | poll->dev = dev; |
80 | poll->wqh = NULL; | ||
80 | 81 | ||
81 | vhost_work_init(&poll->work, fn); | 82 | vhost_work_init(&poll->work, fn); |
82 | } | 83 | } |
83 | 84 | ||
84 | /* Start polling a file. We add ourselves to file's wait queue. The caller must | 85 | /* Start polling a file. We add ourselves to file's wait queue. The caller must |
85 | * keep a reference to a file until after vhost_poll_stop is called. */ | 86 | * keep a reference to a file until after vhost_poll_stop is called. */ |
86 | void vhost_poll_start(struct vhost_poll *poll, struct file *file) | 87 | int vhost_poll_start(struct vhost_poll *poll, struct file *file) |
87 | { | 88 | { |
88 | unsigned long mask; | 89 | unsigned long mask; |
90 | int ret = 0; | ||
89 | 91 | ||
90 | mask = file->f_op->poll(file, &poll->table); | 92 | mask = file->f_op->poll(file, &poll->table); |
91 | if (mask) | 93 | if (mask) |
92 | vhost_poll_wakeup(&poll->wait, 0, 0, (void *)mask); | 94 | vhost_poll_wakeup(&poll->wait, 0, 0, (void *)mask); |
95 | if (mask & POLLERR) { | ||
96 | if (poll->wqh) | ||
97 | remove_wait_queue(poll->wqh, &poll->wait); | ||
98 | ret = -EINVAL; | ||
99 | } | ||
100 | |||
101 | return ret; | ||
93 | } | 102 | } |
94 | 103 | ||
95 | /* Stop polling a file. After this function returns, it becomes safe to drop the | 104 | /* Stop polling a file. After this function returns, it becomes safe to drop the |
96 | * file reference. You must also flush afterwards. */ | 105 | * file reference. You must also flush afterwards. */ |
97 | void vhost_poll_stop(struct vhost_poll *poll) | 106 | void vhost_poll_stop(struct vhost_poll *poll) |
98 | { | 107 | { |
99 | remove_wait_queue(poll->wqh, &poll->wait); | 108 | if (poll->wqh) { |
109 | remove_wait_queue(poll->wqh, &poll->wait); | ||
110 | poll->wqh = NULL; | ||
111 | } | ||
100 | } | 112 | } |
101 | 113 | ||
102 | static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, | 114 | static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, |
@@ -792,7 +804,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp) | |||
792 | fput(filep); | 804 | fput(filep); |
793 | 805 | ||
794 | if (pollstart && vq->handle_kick) | 806 | if (pollstart && vq->handle_kick) |
795 | vhost_poll_start(&vq->poll, vq->kick); | 807 | r = vhost_poll_start(&vq->poll, vq->kick); |
796 | 808 | ||
797 | mutex_unlock(&vq->mutex); | 809 | mutex_unlock(&vq->mutex); |
798 | 810 | ||
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 2639c58b23ab..17261e277c02 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h | |||
@@ -42,7 +42,7 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work); | |||
42 | 42 | ||
43 | void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, | 43 | void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, |
44 | unsigned long mask, struct vhost_dev *dev); | 44 | unsigned long mask, struct vhost_dev *dev); |
45 | void vhost_poll_start(struct vhost_poll *poll, struct file *file); | 45 | int vhost_poll_start(struct vhost_poll *poll, struct file *file); |
46 | void vhost_poll_stop(struct vhost_poll *poll); | 46 | void vhost_poll_stop(struct vhost_poll *poll); |
47 | void vhost_poll_flush(struct vhost_poll *poll); | 47 | void vhost_poll_flush(struct vhost_poll *poll); |
48 | void vhost_poll_queue(struct vhost_poll *poll); | 48 | void vhost_poll_queue(struct vhost_poll *poll); |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 0be4df39e953..74d77dfa5f63 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -840,7 +840,7 @@ int bind_evtchn_to_irq(unsigned int evtchn) | |||
840 | 840 | ||
841 | if (irq == -1) { | 841 | if (irq == -1) { |
842 | irq = xen_allocate_irq_dynamic(); | 842 | irq = xen_allocate_irq_dynamic(); |
843 | if (irq == -1) | 843 | if (irq < 0) |
844 | goto out; | 844 | goto out; |
845 | 845 | ||
846 | irq_set_chip_and_handler_name(irq, &xen_dynamic_chip, | 846 | irq_set_chip_and_handler_name(irq, &xen_dynamic_chip, |
@@ -944,7 +944,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu) | |||
944 | 944 | ||
945 | if (irq == -1) { | 945 | if (irq == -1) { |
946 | irq = xen_allocate_irq_dynamic(); | 946 | irq = xen_allocate_irq_dynamic(); |
947 | if (irq == -1) | 947 | if (irq < 0) |
948 | goto out; | 948 | goto out; |
949 | 949 | ||
950 | irq_set_chip_and_handler_name(irq, &xen_percpu_chip, | 950 | irq_set_chip_and_handler_name(irq, &xen_percpu_chip, |
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c index 97f5d264c31e..37c1f825f513 100644 --- a/drivers/xen/xen-pciback/pciback_ops.c +++ b/drivers/xen/xen-pciback/pciback_ops.c | |||
@@ -135,7 +135,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, | |||
135 | struct pci_dev *dev, struct xen_pci_op *op) | 135 | struct pci_dev *dev, struct xen_pci_op *op) |
136 | { | 136 | { |
137 | struct xen_pcibk_dev_data *dev_data; | 137 | struct xen_pcibk_dev_data *dev_data; |
138 | int otherend = pdev->xdev->otherend_id; | ||
139 | int status; | 138 | int status; |
140 | 139 | ||
141 | if (unlikely(verbose_request)) | 140 | if (unlikely(verbose_request)) |
@@ -144,8 +143,9 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev, | |||
144 | status = pci_enable_msi(dev); | 143 | status = pci_enable_msi(dev); |
145 | 144 | ||
146 | if (status) { | 145 | if (status) { |
147 | printk(KERN_ERR "error enable msi for guest %x status %x\n", | 146 | pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI for guest %u: err %d\n", |
148 | otherend, status); | 147 | pci_name(dev), pdev->xdev->otherend_id, |
148 | status); | ||
149 | op->value = 0; | 149 | op->value = 0; |
150 | return XEN_PCI_ERR_op_failed; | 150 | return XEN_PCI_ERR_op_failed; |
151 | } | 151 | } |
@@ -223,10 +223,10 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev, | |||
223 | pci_name(dev), i, | 223 | pci_name(dev), i, |
224 | op->msix_entries[i].vector); | 224 | op->msix_entries[i].vector); |
225 | } | 225 | } |
226 | } else { | 226 | } else |
227 | printk(KERN_WARNING DRV_NAME ": %s: failed to enable MSI-X: err %d!\n", | 227 | pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI-X for guest %u: err %d!\n", |
228 | pci_name(dev), result); | 228 | pci_name(dev), pdev->xdev->otherend_id, |
229 | } | 229 | result); |
230 | kfree(entries); | 230 | kfree(entries); |
231 | 231 | ||
232 | op->value = result; | 232 | op->value = result; |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a8b8adc05070..5a3327b8f90d 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -4534,7 +4534,7 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes) | |||
4534 | unsigned nr_extents = 0; | 4534 | unsigned nr_extents = 0; |
4535 | int extra_reserve = 0; | 4535 | int extra_reserve = 0; |
4536 | enum btrfs_reserve_flush_enum flush = BTRFS_RESERVE_FLUSH_ALL; | 4536 | enum btrfs_reserve_flush_enum flush = BTRFS_RESERVE_FLUSH_ALL; |
4537 | int ret; | 4537 | int ret = 0; |
4538 | bool delalloc_lock = true; | 4538 | bool delalloc_lock = true; |
4539 | 4539 | ||
4540 | /* If we are a free space inode we need to not flush since we will be in | 4540 | /* If we are a free space inode we need to not flush since we will be in |
@@ -4579,20 +4579,18 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes) | |||
4579 | csum_bytes = BTRFS_I(inode)->csum_bytes; | 4579 | csum_bytes = BTRFS_I(inode)->csum_bytes; |
4580 | spin_unlock(&BTRFS_I(inode)->lock); | 4580 | spin_unlock(&BTRFS_I(inode)->lock); |
4581 | 4581 | ||
4582 | if (root->fs_info->quota_enabled) { | 4582 | if (root->fs_info->quota_enabled) |
4583 | ret = btrfs_qgroup_reserve(root, num_bytes + | 4583 | ret = btrfs_qgroup_reserve(root, num_bytes + |
4584 | nr_extents * root->leafsize); | 4584 | nr_extents * root->leafsize); |
4585 | if (ret) { | ||
4586 | spin_lock(&BTRFS_I(inode)->lock); | ||
4587 | calc_csum_metadata_size(inode, num_bytes, 0); | ||
4588 | spin_unlock(&BTRFS_I(inode)->lock); | ||
4589 | if (delalloc_lock) | ||
4590 | mutex_unlock(&BTRFS_I(inode)->delalloc_mutex); | ||
4591 | return ret; | ||
4592 | } | ||
4593 | } | ||
4594 | 4585 | ||
4595 | ret = reserve_metadata_bytes(root, block_rsv, to_reserve, flush); | 4586 | /* |
4587 | * ret != 0 here means the qgroup reservation failed, we go straight to | ||
4588 | * the shared error handling then. | ||
4589 | */ | ||
4590 | if (ret == 0) | ||
4591 | ret = reserve_metadata_bytes(root, block_rsv, | ||
4592 | to_reserve, flush); | ||
4593 | |||
4596 | if (ret) { | 4594 | if (ret) { |
4597 | u64 to_free = 0; | 4595 | u64 to_free = 0; |
4598 | unsigned dropped; | 4596 | unsigned dropped; |
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 2e8cae63d247..fdb7a8db3b57 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c | |||
@@ -288,7 +288,8 @@ out: | |||
288 | void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em) | 288 | void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em) |
289 | { | 289 | { |
290 | clear_bit(EXTENT_FLAG_LOGGING, &em->flags); | 290 | clear_bit(EXTENT_FLAG_LOGGING, &em->flags); |
291 | try_merge_map(tree, em); | 291 | if (em->in_tree) |
292 | try_merge_map(tree, em); | ||
292 | } | 293 | } |
293 | 294 | ||
294 | /** | 295 | /** |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index f76b1fd160d4..aeb84469d2c4 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -293,15 +293,24 @@ static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info, | |||
293 | struct btrfs_key key; | 293 | struct btrfs_key key; |
294 | struct btrfs_ioctl_defrag_range_args range; | 294 | struct btrfs_ioctl_defrag_range_args range; |
295 | int num_defrag; | 295 | int num_defrag; |
296 | int index; | ||
297 | int ret; | ||
296 | 298 | ||
297 | /* get the inode */ | 299 | /* get the inode */ |
298 | key.objectid = defrag->root; | 300 | key.objectid = defrag->root; |
299 | btrfs_set_key_type(&key, BTRFS_ROOT_ITEM_KEY); | 301 | btrfs_set_key_type(&key, BTRFS_ROOT_ITEM_KEY); |
300 | key.offset = (u64)-1; | 302 | key.offset = (u64)-1; |
303 | |||
304 | index = srcu_read_lock(&fs_info->subvol_srcu); | ||
305 | |||
301 | inode_root = btrfs_read_fs_root_no_name(fs_info, &key); | 306 | inode_root = btrfs_read_fs_root_no_name(fs_info, &key); |
302 | if (IS_ERR(inode_root)) { | 307 | if (IS_ERR(inode_root)) { |
303 | kmem_cache_free(btrfs_inode_defrag_cachep, defrag); | 308 | ret = PTR_ERR(inode_root); |
304 | return PTR_ERR(inode_root); | 309 | goto cleanup; |
310 | } | ||
311 | if (btrfs_root_refs(&inode_root->root_item) == 0) { | ||
312 | ret = -ENOENT; | ||
313 | goto cleanup; | ||
305 | } | 314 | } |
306 | 315 | ||
307 | key.objectid = defrag->ino; | 316 | key.objectid = defrag->ino; |
@@ -309,9 +318,10 @@ static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info, | |||
309 | key.offset = 0; | 318 | key.offset = 0; |
310 | inode = btrfs_iget(fs_info->sb, &key, inode_root, NULL); | 319 | inode = btrfs_iget(fs_info->sb, &key, inode_root, NULL); |
311 | if (IS_ERR(inode)) { | 320 | if (IS_ERR(inode)) { |
312 | kmem_cache_free(btrfs_inode_defrag_cachep, defrag); | 321 | ret = PTR_ERR(inode); |
313 | return PTR_ERR(inode); | 322 | goto cleanup; |
314 | } | 323 | } |
324 | srcu_read_unlock(&fs_info->subvol_srcu, index); | ||
315 | 325 | ||
316 | /* do a chunk of defrag */ | 326 | /* do a chunk of defrag */ |
317 | clear_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags); | 327 | clear_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags); |
@@ -346,6 +356,10 @@ static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info, | |||
346 | 356 | ||
347 | iput(inode); | 357 | iput(inode); |
348 | return 0; | 358 | return 0; |
359 | cleanup: | ||
360 | srcu_read_unlock(&fs_info->subvol_srcu, index); | ||
361 | kmem_cache_free(btrfs_inode_defrag_cachep, defrag); | ||
362 | return ret; | ||
349 | } | 363 | } |
350 | 364 | ||
351 | /* | 365 | /* |
@@ -1594,9 +1608,10 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, | |||
1594 | if (err < 0 && num_written > 0) | 1608 | if (err < 0 && num_written > 0) |
1595 | num_written = err; | 1609 | num_written = err; |
1596 | } | 1610 | } |
1597 | out: | 1611 | |
1598 | if (sync) | 1612 | if (sync) |
1599 | atomic_dec(&BTRFS_I(inode)->sync_writers); | 1613 | atomic_dec(&BTRFS_I(inode)->sync_writers); |
1614 | out: | ||
1600 | sb_end_write(inode->i_sb); | 1615 | sb_end_write(inode->i_sb); |
1601 | current->backing_dev_info = NULL; | 1616 | current->backing_dev_info = NULL; |
1602 | return num_written ? num_written : err; | 1617 | return num_written ? num_written : err; |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 5b22d45d3c6a..338f2597bf7f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -515,7 +515,6 @@ static noinline int create_subvol(struct btrfs_root *root, | |||
515 | 515 | ||
516 | BUG_ON(ret); | 516 | BUG_ON(ret); |
517 | 517 | ||
518 | d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry)); | ||
519 | fail: | 518 | fail: |
520 | if (async_transid) { | 519 | if (async_transid) { |
521 | *async_transid = trans->transid; | 520 | *async_transid = trans->transid; |
@@ -525,6 +524,10 @@ fail: | |||
525 | } | 524 | } |
526 | if (err && !ret) | 525 | if (err && !ret) |
527 | ret = err; | 526 | ret = err; |
527 | |||
528 | if (!ret) | ||
529 | d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry)); | ||
530 | |||
528 | return ret; | 531 | return ret; |
529 | } | 532 | } |
530 | 533 | ||
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index f10731297040..e5ed56729607 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -836,9 +836,16 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset, | |||
836 | * if the disk i_size is already at the inode->i_size, or | 836 | * if the disk i_size is already at the inode->i_size, or |
837 | * this ordered extent is inside the disk i_size, we're done | 837 | * this ordered extent is inside the disk i_size, we're done |
838 | */ | 838 | */ |
839 | if (disk_i_size == i_size || offset <= disk_i_size) { | 839 | if (disk_i_size == i_size) |
840 | goto out; | ||
841 | |||
842 | /* | ||
843 | * We still need to update disk_i_size if outstanding_isize is greater | ||
844 | * than disk_i_size. | ||
845 | */ | ||
846 | if (offset <= disk_i_size && | ||
847 | (!ordered || ordered->outstanding_isize <= disk_i_size)) | ||
840 | goto out; | 848 | goto out; |
841 | } | ||
842 | 849 | ||
843 | /* | 850 | /* |
844 | * walk backward from this ordered extent to disk_i_size. | 851 | * walk backward from this ordered extent to disk_i_size. |
@@ -870,7 +877,7 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset, | |||
870 | break; | 877 | break; |
871 | if (test->file_offset >= i_size) | 878 | if (test->file_offset >= i_size) |
872 | break; | 879 | break; |
873 | if (test->file_offset >= disk_i_size) { | 880 | if (entry_end(test) > disk_i_size) { |
874 | /* | 881 | /* |
875 | * we don't update disk_i_size now, so record this | 882 | * we don't update disk_i_size now, so record this |
876 | * undealt i_size. Or we will not know the real | 883 | * undealt i_size. Or we will not know the real |
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index bdbb94f245c9..67783e03d121 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -580,20 +580,29 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx) | |||
580 | int corrected = 0; | 580 | int corrected = 0; |
581 | struct btrfs_key key; | 581 | struct btrfs_key key; |
582 | struct inode *inode = NULL; | 582 | struct inode *inode = NULL; |
583 | struct btrfs_fs_info *fs_info; | ||
583 | u64 end = offset + PAGE_SIZE - 1; | 584 | u64 end = offset + PAGE_SIZE - 1; |
584 | struct btrfs_root *local_root; | 585 | struct btrfs_root *local_root; |
586 | int srcu_index; | ||
585 | 587 | ||
586 | key.objectid = root; | 588 | key.objectid = root; |
587 | key.type = BTRFS_ROOT_ITEM_KEY; | 589 | key.type = BTRFS_ROOT_ITEM_KEY; |
588 | key.offset = (u64)-1; | 590 | key.offset = (u64)-1; |
589 | local_root = btrfs_read_fs_root_no_name(fixup->root->fs_info, &key); | 591 | |
590 | if (IS_ERR(local_root)) | 592 | fs_info = fixup->root->fs_info; |
593 | srcu_index = srcu_read_lock(&fs_info->subvol_srcu); | ||
594 | |||
595 | local_root = btrfs_read_fs_root_no_name(fs_info, &key); | ||
596 | if (IS_ERR(local_root)) { | ||
597 | srcu_read_unlock(&fs_info->subvol_srcu, srcu_index); | ||
591 | return PTR_ERR(local_root); | 598 | return PTR_ERR(local_root); |
599 | } | ||
592 | 600 | ||
593 | key.type = BTRFS_INODE_ITEM_KEY; | 601 | key.type = BTRFS_INODE_ITEM_KEY; |
594 | key.objectid = inum; | 602 | key.objectid = inum; |
595 | key.offset = 0; | 603 | key.offset = 0; |
596 | inode = btrfs_iget(fixup->root->fs_info->sb, &key, local_root, NULL); | 604 | inode = btrfs_iget(fs_info->sb, &key, local_root, NULL); |
605 | srcu_read_unlock(&fs_info->subvol_srcu, srcu_index); | ||
597 | if (IS_ERR(inode)) | 606 | if (IS_ERR(inode)) |
598 | return PTR_ERR(inode); | 607 | return PTR_ERR(inode); |
599 | 608 | ||
@@ -606,7 +615,6 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx) | |||
606 | } | 615 | } |
607 | 616 | ||
608 | if (PageUptodate(page)) { | 617 | if (PageUptodate(page)) { |
609 | struct btrfs_fs_info *fs_info; | ||
610 | if (PageDirty(page)) { | 618 | if (PageDirty(page)) { |
611 | /* | 619 | /* |
612 | * we need to write the data to the defect sector. the | 620 | * we need to write the data to the defect sector. the |
@@ -3180,18 +3188,25 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root, void *ctx) | |||
3180 | u64 physical_for_dev_replace; | 3188 | u64 physical_for_dev_replace; |
3181 | u64 len; | 3189 | u64 len; |
3182 | struct btrfs_fs_info *fs_info = nocow_ctx->sctx->dev_root->fs_info; | 3190 | struct btrfs_fs_info *fs_info = nocow_ctx->sctx->dev_root->fs_info; |
3191 | int srcu_index; | ||
3183 | 3192 | ||
3184 | key.objectid = root; | 3193 | key.objectid = root; |
3185 | key.type = BTRFS_ROOT_ITEM_KEY; | 3194 | key.type = BTRFS_ROOT_ITEM_KEY; |
3186 | key.offset = (u64)-1; | 3195 | key.offset = (u64)-1; |
3196 | |||
3197 | srcu_index = srcu_read_lock(&fs_info->subvol_srcu); | ||
3198 | |||
3187 | local_root = btrfs_read_fs_root_no_name(fs_info, &key); | 3199 | local_root = btrfs_read_fs_root_no_name(fs_info, &key); |
3188 | if (IS_ERR(local_root)) | 3200 | if (IS_ERR(local_root)) { |
3201 | srcu_read_unlock(&fs_info->subvol_srcu, srcu_index); | ||
3189 | return PTR_ERR(local_root); | 3202 | return PTR_ERR(local_root); |
3203 | } | ||
3190 | 3204 | ||
3191 | key.type = BTRFS_INODE_ITEM_KEY; | 3205 | key.type = BTRFS_INODE_ITEM_KEY; |
3192 | key.objectid = inum; | 3206 | key.objectid = inum; |
3193 | key.offset = 0; | 3207 | key.offset = 0; |
3194 | inode = btrfs_iget(fs_info->sb, &key, local_root, NULL); | 3208 | inode = btrfs_iget(fs_info->sb, &key, local_root, NULL); |
3209 | srcu_read_unlock(&fs_info->subvol_srcu, srcu_index); | ||
3195 | if (IS_ERR(inode)) | 3210 | if (IS_ERR(inode)) |
3196 | return PTR_ERR(inode); | 3211 | return PTR_ERR(inode); |
3197 | 3212 | ||
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index f15494699f3b..fc03aa60b684 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -333,12 +333,14 @@ start_transaction(struct btrfs_root *root, u64 num_items, int type, | |||
333 | &root->fs_info->trans_block_rsv, | 333 | &root->fs_info->trans_block_rsv, |
334 | num_bytes, flush); | 334 | num_bytes, flush); |
335 | if (ret) | 335 | if (ret) |
336 | return ERR_PTR(ret); | 336 | goto reserve_fail; |
337 | } | 337 | } |
338 | again: | 338 | again: |
339 | h = kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS); | 339 | h = kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS); |
340 | if (!h) | 340 | if (!h) { |
341 | return ERR_PTR(-ENOMEM); | 341 | ret = -ENOMEM; |
342 | goto alloc_fail; | ||
343 | } | ||
342 | 344 | ||
343 | /* | 345 | /* |
344 | * If we are JOIN_NOLOCK we're already committing a transaction and | 346 | * If we are JOIN_NOLOCK we're already committing a transaction and |
@@ -365,11 +367,7 @@ again: | |||
365 | if (ret < 0) { | 367 | if (ret < 0) { |
366 | /* We must get the transaction if we are JOIN_NOLOCK. */ | 368 | /* We must get the transaction if we are JOIN_NOLOCK. */ |
367 | BUG_ON(type == TRANS_JOIN_NOLOCK); | 369 | BUG_ON(type == TRANS_JOIN_NOLOCK); |
368 | 370 | goto join_fail; | |
369 | if (type < TRANS_JOIN_NOLOCK) | ||
370 | sb_end_intwrite(root->fs_info->sb); | ||
371 | kmem_cache_free(btrfs_trans_handle_cachep, h); | ||
372 | return ERR_PTR(ret); | ||
373 | } | 371 | } |
374 | 372 | ||
375 | cur_trans = root->fs_info->running_transaction; | 373 | cur_trans = root->fs_info->running_transaction; |
@@ -410,6 +408,19 @@ got_it: | |||
410 | if (!current->journal_info && type != TRANS_USERSPACE) | 408 | if (!current->journal_info && type != TRANS_USERSPACE) |
411 | current->journal_info = h; | 409 | current->journal_info = h; |
412 | return h; | 410 | return h; |
411 | |||
412 | join_fail: | ||
413 | if (type < TRANS_JOIN_NOLOCK) | ||
414 | sb_end_intwrite(root->fs_info->sb); | ||
415 | kmem_cache_free(btrfs_trans_handle_cachep, h); | ||
416 | alloc_fail: | ||
417 | if (num_bytes) | ||
418 | btrfs_block_rsv_release(root, &root->fs_info->trans_block_rsv, | ||
419 | num_bytes); | ||
420 | reserve_fail: | ||
421 | if (qgroup_reserved) | ||
422 | btrfs_qgroup_free(root, qgroup_reserved); | ||
423 | return ERR_PTR(ret); | ||
413 | } | 424 | } |
414 | 425 | ||
415 | struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root, | 426 | struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root, |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 15f6efdf6463..5cbb7f4b1672 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1556,7 +1556,8 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) | |||
1556 | ret = 0; | 1556 | ret = 0; |
1557 | 1557 | ||
1558 | /* Notify udev that device has changed */ | 1558 | /* Notify udev that device has changed */ |
1559 | btrfs_kobject_uevent(bdev, KOBJ_CHANGE); | 1559 | if (bdev) |
1560 | btrfs_kobject_uevent(bdev, KOBJ_CHANGE); | ||
1560 | 1561 | ||
1561 | error_brelse: | 1562 | error_brelse: |
1562 | brelse(bh); | 1563 | brelse(bh); |
diff --git a/fs/dlm/user.c b/fs/dlm/user.c index 7ff49852b0cb..911649a47dd5 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c | |||
@@ -503,11 +503,11 @@ static ssize_t device_write(struct file *file, const char __user *buf, | |||
503 | #endif | 503 | #endif |
504 | return -EINVAL; | 504 | return -EINVAL; |
505 | 505 | ||
506 | #ifdef CONFIG_COMPAT | 506 | /* |
507 | if (count > sizeof(struct dlm_write_request32) + DLM_RESNAME_MAXLEN) | 507 | * can't compare against COMPAT/dlm_write_request32 because |
508 | #else | 508 | * we don't yet know if is64bit is zero |
509 | */ | ||
509 | if (count > sizeof(struct dlm_write_request) + DLM_RESNAME_MAXLEN) | 510 | if (count > sizeof(struct dlm_write_request) + DLM_RESNAME_MAXLEN) |
510 | #endif | ||
511 | return -EINVAL; | 511 | return -EINVAL; |
512 | 512 | ||
513 | kbuf = kzalloc(count + 1, GFP_NOFS); | 513 | kbuf = kzalloc(count + 1, GFP_NOFS); |
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index dd057bc6b65b..fc8dc20fdeb9 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
@@ -177,11 +177,31 @@ out_nofree: | |||
177 | return mnt; | 177 | return mnt; |
178 | } | 178 | } |
179 | 179 | ||
180 | static int | ||
181 | nfs_namespace_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | ||
182 | { | ||
183 | if (NFS_FH(dentry->d_inode)->size != 0) | ||
184 | return nfs_getattr(mnt, dentry, stat); | ||
185 | generic_fillattr(dentry->d_inode, stat); | ||
186 | return 0; | ||
187 | } | ||
188 | |||
189 | static int | ||
190 | nfs_namespace_setattr(struct dentry *dentry, struct iattr *attr) | ||
191 | { | ||
192 | if (NFS_FH(dentry->d_inode)->size != 0) | ||
193 | return nfs_setattr(dentry, attr); | ||
194 | return -EACCES; | ||
195 | } | ||
196 | |||
180 | const struct inode_operations nfs_mountpoint_inode_operations = { | 197 | const struct inode_operations nfs_mountpoint_inode_operations = { |
181 | .getattr = nfs_getattr, | 198 | .getattr = nfs_getattr, |
199 | .setattr = nfs_setattr, | ||
182 | }; | 200 | }; |
183 | 201 | ||
184 | const struct inode_operations nfs_referral_inode_operations = { | 202 | const struct inode_operations nfs_referral_inode_operations = { |
203 | .getattr = nfs_namespace_getattr, | ||
204 | .setattr = nfs_namespace_setattr, | ||
185 | }; | 205 | }; |
186 | 206 | ||
187 | static void nfs_expire_automounts(struct work_struct *work) | 207 | static void nfs_expire_automounts(struct work_struct *work) |
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index acc347268124..2e9779b58b7a 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c | |||
@@ -236,11 +236,10 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp, | |||
236 | error = nfs4_discover_server_trunking(clp, &old); | 236 | error = nfs4_discover_server_trunking(clp, &old); |
237 | if (error < 0) | 237 | if (error < 0) |
238 | goto error; | 238 | goto error; |
239 | nfs_put_client(clp); | ||
239 | if (clp != old) { | 240 | if (clp != old) { |
240 | clp->cl_preserve_clid = true; | 241 | clp->cl_preserve_clid = true; |
241 | nfs_put_client(clp); | ||
242 | clp = old; | 242 | clp = old; |
243 | atomic_inc(&clp->cl_count); | ||
244 | } | 243 | } |
245 | 244 | ||
246 | return clp; | 245 | return clp; |
@@ -306,7 +305,7 @@ int nfs40_walk_client_list(struct nfs_client *new, | |||
306 | .clientid = new->cl_clientid, | 305 | .clientid = new->cl_clientid, |
307 | .confirm = new->cl_confirm, | 306 | .confirm = new->cl_confirm, |
308 | }; | 307 | }; |
309 | int status; | 308 | int status = -NFS4ERR_STALE_CLIENTID; |
310 | 309 | ||
311 | spin_lock(&nn->nfs_client_lock); | 310 | spin_lock(&nn->nfs_client_lock); |
312 | list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) { | 311 | list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) { |
@@ -332,40 +331,33 @@ int nfs40_walk_client_list(struct nfs_client *new, | |||
332 | 331 | ||
333 | if (prev) | 332 | if (prev) |
334 | nfs_put_client(prev); | 333 | nfs_put_client(prev); |
334 | prev = pos; | ||
335 | 335 | ||
336 | status = nfs4_proc_setclientid_confirm(pos, &clid, cred); | 336 | status = nfs4_proc_setclientid_confirm(pos, &clid, cred); |
337 | if (status == 0) { | 337 | switch (status) { |
338 | case -NFS4ERR_STALE_CLIENTID: | ||
339 | break; | ||
340 | case 0: | ||
338 | nfs4_swap_callback_idents(pos, new); | 341 | nfs4_swap_callback_idents(pos, new); |
339 | 342 | ||
340 | nfs_put_client(pos); | 343 | prev = NULL; |
341 | *result = pos; | 344 | *result = pos; |
342 | dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n", | 345 | dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n", |
343 | __func__, pos, atomic_read(&pos->cl_count)); | 346 | __func__, pos, atomic_read(&pos->cl_count)); |
344 | return 0; | 347 | default: |
345 | } | 348 | goto out; |
346 | if (status != -NFS4ERR_STALE_CLIENTID) { | ||
347 | nfs_put_client(pos); | ||
348 | dprintk("NFS: <-- %s status = %d, no result\n", | ||
349 | __func__, status); | ||
350 | return status; | ||
351 | } | 349 | } |
352 | 350 | ||
353 | spin_lock(&nn->nfs_client_lock); | 351 | spin_lock(&nn->nfs_client_lock); |
354 | prev = pos; | ||
355 | } | 352 | } |
353 | spin_unlock(&nn->nfs_client_lock); | ||
356 | 354 | ||
357 | /* | 355 | /* No match found. The server lost our clientid */ |
358 | * No matching nfs_client found. This should be impossible, | 356 | out: |
359 | * because the new nfs_client has already been added to | ||
360 | * nfs_client_list by nfs_get_client(). | ||
361 | * | ||
362 | * Don't BUG(), since the caller is holding a mutex. | ||
363 | */ | ||
364 | if (prev) | 357 | if (prev) |
365 | nfs_put_client(prev); | 358 | nfs_put_client(prev); |
366 | spin_unlock(&nn->nfs_client_lock); | 359 | dprintk("NFS: <-- %s status = %d\n", __func__, status); |
367 | pr_err("NFS: %s Error: no matching nfs_client found\n", __func__); | 360 | return status; |
368 | return -NFS4ERR_STALE_CLIENTID; | ||
369 | } | 361 | } |
370 | 362 | ||
371 | #ifdef CONFIG_NFS_V4_1 | 363 | #ifdef CONFIG_NFS_V4_1 |
@@ -432,7 +424,7 @@ int nfs41_walk_client_list(struct nfs_client *new, | |||
432 | { | 424 | { |
433 | struct nfs_net *nn = net_generic(new->cl_net, nfs_net_id); | 425 | struct nfs_net *nn = net_generic(new->cl_net, nfs_net_id); |
434 | struct nfs_client *pos, *n, *prev = NULL; | 426 | struct nfs_client *pos, *n, *prev = NULL; |
435 | int error; | 427 | int status = -NFS4ERR_STALE_CLIENTID; |
436 | 428 | ||
437 | spin_lock(&nn->nfs_client_lock); | 429 | spin_lock(&nn->nfs_client_lock); |
438 | list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) { | 430 | list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) { |
@@ -448,14 +440,17 @@ int nfs41_walk_client_list(struct nfs_client *new, | |||
448 | nfs_put_client(prev); | 440 | nfs_put_client(prev); |
449 | prev = pos; | 441 | prev = pos; |
450 | 442 | ||
451 | error = nfs_wait_client_init_complete(pos); | 443 | nfs4_schedule_lease_recovery(pos); |
452 | if (error < 0) { | 444 | status = nfs_wait_client_init_complete(pos); |
445 | if (status < 0) { | ||
453 | nfs_put_client(pos); | 446 | nfs_put_client(pos); |
454 | spin_lock(&nn->nfs_client_lock); | 447 | spin_lock(&nn->nfs_client_lock); |
455 | continue; | 448 | continue; |
456 | } | 449 | } |
457 | 450 | status = pos->cl_cons_state; | |
458 | spin_lock(&nn->nfs_client_lock); | 451 | spin_lock(&nn->nfs_client_lock); |
452 | if (status < 0) | ||
453 | continue; | ||
459 | } | 454 | } |
460 | 455 | ||
461 | if (pos->rpc_ops != new->rpc_ops) | 456 | if (pos->rpc_ops != new->rpc_ops) |
@@ -473,6 +468,7 @@ int nfs41_walk_client_list(struct nfs_client *new, | |||
473 | if (!nfs4_match_serverowners(pos, new)) | 468 | if (!nfs4_match_serverowners(pos, new)) |
474 | continue; | 469 | continue; |
475 | 470 | ||
471 | atomic_inc(&pos->cl_count); | ||
476 | spin_unlock(&nn->nfs_client_lock); | 472 | spin_unlock(&nn->nfs_client_lock); |
477 | dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n", | 473 | dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n", |
478 | __func__, pos, atomic_read(&pos->cl_count)); | 474 | __func__, pos, atomic_read(&pos->cl_count)); |
@@ -481,16 +477,10 @@ int nfs41_walk_client_list(struct nfs_client *new, | |||
481 | return 0; | 477 | return 0; |
482 | } | 478 | } |
483 | 479 | ||
484 | /* | 480 | /* No matching nfs_client found. */ |
485 | * No matching nfs_client found. This should be impossible, | ||
486 | * because the new nfs_client has already been added to | ||
487 | * nfs_client_list by nfs_get_client(). | ||
488 | * | ||
489 | * Don't BUG(), since the caller is holding a mutex. | ||
490 | */ | ||
491 | spin_unlock(&nn->nfs_client_lock); | 481 | spin_unlock(&nn->nfs_client_lock); |
492 | pr_err("NFS: %s Error: no matching nfs_client found\n", __func__); | 482 | dprintk("NFS: <-- %s status = %d\n", __func__, status); |
493 | return -NFS4ERR_STALE_CLIENTID; | 483 | return status; |
494 | } | 484 | } |
495 | #endif /* CONFIG_NFS_V4_1 */ | 485 | #endif /* CONFIG_NFS_V4_1 */ |
496 | 486 | ||
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 9448c579d41a..e61f68d5ef21 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -136,16 +136,11 @@ int nfs40_discover_server_trunking(struct nfs_client *clp, | |||
136 | clp->cl_confirm = clid.confirm; | 136 | clp->cl_confirm = clid.confirm; |
137 | 137 | ||
138 | status = nfs40_walk_client_list(clp, result, cred); | 138 | status = nfs40_walk_client_list(clp, result, cred); |
139 | switch (status) { | 139 | if (status == 0) { |
140 | case -NFS4ERR_STALE_CLIENTID: | ||
141 | set_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); | ||
142 | case 0: | ||
143 | /* Sustain the lease, even if it's empty. If the clientid4 | 140 | /* Sustain the lease, even if it's empty. If the clientid4 |
144 | * goes stale it's of no use for trunking discovery. */ | 141 | * goes stale it's of no use for trunking discovery. */ |
145 | nfs4_schedule_state_renewal(*result); | 142 | nfs4_schedule_state_renewal(*result); |
146 | break; | ||
147 | } | 143 | } |
148 | |||
149 | out: | 144 | out: |
150 | return status; | 145 | return status; |
151 | } | 146 | } |
@@ -1863,6 +1858,7 @@ again: | |||
1863 | case -ETIMEDOUT: | 1858 | case -ETIMEDOUT: |
1864 | case -EAGAIN: | 1859 | case -EAGAIN: |
1865 | ssleep(1); | 1860 | ssleep(1); |
1861 | case -NFS4ERR_STALE_CLIENTID: | ||
1866 | dprintk("NFS: %s after status %d, retrying\n", | 1862 | dprintk("NFS: %s after status %d, retrying\n", |
1867 | __func__, status); | 1863 | __func__, status); |
1868 | goto again; | 1864 | goto again; |
@@ -2022,8 +2018,18 @@ static int nfs4_reset_session(struct nfs_client *clp) | |||
2022 | nfs4_begin_drain_session(clp); | 2018 | nfs4_begin_drain_session(clp); |
2023 | cred = nfs4_get_exchange_id_cred(clp); | 2019 | cred = nfs4_get_exchange_id_cred(clp); |
2024 | status = nfs4_proc_destroy_session(clp->cl_session, cred); | 2020 | status = nfs4_proc_destroy_session(clp->cl_session, cred); |
2025 | if (status && status != -NFS4ERR_BADSESSION && | 2021 | switch (status) { |
2026 | status != -NFS4ERR_DEADSESSION) { | 2022 | case 0: |
2023 | case -NFS4ERR_BADSESSION: | ||
2024 | case -NFS4ERR_DEADSESSION: | ||
2025 | break; | ||
2026 | case -NFS4ERR_BACK_CHAN_BUSY: | ||
2027 | case -NFS4ERR_DELAY: | ||
2028 | set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); | ||
2029 | status = 0; | ||
2030 | ssleep(1); | ||
2031 | goto out; | ||
2032 | default: | ||
2027 | status = nfs4_recovery_handle_error(clp, status); | 2033 | status = nfs4_recovery_handle_error(clp, status); |
2028 | goto out; | 2034 | goto out; |
2029 | } | 2035 | } |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 2e7e8c878e5d..b056b1628722 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -2589,27 +2589,23 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags, | |||
2589 | struct nfs_server *server; | 2589 | struct nfs_server *server; |
2590 | struct dentry *mntroot = ERR_PTR(-ENOMEM); | 2590 | struct dentry *mntroot = ERR_PTR(-ENOMEM); |
2591 | struct nfs_subversion *nfs_mod = NFS_SB(data->sb)->nfs_client->cl_nfs_mod; | 2591 | struct nfs_subversion *nfs_mod = NFS_SB(data->sb)->nfs_client->cl_nfs_mod; |
2592 | int error; | ||
2593 | 2592 | ||
2594 | dprintk("--> nfs_xdev_mount_common()\n"); | 2593 | dprintk("--> nfs_xdev_mount()\n"); |
2595 | 2594 | ||
2596 | mount_info.mntfh = mount_info.cloned->fh; | 2595 | mount_info.mntfh = mount_info.cloned->fh; |
2597 | 2596 | ||
2598 | /* create a new volume representation */ | 2597 | /* create a new volume representation */ |
2599 | server = nfs_mod->rpc_ops->clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor); | 2598 | server = nfs_mod->rpc_ops->clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor); |
2600 | if (IS_ERR(server)) { | ||
2601 | error = PTR_ERR(server); | ||
2602 | goto out_err; | ||
2603 | } | ||
2604 | 2599 | ||
2605 | mntroot = nfs_fs_mount_common(server, flags, dev_name, &mount_info, nfs_mod); | 2600 | if (IS_ERR(server)) |
2606 | dprintk("<-- nfs_xdev_mount_common() = 0\n"); | 2601 | mntroot = ERR_CAST(server); |
2607 | out: | 2602 | else |
2608 | return mntroot; | 2603 | mntroot = nfs_fs_mount_common(server, flags, |
2604 | dev_name, &mount_info, nfs_mod); | ||
2609 | 2605 | ||
2610 | out_err: | 2606 | dprintk("<-- nfs_xdev_mount() = %ld\n", |
2611 | dprintk("<-- nfs_xdev_mount_common() = %d [error]\n", error); | 2607 | IS_ERR(mntroot) ? PTR_ERR(mntroot) : 0L); |
2612 | goto out; | 2608 | return mntroot; |
2613 | } | 2609 | } |
2614 | 2610 | ||
2615 | #if IS_ENABLED(CONFIG_NFS_V4) | 2611 | #if IS_ENABLED(CONFIG_NFS_V4) |
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index fdb180769485..f3859354e41a 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c | |||
@@ -664,8 +664,11 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp, | |||
664 | if (ret < 0) | 664 | if (ret < 0) |
665 | printk(KERN_ERR "NILFS: GC failed during preparation: " | 665 | printk(KERN_ERR "NILFS: GC failed during preparation: " |
666 | "cannot read source blocks: err=%d\n", ret); | 666 | "cannot read source blocks: err=%d\n", ret); |
667 | else | 667 | else { |
668 | if (nilfs_sb_need_update(nilfs)) | ||
669 | set_nilfs_discontinued(nilfs); | ||
668 | ret = nilfs_clean_segments(inode->i_sb, argv, kbufs); | 670 | ret = nilfs_clean_segments(inode->i_sb, argv, kbufs); |
671 | } | ||
669 | 672 | ||
670 | nilfs_remove_all_gcinodes(nilfs); | 673 | nilfs_remove_all_gcinodes(nilfs); |
671 | clear_nilfs_gc_running(nilfs); | 674 | clear_nilfs_gc_running(nilfs); |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index c80c599897b9..fc62ac5c6d4f 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -149,6 +149,15 @@ | |||
149 | #define TRACE_SYSCALLS() | 149 | #define TRACE_SYSCALLS() |
150 | #endif | 150 | #endif |
151 | 151 | ||
152 | #ifdef CONFIG_CLKSRC_OF | ||
153 | #define CLKSRC_OF_TABLES() . = ALIGN(8); \ | ||
154 | VMLINUX_SYMBOL(__clksrc_of_table) = .; \ | ||
155 | *(__clksrc_of_table) \ | ||
156 | *(__clksrc_of_table_end) | ||
157 | #else | ||
158 | #define CLKSRC_OF_TABLES() | ||
159 | #endif | ||
160 | |||
152 | #ifdef CONFIG_IRQCHIP | 161 | #ifdef CONFIG_IRQCHIP |
153 | #define IRQCHIP_OF_MATCH_TABLE() \ | 162 | #define IRQCHIP_OF_MATCH_TABLE() \ |
154 | . = ALIGN(8); \ | 163 | . = ALIGN(8); \ |
@@ -502,6 +511,7 @@ | |||
502 | DEV_DISCARD(init.rodata) \ | 511 | DEV_DISCARD(init.rodata) \ |
503 | CPU_DISCARD(init.rodata) \ | 512 | CPU_DISCARD(init.rodata) \ |
504 | MEM_DISCARD(init.rodata) \ | 513 | MEM_DISCARD(init.rodata) \ |
514 | CLKSRC_OF_TABLES() \ | ||
505 | KERNEL_DTB() \ | 515 | KERNEL_DTB() \ |
506 | IRQCHIP_OF_MATCH_TABLE() | 516 | IRQCHIP_OF_MATCH_TABLE() |
507 | 517 | ||
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h index b61f9961b0cc..2603267b1a29 100644 --- a/include/clocksource/arm_arch_timer.h +++ b/include/clocksource/arm_arch_timer.h | |||
@@ -53,7 +53,7 @@ static inline u64 arch_timer_read_counter(void) | |||
53 | return 0; | 53 | return 0; |
54 | } | 54 | } |
55 | 55 | ||
56 | static struct timecounter *arch_timer_get_timecounter(void) | 56 | static inline struct timecounter *arch_timer_get_timecounter(void) |
57 | { | 57 | { |
58 | return NULL; | 58 | return NULL; |
59 | } | 59 | } |
diff --git a/include/linux/bcm2835_timer.h b/include/linux/bcm2835_timer.h index 25680fe0903c..ca17aa817006 100644 --- a/include/linux/bcm2835_timer.h +++ b/include/linux/bcm2835_timer.h | |||
@@ -17,6 +17,6 @@ | |||
17 | 17 | ||
18 | #include <asm/mach/time.h> | 18 | #include <asm/mach/time.h> |
19 | 19 | ||
20 | extern struct sys_timer bcm2835_timer; | 20 | extern void bcm2835_timer_init(void); |
21 | 21 | ||
22 | #endif | 22 | #endif |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 4dceaf8ae152..7944f14ea947 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -332,4 +332,13 @@ extern int clocksource_mmio_init(void __iomem *, const char *, | |||
332 | 332 | ||
333 | extern int clocksource_i8253_init(void); | 333 | extern int clocksource_i8253_init(void); |
334 | 334 | ||
335 | #ifdef CONFIG_CLKSRC_OF | ||
336 | extern void clocksource_of_init(void); | ||
337 | |||
338 | #define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \ | ||
339 | static const struct of_device_id __clksrc_of_table_##name \ | ||
340 | __used __section(__clksrc_of_table) \ | ||
341 | = { .compatible = compat, .data = fn }; | ||
342 | #endif | ||
343 | |||
335 | #endif /* _LINUX_CLOCKSOURCE_H */ | 344 | #endif /* _LINUX_CLOCKSOURCE_H */ |
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h index 1148575fd134..dd755ce2a5eb 100644 --- a/include/linux/dw_apb_timer.h +++ b/include/linux/dw_apb_timer.h | |||
@@ -53,5 +53,5 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); | |||
53 | cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); | 53 | cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); |
54 | void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); | 54 | void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); |
55 | 55 | ||
56 | extern struct sys_timer dw_apb_timer; | 56 | extern void dw_apb_timer_init(void); |
57 | #endif /* __DW_APB_TIMER_H__ */ | 57 | #endif /* __DW_APB_TIMER_H__ */ |
diff --git a/include/linux/llist.h b/include/linux/llist.h index a5199f6d0e82..d0ab98f73d38 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h | |||
@@ -125,6 +125,31 @@ static inline void init_llist_head(struct llist_head *list) | |||
125 | (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) | 125 | (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * llist_for_each_entry_safe - iterate safely against remove over some entries | ||
129 | * of lock-less list of given type. | ||
130 | * @pos: the type * to use as a loop cursor. | ||
131 | * @n: another type * to use as a temporary storage. | ||
132 | * @node: the fist entry of deleted list entries. | ||
133 | * @member: the name of the llist_node with the struct. | ||
134 | * | ||
135 | * In general, some entries of the lock-less list can be traversed | ||
136 | * safely only after being removed from list, so start with an entry | ||
137 | * instead of list head. This variant allows removal of entries | ||
138 | * as we iterate. | ||
139 | * | ||
140 | * If being used on entries deleted from lock-less list directly, the | ||
141 | * traverse order is from the newest to the oldest added entry. If | ||
142 | * you want to traverse from the oldest to the newest, you must | ||
143 | * reverse the order by yourself before traversing. | ||
144 | */ | ||
145 | #define llist_for_each_entry_safe(pos, n, node, member) \ | ||
146 | for ((pos) = llist_entry((node), typeof(*(pos)), member), \ | ||
147 | (n) = (pos)->member.next; \ | ||
148 | &(pos)->member != NULL; \ | ||
149 | (pos) = llist_entry(n, typeof(*(pos)), member), \ | ||
150 | (n) = (&(pos)->member != NULL) ? (pos)->member.next : NULL) | ||
151 | |||
152 | /** | ||
128 | * llist_empty - tests whether a lock-less list is empty | 153 | * llist_empty - tests whether a lock-less list is empty |
129 | * @head: the list to test | 154 | * @head: the list to test |
130 | * | 155 | * |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 0108a56f814e..28bd5fa2ff2e 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -429,7 +429,7 @@ extern int memcg_limited_groups_array_size; | |||
429 | * the slab_mutex must be held when looping through those caches | 429 | * the slab_mutex must be held when looping through those caches |
430 | */ | 430 | */ |
431 | #define for_each_memcg_cache_index(_idx) \ | 431 | #define for_each_memcg_cache_index(_idx) \ |
432 | for ((_idx) = 0; i < memcg_limited_groups_array_size; (_idx)++) | 432 | for ((_idx) = 0; (_idx) < memcg_limited_groups_array_size; (_idx)++) |
433 | 433 | ||
434 | static inline bool memcg_kmem_enabled(void) | 434 | static inline bool memcg_kmem_enabled(void) |
435 | { | 435 | { |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index bc823c4c028b..deca87452528 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
@@ -151,7 +151,7 @@ struct mmu_notifier_ops { | |||
151 | * Therefore notifier chains can only be traversed when either | 151 | * Therefore notifier chains can only be traversed when either |
152 | * | 152 | * |
153 | * 1. mmap_sem is held. | 153 | * 1. mmap_sem is held. |
154 | * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->mutex). | 154 | * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->rwsem). |
155 | * 3. No other concurrent thread can access the list (release) | 155 | * 3. No other concurrent thread can access the list (release) |
156 | */ | 156 | */ |
157 | struct mmu_notifier { | 157 | struct mmu_notifier { |
diff --git a/include/linux/sunxi_timer.h b/include/linux/sunxi_timer.h index b9165bba6e61..18081787e5f3 100644 --- a/include/linux/sunxi_timer.h +++ b/include/linux/sunxi_timer.h | |||
@@ -19,6 +19,6 @@ | |||
19 | 19 | ||
20 | #include <asm/mach/time.h> | 20 | #include <asm/mach/time.h> |
21 | 21 | ||
22 | extern struct sys_timer sunxi_timer; | 22 | void sunxi_timer_init(void); |
23 | 23 | ||
24 | #endif | 24 | #endif |
diff --git a/include/linux/time.h b/include/linux/time.h index 4d358e9d10f1..05e32a72103c 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -142,9 +142,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta); | |||
142 | * finer then tick granular time. | 142 | * finer then tick granular time. |
143 | */ | 143 | */ |
144 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | 144 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET |
145 | extern u32 arch_gettimeoffset(void); | 145 | extern u32 (*arch_gettimeoffset)(void); |
146 | #else | ||
147 | static inline u32 arch_gettimeoffset(void) { return 0; } | ||
148 | #endif | 146 | #endif |
149 | 147 | ||
150 | extern void do_gettimeofday(struct timeval *tv); | 148 | extern void do_gettimeofday(struct timeval *tv); |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 689b14b26c8d..4d22d0f6167a 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -357,6 +357,8 @@ struct usb_bus { | |||
357 | int bandwidth_int_reqs; /* number of Interrupt requests */ | 357 | int bandwidth_int_reqs; /* number of Interrupt requests */ |
358 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ | 358 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ |
359 | 359 | ||
360 | unsigned resuming_ports; /* bit array: resuming root-hub ports */ | ||
361 | |||
360 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) | 362 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) |
361 | struct mon_bus *mon_bus; /* non-null when associated */ | 363 | struct mon_bus *mon_bus; /* non-null when associated */ |
362 | int monitored; /* non-zero when monitored */ | 364 | int monitored; /* non-zero when monitored */ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 608050b2545f..0a78df5f6cfd 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -430,6 +430,9 @@ extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd); | |||
430 | extern void usb_wakeup_notification(struct usb_device *hdev, | 430 | extern void usb_wakeup_notification(struct usb_device *hdev, |
431 | unsigned int portnum); | 431 | unsigned int portnum); |
432 | 432 | ||
433 | extern void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum); | ||
434 | extern void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum); | ||
435 | |||
433 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ | 436 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ |
434 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) | 437 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) |
435 | #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) | 438 | #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 5de7a220e986..0e5ac93bab10 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -33,6 +33,7 @@ struct usbnet { | |||
33 | wait_queue_head_t *wait; | 33 | wait_queue_head_t *wait; |
34 | struct mutex phy_mutex; | 34 | struct mutex phy_mutex; |
35 | unsigned char suspend_count; | 35 | unsigned char suspend_count; |
36 | unsigned char pkt_cnt, pkt_err; | ||
36 | 37 | ||
37 | /* i/o info: pipes etc */ | 38 | /* i/o info: pipes etc */ |
38 | unsigned in, out; | 39 | unsigned in, out; |
@@ -70,6 +71,7 @@ struct usbnet { | |||
70 | # define EVENT_DEV_OPEN 7 | 71 | # define EVENT_DEV_OPEN 7 |
71 | # define EVENT_DEVICE_REPORT_IDLE 8 | 72 | # define EVENT_DEVICE_REPORT_IDLE 8 |
72 | # define EVENT_NO_RUNTIME_PM 9 | 73 | # define EVENT_NO_RUNTIME_PM 9 |
74 | # define EVENT_RX_KILL 10 | ||
73 | }; | 75 | }; |
74 | 76 | ||
75 | static inline struct usb_driver *driver_of(struct usb_interface *intf) | 77 | static inline struct usb_driver *driver_of(struct usb_interface *intf) |
@@ -100,7 +102,6 @@ struct driver_info { | |||
100 | #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ | 102 | #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ |
101 | 103 | ||
102 | #define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */ | 104 | #define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */ |
103 | #define FLAG_NOARP 0x2000 /* device can't do ARP */ | ||
104 | 105 | ||
105 | /* | 106 | /* |
106 | * Indicates to usbnet, that USB driver accumulates multiple IP packets. | 107 | * Indicates to usbnet, that USB driver accumulates multiple IP packets. |
@@ -108,6 +109,7 @@ struct driver_info { | |||
108 | */ | 109 | */ |
109 | #define FLAG_MULTI_PACKET 0x2000 | 110 | #define FLAG_MULTI_PACKET 0x2000 |
110 | #define FLAG_RX_ASSEMBLE 0x4000 /* rx packets may span >1 frames */ | 111 | #define FLAG_RX_ASSEMBLE 0x4000 /* rx packets may span >1 frames */ |
112 | #define FLAG_NOARP 0x8000 /* device can't do ARP */ | ||
111 | 113 | ||
112 | /* init device ... can sleep, or cause probe() failure */ | 114 | /* init device ... can sleep, or cause probe() failure */ |
113 | int (*bind)(struct usbnet *, struct usb_interface *); | 115 | int (*bind)(struct usbnet *, struct usb_interface *); |
diff --git a/include/linux/vt8500_timer.h b/include/linux/vt8500_timer.h new file mode 100644 index 000000000000..33b0ee87d083 --- /dev/null +++ b/include/linux/vt8500_timer.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Tony Prisk <linux@prisktech.co.nz> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef __VT8500_TIMER_H | ||
16 | #define __VT8500_TIMER_H | ||
17 | |||
18 | #include <asm/mach/time.h> | ||
19 | |||
20 | void vt8500_timer_init(void); | ||
21 | |||
22 | #endif | ||
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index 498433dd067d..938b7fd11204 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h | |||
@@ -34,17 +34,17 @@ extern int udpv6_connect(struct sock *sk, | |||
34 | struct sockaddr *uaddr, | 34 | struct sockaddr *uaddr, |
35 | int addr_len); | 35 | int addr_len); |
36 | 36 | ||
37 | extern int datagram_recv_ctl(struct sock *sk, | 37 | extern int ip6_datagram_recv_ctl(struct sock *sk, |
38 | struct msghdr *msg, | 38 | struct msghdr *msg, |
39 | struct sk_buff *skb); | 39 | struct sk_buff *skb); |
40 | 40 | ||
41 | extern int datagram_send_ctl(struct net *net, | 41 | extern int ip6_datagram_send_ctl(struct net *net, |
42 | struct sock *sk, | 42 | struct sock *sk, |
43 | struct msghdr *msg, | 43 | struct msghdr *msg, |
44 | struct flowi6 *fl6, | 44 | struct flowi6 *fl6, |
45 | struct ipv6_txoptions *opt, | 45 | struct ipv6_txoptions *opt, |
46 | int *hlimit, int *tclass, | 46 | int *hlimit, int *tclass, |
47 | int *dontfrag); | 47 | int *dontfrag); |
48 | 48 | ||
49 | #define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006) | 49 | #define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006) |
50 | 50 | ||
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h index 50598472dc41..f738e25377ff 100644 --- a/include/uapi/linux/usb/ch9.h +++ b/include/uapi/linux/usb/ch9.h | |||
@@ -152,6 +152,12 @@ | |||
152 | #define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0)) | 152 | #define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0)) |
153 | #define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1)) | 153 | #define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1)) |
154 | 154 | ||
155 | /* | ||
156 | * Interface status, Figure 9-5 USB 3.0 spec | ||
157 | */ | ||
158 | #define USB_INTRF_STAT_FUNC_RW_CAP 1 | ||
159 | #define USB_INTRF_STAT_FUNC_RW 2 | ||
160 | |||
155 | #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ | 161 | #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ |
156 | 162 | ||
157 | /* Bit array elements as returned by the USB_REQ_GET_STATUS request. */ | 163 | /* Bit array elements as returned by the USB_REQ_GET_STATUS request. */ |
diff --git a/kernel/events/core.c b/kernel/events/core.c index 301079d06f24..7b6646a8c067 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -908,6 +908,15 @@ list_add_event(struct perf_event *event, struct perf_event_context *ctx) | |||
908 | } | 908 | } |
909 | 909 | ||
910 | /* | 910 | /* |
911 | * Initialize event state based on the perf_event_attr::disabled. | ||
912 | */ | ||
913 | static inline void perf_event__state_init(struct perf_event *event) | ||
914 | { | ||
915 | event->state = event->attr.disabled ? PERF_EVENT_STATE_OFF : | ||
916 | PERF_EVENT_STATE_INACTIVE; | ||
917 | } | ||
918 | |||
919 | /* | ||
911 | * Called at perf_event creation and when events are attached/detached from a | 920 | * Called at perf_event creation and when events are attached/detached from a |
912 | * group. | 921 | * group. |
913 | */ | 922 | */ |
@@ -6179,8 +6188,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu, | |||
6179 | event->overflow_handler = overflow_handler; | 6188 | event->overflow_handler = overflow_handler; |
6180 | event->overflow_handler_context = context; | 6189 | event->overflow_handler_context = context; |
6181 | 6190 | ||
6182 | if (attr->disabled) | 6191 | perf_event__state_init(event); |
6183 | event->state = PERF_EVENT_STATE_OFF; | ||
6184 | 6192 | ||
6185 | pmu = NULL; | 6193 | pmu = NULL; |
6186 | 6194 | ||
@@ -6609,9 +6617,17 @@ SYSCALL_DEFINE5(perf_event_open, | |||
6609 | 6617 | ||
6610 | mutex_lock(&gctx->mutex); | 6618 | mutex_lock(&gctx->mutex); |
6611 | perf_remove_from_context(group_leader); | 6619 | perf_remove_from_context(group_leader); |
6620 | |||
6621 | /* | ||
6622 | * Removing from the context ends up with disabled | ||
6623 | * event. What we want here is event in the initial | ||
6624 | * startup state, ready to be add into new context. | ||
6625 | */ | ||
6626 | perf_event__state_init(group_leader); | ||
6612 | list_for_each_entry(sibling, &group_leader->sibling_list, | 6627 | list_for_each_entry(sibling, &group_leader->sibling_list, |
6613 | group_entry) { | 6628 | group_entry) { |
6614 | perf_remove_from_context(sibling); | 6629 | perf_remove_from_context(sibling); |
6630 | perf_event__state_init(sibling); | ||
6615 | put_ctx(gctx); | 6631 | put_ctx(gctx); |
6616 | } | 6632 | } |
6617 | mutex_unlock(&gctx->mutex); | 6633 | mutex_unlock(&gctx->mutex); |
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index f6e5ec2932b4..c1cc7e17ff9d 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h | |||
@@ -40,8 +40,7 @@ | |||
40 | #ifdef CONFIG_RCU_NOCB_CPU | 40 | #ifdef CONFIG_RCU_NOCB_CPU |
41 | static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */ | 41 | static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */ |
42 | static bool have_rcu_nocb_mask; /* Was rcu_nocb_mask allocated? */ | 42 | static bool have_rcu_nocb_mask; /* Was rcu_nocb_mask allocated? */ |
43 | static bool rcu_nocb_poll; /* Offload kthread are to poll. */ | 43 | static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */ |
44 | module_param(rcu_nocb_poll, bool, 0444); | ||
45 | static char __initdata nocb_buf[NR_CPUS * 5]; | 44 | static char __initdata nocb_buf[NR_CPUS * 5]; |
46 | #endif /* #ifdef CONFIG_RCU_NOCB_CPU */ | 45 | #endif /* #ifdef CONFIG_RCU_NOCB_CPU */ |
47 | 46 | ||
@@ -2159,6 +2158,13 @@ static int __init rcu_nocb_setup(char *str) | |||
2159 | } | 2158 | } |
2160 | __setup("rcu_nocbs=", rcu_nocb_setup); | 2159 | __setup("rcu_nocbs=", rcu_nocb_setup); |
2161 | 2160 | ||
2161 | static int __init parse_rcu_nocb_poll(char *arg) | ||
2162 | { | ||
2163 | rcu_nocb_poll = 1; | ||
2164 | return 0; | ||
2165 | } | ||
2166 | early_param("rcu_nocb_poll", parse_rcu_nocb_poll); | ||
2167 | |||
2162 | /* Is the specified CPU a no-CPUs CPU? */ | 2168 | /* Is the specified CPU a no-CPUs CPU? */ |
2163 | static bool is_nocb_cpu(int cpu) | 2169 | static bool is_nocb_cpu(int cpu) |
2164 | { | 2170 | { |
@@ -2366,10 +2372,11 @@ static int rcu_nocb_kthread(void *arg) | |||
2366 | for (;;) { | 2372 | for (;;) { |
2367 | /* If not polling, wait for next batch of callbacks. */ | 2373 | /* If not polling, wait for next batch of callbacks. */ |
2368 | if (!rcu_nocb_poll) | 2374 | if (!rcu_nocb_poll) |
2369 | wait_event(rdp->nocb_wq, rdp->nocb_head); | 2375 | wait_event_interruptible(rdp->nocb_wq, rdp->nocb_head); |
2370 | list = ACCESS_ONCE(rdp->nocb_head); | 2376 | list = ACCESS_ONCE(rdp->nocb_head); |
2371 | if (!list) { | 2377 | if (!list) { |
2372 | schedule_timeout_interruptible(1); | 2378 | schedule_timeout_interruptible(1); |
2379 | flush_signals(current); | ||
2373 | continue; | 2380 | continue; |
2374 | } | 2381 | } |
2375 | 2382 | ||
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 2cd3c1b4e582..7ae4c4c5420e 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c | |||
@@ -222,8 +222,8 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
222 | cfs_rq->runnable_load_avg); | 222 | cfs_rq->runnable_load_avg); |
223 | SEQ_printf(m, " .%-30s: %lld\n", "blocked_load_avg", | 223 | SEQ_printf(m, " .%-30s: %lld\n", "blocked_load_avg", |
224 | cfs_rq->blocked_load_avg); | 224 | cfs_rq->blocked_load_avg); |
225 | SEQ_printf(m, " .%-30s: %ld\n", "tg_load_avg", | 225 | SEQ_printf(m, " .%-30s: %lld\n", "tg_load_avg", |
226 | atomic64_read(&cfs_rq->tg->load_avg)); | 226 | (unsigned long long)atomic64_read(&cfs_rq->tg->load_avg)); |
227 | SEQ_printf(m, " .%-30s: %lld\n", "tg_load_contrib", | 227 | SEQ_printf(m, " .%-30s: %lld\n", "tg_load_contrib", |
228 | cfs_rq->tg_load_contrib); | 228 | cfs_rq->tg_load_contrib); |
229 | SEQ_printf(m, " .%-30s: %d\n", "tg_runnable_contrib", | 229 | SEQ_printf(m, " .%-30s: %d\n", "tg_runnable_contrib", |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5eea8707234a..81fa53643409 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -2663,7 +2663,7 @@ static void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b) | |||
2663 | hrtimer_cancel(&cfs_b->slack_timer); | 2663 | hrtimer_cancel(&cfs_b->slack_timer); |
2664 | } | 2664 | } |
2665 | 2665 | ||
2666 | static void unthrottle_offline_cfs_rqs(struct rq *rq) | 2666 | static void __maybe_unused unthrottle_offline_cfs_rqs(struct rq *rq) |
2667 | { | 2667 | { |
2668 | struct cfs_rq *cfs_rq; | 2668 | struct cfs_rq *cfs_rq; |
2669 | 2669 | ||
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 418feb01344e..4f02b2847357 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c | |||
@@ -566,7 +566,7 @@ static inline struct rt_bandwidth *sched_rt_bandwidth(struct rt_rq *rt_rq) | |||
566 | static int do_balance_runtime(struct rt_rq *rt_rq) | 566 | static int do_balance_runtime(struct rt_rq *rt_rq) |
567 | { | 567 | { |
568 | struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); | 568 | struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); |
569 | struct root_domain *rd = cpu_rq(smp_processor_id())->rd; | 569 | struct root_domain *rd = rq_of_rt_rq(rt_rq)->rd; |
570 | int i, weight, more = 0; | 570 | int i, weight, more = 0; |
571 | u64 rt_period; | 571 | u64 rt_period; |
572 | 572 | ||
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 30b6de0d977c..c6d6400ee137 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -339,6 +339,7 @@ void clockevents_config_and_register(struct clock_event_device *dev, | |||
339 | clockevents_config(dev, freq); | 339 | clockevents_config(dev, freq); |
340 | clockevents_register_device(dev); | 340 | clockevents_register_device(dev); |
341 | } | 341 | } |
342 | EXPORT_SYMBOL_GPL(clockevents_config_and_register); | ||
342 | 343 | ||
343 | /** | 344 | /** |
344 | * clockevents_update_freq - Update frequency and reprogram a clock event device. | 345 | * clockevents_update_freq - Update frequency and reprogram a clock event device. |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index cbc6acb0db3f..8ed934601587 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -135,6 +135,20 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) | |||
135 | } | 135 | } |
136 | 136 | ||
137 | /* Timekeeper helper functions. */ | 137 | /* Timekeeper helper functions. */ |
138 | |||
139 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | ||
140 | u32 (*arch_gettimeoffset)(void); | ||
141 | |||
142 | u32 get_arch_timeoffset(void) | ||
143 | { | ||
144 | if (likely(arch_gettimeoffset)) | ||
145 | return arch_gettimeoffset(); | ||
146 | return 0; | ||
147 | } | ||
148 | #else | ||
149 | static inline u32 get_arch_timeoffset(void) { return 0; } | ||
150 | #endif | ||
151 | |||
138 | static inline s64 timekeeping_get_ns(struct timekeeper *tk) | 152 | static inline s64 timekeeping_get_ns(struct timekeeper *tk) |
139 | { | 153 | { |
140 | cycle_t cycle_now, cycle_delta; | 154 | cycle_t cycle_now, cycle_delta; |
@@ -151,8 +165,8 @@ static inline s64 timekeeping_get_ns(struct timekeeper *tk) | |||
151 | nsec = cycle_delta * tk->mult + tk->xtime_nsec; | 165 | nsec = cycle_delta * tk->mult + tk->xtime_nsec; |
152 | nsec >>= tk->shift; | 166 | nsec >>= tk->shift; |
153 | 167 | ||
154 | /* If arch requires, add in gettimeoffset() */ | 168 | /* If arch requires, add in get_arch_timeoffset() */ |
155 | return nsec + arch_gettimeoffset(); | 169 | return nsec + get_arch_timeoffset(); |
156 | } | 170 | } |
157 | 171 | ||
158 | static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk) | 172 | static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk) |
@@ -171,8 +185,8 @@ static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk) | |||
171 | /* convert delta to nanoseconds. */ | 185 | /* convert delta to nanoseconds. */ |
172 | nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift); | 186 | nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift); |
173 | 187 | ||
174 | /* If arch requires, add in gettimeoffset() */ | 188 | /* If arch requires, add in get_arch_timeoffset() */ |
175 | return nsec + arch_gettimeoffset(); | 189 | return nsec + get_arch_timeoffset(); |
176 | } | 190 | } |
177 | 191 | ||
178 | static RAW_NOTIFIER_HEAD(pvclock_gtod_chain); | 192 | static RAW_NOTIFIER_HEAD(pvclock_gtod_chain); |
@@ -254,8 +268,8 @@ static void timekeeping_forward_now(struct timekeeper *tk) | |||
254 | 268 | ||
255 | tk->xtime_nsec += cycle_delta * tk->mult; | 269 | tk->xtime_nsec += cycle_delta * tk->mult; |
256 | 270 | ||
257 | /* If arch requires, add in gettimeoffset() */ | 271 | /* If arch requires, add in get_arch_timeoffset() */ |
258 | tk->xtime_nsec += (u64)arch_gettimeoffset() << tk->shift; | 272 | tk->xtime_nsec += (u64)get_arch_timeoffset() << tk->shift; |
259 | 273 | ||
260 | tk_normalize_xtime(tk); | 274 | tk_normalize_xtime(tk); |
261 | 275 | ||
diff --git a/lib/digsig.c b/lib/digsig.c index 8c0e62975c88..dc2be7ed1765 100644 --- a/lib/digsig.c +++ b/lib/digsig.c | |||
@@ -162,6 +162,8 @@ static int digsig_verify_rsa(struct key *key, | |||
162 | memset(out1, 0, head); | 162 | memset(out1, 0, head); |
163 | memcpy(out1 + head, p, l); | 163 | memcpy(out1 + head, p, l); |
164 | 164 | ||
165 | kfree(p); | ||
166 | |||
165 | err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len); | 167 | err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len); |
166 | if (err) | 168 | if (err) |
167 | goto err; | 169 | goto err; |
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 6001ee6347a9..b5783d81eda9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -1257,6 +1257,10 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, | |||
1257 | if (flags & FOLL_WRITE && !pmd_write(*pmd)) | 1257 | if (flags & FOLL_WRITE && !pmd_write(*pmd)) |
1258 | goto out; | 1258 | goto out; |
1259 | 1259 | ||
1260 | /* Avoid dumping huge zero page */ | ||
1261 | if ((flags & FOLL_DUMP) && is_huge_zero_pmd(*pmd)) | ||
1262 | return ERR_PTR(-EFAULT); | ||
1263 | |||
1260 | page = pmd_page(*pmd); | 1264 | page = pmd_page(*pmd); |
1261 | VM_BUG_ON(!PageHead(page)); | 1265 | VM_BUG_ON(!PageHead(page)); |
1262 | if (flags & FOLL_TOUCH) { | 1266 | if (flags & FOLL_TOUCH) { |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 4f3ea0b1e57c..546db81820e4 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -3033,6 +3033,7 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma, | |||
3033 | if (!huge_pte_none(huge_ptep_get(ptep))) { | 3033 | if (!huge_pte_none(huge_ptep_get(ptep))) { |
3034 | pte = huge_ptep_get_and_clear(mm, address, ptep); | 3034 | pte = huge_ptep_get_and_clear(mm, address, ptep); |
3035 | pte = pte_mkhuge(pte_modify(pte, newprot)); | 3035 | pte = pte_mkhuge(pte_modify(pte, newprot)); |
3036 | pte = arch_make_huge_pte(pte, vma, NULL, 0); | ||
3036 | set_huge_pte_at(mm, address, ptep, pte); | 3037 | set_huge_pte_at(mm, address, ptep, pte); |
3037 | pages++; | 3038 | pages++; |
3038 | } | 3039 | } |
diff --git a/mm/migrate.c b/mm/migrate.c index c38778610aa8..2fd8b4af4744 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -160,8 +160,10 @@ static int remove_migration_pte(struct page *new, struct vm_area_struct *vma, | |||
160 | if (is_write_migration_entry(entry)) | 160 | if (is_write_migration_entry(entry)) |
161 | pte = pte_mkwrite(pte); | 161 | pte = pte_mkwrite(pte); |
162 | #ifdef CONFIG_HUGETLB_PAGE | 162 | #ifdef CONFIG_HUGETLB_PAGE |
163 | if (PageHuge(new)) | 163 | if (PageHuge(new)) { |
164 | pte = pte_mkhuge(pte); | 164 | pte = pte_mkhuge(pte); |
165 | pte = arch_make_huge_pte(pte, vma, new, 0); | ||
166 | } | ||
165 | #endif | 167 | #endif |
166 | flush_cache_page(vma, addr, pte_pfn(pte)); | 168 | flush_cache_page(vma, addr, pte_pfn(pte)); |
167 | set_pte_at(mm, addr, ptep, pte); | 169 | set_pte_at(mm, addr, ptep, pte); |
@@ -2943,7 +2943,7 @@ static void vm_lock_mapping(struct mm_struct *mm, struct address_space *mapping) | |||
2943 | * vma in this mm is backed by the same anon_vma or address_space. | 2943 | * vma in this mm is backed by the same anon_vma or address_space. |
2944 | * | 2944 | * |
2945 | * We can take all the locks in random order because the VM code | 2945 | * We can take all the locks in random order because the VM code |
2946 | * taking i_mmap_mutex or anon_vma->mutex outside the mmap_sem never | 2946 | * taking i_mmap_mutex or anon_vma->rwsem outside the mmap_sem never |
2947 | * takes more than one of them in a row. Secondly we're protected | 2947 | * takes more than one of them in a row. Secondly we're protected |
2948 | * against a concurrent mm_take_all_locks() by the mm_all_locks_mutex. | 2948 | * against a concurrent mm_take_all_locks() by the mm_all_locks_mutex. |
2949 | * | 2949 | * |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 25bfce0666eb..4925a02ae7e4 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -249,12 +249,12 @@ static void hci_conn_disconnect(struct hci_conn *conn) | |||
249 | __u8 reason = hci_proto_disconn_ind(conn); | 249 | __u8 reason = hci_proto_disconn_ind(conn); |
250 | 250 | ||
251 | switch (conn->type) { | 251 | switch (conn->type) { |
252 | case ACL_LINK: | ||
253 | hci_acl_disconn(conn, reason); | ||
254 | break; | ||
255 | case AMP_LINK: | 252 | case AMP_LINK: |
256 | hci_amp_disconn(conn, reason); | 253 | hci_amp_disconn(conn, reason); |
257 | break; | 254 | break; |
255 | default: | ||
256 | hci_acl_disconn(conn, reason); | ||
257 | break; | ||
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 68a9587c9694..5abefb12891d 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -859,6 +859,19 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb) | |||
859 | 859 | ||
860 | skb_pull(skb, sizeof(code)); | 860 | skb_pull(skb, sizeof(code)); |
861 | 861 | ||
862 | /* | ||
863 | * The SMP context must be initialized for all other PDUs except | ||
864 | * pairing and security requests. If we get any other PDU when | ||
865 | * not initialized simply disconnect (done if this function | ||
866 | * returns an error). | ||
867 | */ | ||
868 | if (code != SMP_CMD_PAIRING_REQ && code != SMP_CMD_SECURITY_REQ && | ||
869 | !conn->smp_chan) { | ||
870 | BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code); | ||
871 | kfree_skb(skb); | ||
872 | return -ENOTSUPP; | ||
873 | } | ||
874 | |||
862 | switch (code) { | 875 | switch (code) { |
863 | case SMP_CMD_PAIRING_REQ: | 876 | case SMP_CMD_PAIRING_REQ: |
864 | reason = smp_cmd_pairing_req(conn, skb); | 877 | reason = smp_cmd_pairing_req(conn, skb); |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index b29dacf900f9..e6e1cbe863f5 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -1781,10 +1781,13 @@ static ssize_t pktgen_thread_write(struct file *file, | |||
1781 | return -EFAULT; | 1781 | return -EFAULT; |
1782 | i += len; | 1782 | i += len; |
1783 | mutex_lock(&pktgen_thread_lock); | 1783 | mutex_lock(&pktgen_thread_lock); |
1784 | pktgen_add_device(t, f); | 1784 | ret = pktgen_add_device(t, f); |
1785 | mutex_unlock(&pktgen_thread_lock); | 1785 | mutex_unlock(&pktgen_thread_lock); |
1786 | ret = count; | 1786 | if (!ret) { |
1787 | sprintf(pg_result, "OK: add_device=%s", f); | 1787 | ret = count; |
1788 | sprintf(pg_result, "OK: add_device=%s", f); | ||
1789 | } else | ||
1790 | sprintf(pg_result, "ERROR: can not add device %s", f); | ||
1788 | goto out; | 1791 | goto out; |
1789 | } | 1792 | } |
1790 | 1793 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index a9a2ae3e2213..32443ebc3e89 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -683,7 +683,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old) | |||
683 | new->network_header = old->network_header; | 683 | new->network_header = old->network_header; |
684 | new->mac_header = old->mac_header; | 684 | new->mac_header = old->mac_header; |
685 | new->inner_transport_header = old->inner_transport_header; | 685 | new->inner_transport_header = old->inner_transport_header; |
686 | new->inner_network_header = old->inner_transport_header; | 686 | new->inner_network_header = old->inner_network_header; |
687 | skb_dst_copy(new, old); | 687 | skb_dst_copy(new, old); |
688 | new->rxhash = old->rxhash; | 688 | new->rxhash = old->rxhash; |
689 | new->ooo_okay = old->ooo_okay; | 689 | new->ooo_okay = old->ooo_okay; |
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c index 291f2ed7cc31..cdf2e707bb10 100644 --- a/net/ipv4/tcp_cong.c +++ b/net/ipv4/tcp_cong.c | |||
@@ -310,6 +310,12 @@ void tcp_slow_start(struct tcp_sock *tp) | |||
310 | { | 310 | { |
311 | int cnt; /* increase in packets */ | 311 | int cnt; /* increase in packets */ |
312 | unsigned int delta = 0; | 312 | unsigned int delta = 0; |
313 | u32 snd_cwnd = tp->snd_cwnd; | ||
314 | |||
315 | if (unlikely(!snd_cwnd)) { | ||
316 | pr_err_once("snd_cwnd is nul, please report this bug.\n"); | ||
317 | snd_cwnd = 1U; | ||
318 | } | ||
313 | 319 | ||
314 | /* RFC3465: ABC Slow start | 320 | /* RFC3465: ABC Slow start |
315 | * Increase only after a full MSS of bytes is acked | 321 | * Increase only after a full MSS of bytes is acked |
@@ -324,7 +330,7 @@ void tcp_slow_start(struct tcp_sock *tp) | |||
324 | if (sysctl_tcp_max_ssthresh > 0 && tp->snd_cwnd > sysctl_tcp_max_ssthresh) | 330 | if (sysctl_tcp_max_ssthresh > 0 && tp->snd_cwnd > sysctl_tcp_max_ssthresh) |
325 | cnt = sysctl_tcp_max_ssthresh >> 1; /* limited slow start */ | 331 | cnt = sysctl_tcp_max_ssthresh >> 1; /* limited slow start */ |
326 | else | 332 | else |
327 | cnt = tp->snd_cwnd; /* exponential increase */ | 333 | cnt = snd_cwnd; /* exponential increase */ |
328 | 334 | ||
329 | /* RFC3465: ABC | 335 | /* RFC3465: ABC |
330 | * We MAY increase by 2 if discovered delayed ack | 336 | * We MAY increase by 2 if discovered delayed ack |
@@ -334,11 +340,11 @@ void tcp_slow_start(struct tcp_sock *tp) | |||
334 | tp->bytes_acked = 0; | 340 | tp->bytes_acked = 0; |
335 | 341 | ||
336 | tp->snd_cwnd_cnt += cnt; | 342 | tp->snd_cwnd_cnt += cnt; |
337 | while (tp->snd_cwnd_cnt >= tp->snd_cwnd) { | 343 | while (tp->snd_cwnd_cnt >= snd_cwnd) { |
338 | tp->snd_cwnd_cnt -= tp->snd_cwnd; | 344 | tp->snd_cwnd_cnt -= snd_cwnd; |
339 | delta++; | 345 | delta++; |
340 | } | 346 | } |
341 | tp->snd_cwnd = min(tp->snd_cwnd + delta, tp->snd_cwnd_clamp); | 347 | tp->snd_cwnd = min(snd_cwnd + delta, tp->snd_cwnd_clamp); |
342 | } | 348 | } |
343 | EXPORT_SYMBOL_GPL(tcp_slow_start); | 349 | EXPORT_SYMBOL_GPL(tcp_slow_start); |
344 | 350 | ||
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 18f97ca76b00..ad70a962c20e 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -3504,6 +3504,11 @@ static bool tcp_process_frto(struct sock *sk, int flag) | |||
3504 | } | 3504 | } |
3505 | } else { | 3505 | } else { |
3506 | if (!(flag & FLAG_DATA_ACKED) && (tp->frto_counter == 1)) { | 3506 | if (!(flag & FLAG_DATA_ACKED) && (tp->frto_counter == 1)) { |
3507 | if (!tcp_packets_in_flight(tp)) { | ||
3508 | tcp_enter_frto_loss(sk, 2, flag); | ||
3509 | return true; | ||
3510 | } | ||
3511 | |||
3507 | /* Prevent sending of new data. */ | 3512 | /* Prevent sending of new data. */ |
3508 | tp->snd_cwnd = min(tp->snd_cwnd, | 3513 | tp->snd_cwnd = min(tp->snd_cwnd, |
3509 | tcp_packets_in_flight(tp)); | 3514 | tcp_packets_in_flight(tp)); |
@@ -5649,8 +5654,7 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, | |||
5649 | * the remote receives only the retransmitted (regular) SYNs: either | 5654 | * the remote receives only the retransmitted (regular) SYNs: either |
5650 | * the original SYN-data or the corresponding SYN-ACK is lost. | 5655 | * the original SYN-data or the corresponding SYN-ACK is lost. |
5651 | */ | 5656 | */ |
5652 | syn_drop = (cookie->len <= 0 && data && | 5657 | syn_drop = (cookie->len <= 0 && data && tp->total_retrans); |
5653 | inet_csk(sk)->icsk_retransmits); | ||
5654 | 5658 | ||
5655 | tcp_fastopen_cache_set(sk, mss, cookie, syn_drop); | 5659 | tcp_fastopen_cache_set(sk, mss, cookie, syn_drop); |
5656 | 5660 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 70b09ef2463b..eadb693eef55 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -496,6 +496,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) | |||
496 | * errors returned from accept(). | 496 | * errors returned from accept(). |
497 | */ | 497 | */ |
498 | inet_csk_reqsk_queue_drop(sk, req, prev); | 498 | inet_csk_reqsk_queue_drop(sk, req, prev); |
499 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); | ||
499 | goto out; | 500 | goto out; |
500 | 501 | ||
501 | case TCP_SYN_SENT: | 502 | case TCP_SYN_SENT: |
@@ -1500,8 +1501,10 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1500 | * clogging syn queue with openreqs with exponentially increasing | 1501 | * clogging syn queue with openreqs with exponentially increasing |
1501 | * timeout. | 1502 | * timeout. |
1502 | */ | 1503 | */ |
1503 | if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) | 1504 | if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) { |
1505 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS); | ||
1504 | goto drop; | 1506 | goto drop; |
1507 | } | ||
1505 | 1508 | ||
1506 | req = inet_reqsk_alloc(&tcp_request_sock_ops); | 1509 | req = inet_reqsk_alloc(&tcp_request_sock_ops); |
1507 | if (!req) | 1510 | if (!req) |
@@ -1666,6 +1669,7 @@ drop_and_release: | |||
1666 | drop_and_free: | 1669 | drop_and_free: |
1667 | reqsk_free(req); | 1670 | reqsk_free(req); |
1668 | drop: | 1671 | drop: |
1672 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); | ||
1669 | return 0; | 1673 | return 0; |
1670 | } | 1674 | } |
1671 | EXPORT_SYMBOL(tcp_v4_conn_request); | 1675 | EXPORT_SYMBOL(tcp_v4_conn_request); |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 420e56326384..1b5d8cb9b123 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1660,6 +1660,7 @@ static int addrconf_ifid_eui64(u8 *eui, struct net_device *dev) | |||
1660 | if (dev->addr_len != IEEE802154_ADDR_LEN) | 1660 | if (dev->addr_len != IEEE802154_ADDR_LEN) |
1661 | return -1; | 1661 | return -1; |
1662 | memcpy(eui, dev->dev_addr, 8); | 1662 | memcpy(eui, dev->dev_addr, 8); |
1663 | eui[0] ^= 2; | ||
1663 | return 0; | 1664 | return 0; |
1664 | } | 1665 | } |
1665 | 1666 | ||
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index 8edf2601065a..7a778b9a7b85 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c | |||
@@ -380,7 +380,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) | |||
380 | if (skb->protocol == htons(ETH_P_IPV6)) { | 380 | if (skb->protocol == htons(ETH_P_IPV6)) { |
381 | sin->sin6_addr = ipv6_hdr(skb)->saddr; | 381 | sin->sin6_addr = ipv6_hdr(skb)->saddr; |
382 | if (np->rxopt.all) | 382 | if (np->rxopt.all) |
383 | datagram_recv_ctl(sk, msg, skb); | 383 | ip6_datagram_recv_ctl(sk, msg, skb); |
384 | if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) | 384 | if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) |
385 | sin->sin6_scope_id = IP6CB(skb)->iif; | 385 | sin->sin6_scope_id = IP6CB(skb)->iif; |
386 | } else { | 386 | } else { |
@@ -468,7 +468,8 @@ out: | |||
468 | } | 468 | } |
469 | 469 | ||
470 | 470 | ||
471 | int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) | 471 | int ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, |
472 | struct sk_buff *skb) | ||
472 | { | 473 | { |
473 | struct ipv6_pinfo *np = inet6_sk(sk); | 474 | struct ipv6_pinfo *np = inet6_sk(sk); |
474 | struct inet6_skb_parm *opt = IP6CB(skb); | 475 | struct inet6_skb_parm *opt = IP6CB(skb); |
@@ -597,11 +598,12 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) | |||
597 | } | 598 | } |
598 | return 0; | 599 | return 0; |
599 | } | 600 | } |
601 | EXPORT_SYMBOL_GPL(ip6_datagram_recv_ctl); | ||
600 | 602 | ||
601 | int datagram_send_ctl(struct net *net, struct sock *sk, | 603 | int ip6_datagram_send_ctl(struct net *net, struct sock *sk, |
602 | struct msghdr *msg, struct flowi6 *fl6, | 604 | struct msghdr *msg, struct flowi6 *fl6, |
603 | struct ipv6_txoptions *opt, | 605 | struct ipv6_txoptions *opt, |
604 | int *hlimit, int *tclass, int *dontfrag) | 606 | int *hlimit, int *tclass, int *dontfrag) |
605 | { | 607 | { |
606 | struct in6_pktinfo *src_info; | 608 | struct in6_pktinfo *src_info; |
607 | struct cmsghdr *cmsg; | 609 | struct cmsghdr *cmsg; |
@@ -871,4 +873,4 @@ int datagram_send_ctl(struct net *net, struct sock *sk, | |||
871 | exit_f: | 873 | exit_f: |
872 | return err; | 874 | return err; |
873 | } | 875 | } |
874 | EXPORT_SYMBOL_GPL(datagram_send_ctl); | 876 | EXPORT_SYMBOL_GPL(ip6_datagram_send_ctl); |
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 29124b7a04c8..d6de4b447250 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
@@ -365,8 +365,8 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq, | |||
365 | msg.msg_control = (void*)(fl->opt+1); | 365 | msg.msg_control = (void*)(fl->opt+1); |
366 | memset(&flowi6, 0, sizeof(flowi6)); | 366 | memset(&flowi6, 0, sizeof(flowi6)); |
367 | 367 | ||
368 | err = datagram_send_ctl(net, sk, &msg, &flowi6, fl->opt, &junk, | 368 | err = ip6_datagram_send_ctl(net, sk, &msg, &flowi6, fl->opt, |
369 | &junk, &junk); | 369 | &junk, &junk, &junk); |
370 | if (err) | 370 | if (err) |
371 | goto done; | 371 | goto done; |
372 | err = -EINVAL; | 372 | err = -EINVAL; |
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index c727e4712751..131dd097736d 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -960,7 +960,7 @@ static netdev_tx_t ip6gre_tunnel_xmit(struct sk_buff *skb, | |||
960 | int ret; | 960 | int ret; |
961 | 961 | ||
962 | if (!ip6_tnl_xmit_ctl(t)) | 962 | if (!ip6_tnl_xmit_ctl(t)) |
963 | return -1; | 963 | goto tx_err; |
964 | 964 | ||
965 | switch (skb->protocol) { | 965 | switch (skb->protocol) { |
966 | case htons(ETH_P_IP): | 966 | case htons(ETH_P_IP): |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index ee94d31c9d4d..d1e2e8ef29c5 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -476,8 +476,8 @@ sticky_done: | |||
476 | msg.msg_controllen = optlen; | 476 | msg.msg_controllen = optlen; |
477 | msg.msg_control = (void*)(opt+1); | 477 | msg.msg_control = (void*)(opt+1); |
478 | 478 | ||
479 | retv = datagram_send_ctl(net, sk, &msg, &fl6, opt, &junk, &junk, | 479 | retv = ip6_datagram_send_ctl(net, sk, &msg, &fl6, opt, &junk, |
480 | &junk); | 480 | &junk, &junk); |
481 | if (retv) | 481 | if (retv) |
482 | goto done; | 482 | goto done; |
483 | update: | 483 | update: |
@@ -1002,7 +1002,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
1002 | release_sock(sk); | 1002 | release_sock(sk); |
1003 | 1003 | ||
1004 | if (skb) { | 1004 | if (skb) { |
1005 | int err = datagram_recv_ctl(sk, &msg, skb); | 1005 | int err = ip6_datagram_recv_ctl(sk, &msg, skb); |
1006 | kfree_skb(skb); | 1006 | kfree_skb(skb); |
1007 | if (err) | 1007 | if (err) |
1008 | return err; | 1008 | return err; |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 6cd29b1e8b92..70fa81449997 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -507,7 +507,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
507 | sock_recv_ts_and_drops(msg, sk, skb); | 507 | sock_recv_ts_and_drops(msg, sk, skb); |
508 | 508 | ||
509 | if (np->rxopt.all) | 509 | if (np->rxopt.all) |
510 | datagram_recv_ctl(sk, msg, skb); | 510 | ip6_datagram_recv_ctl(sk, msg, skb); |
511 | 511 | ||
512 | err = copied; | 512 | err = copied; |
513 | if (flags & MSG_TRUNC) | 513 | if (flags & MSG_TRUNC) |
@@ -822,8 +822,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
822 | memset(opt, 0, sizeof(struct ipv6_txoptions)); | 822 | memset(opt, 0, sizeof(struct ipv6_txoptions)); |
823 | opt->tot_len = sizeof(struct ipv6_txoptions); | 823 | opt->tot_len = sizeof(struct ipv6_txoptions); |
824 | 824 | ||
825 | err = datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt, | 825 | err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt, |
826 | &hlimit, &tclass, &dontfrag); | 826 | &hlimit, &tclass, &dontfrag); |
827 | if (err < 0) { | 827 | if (err < 0) { |
828 | fl6_sock_release(flowlabel); | 828 | fl6_sock_release(flowlabel); |
829 | return err; | 829 | return err; |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e229a3bc345d..363d8b7772e8 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -928,7 +928,7 @@ restart: | |||
928 | dst_hold(&rt->dst); | 928 | dst_hold(&rt->dst); |
929 | read_unlock_bh(&table->tb6_lock); | 929 | read_unlock_bh(&table->tb6_lock); |
930 | 930 | ||
931 | if (!rt->n && !(rt->rt6i_flags & RTF_NONEXTHOP)) | 931 | if (!rt->n && !(rt->rt6i_flags & (RTF_NONEXTHOP | RTF_LOCAL))) |
932 | nrt = rt6_alloc_cow(rt, &fl6->daddr, &fl6->saddr); | 932 | nrt = rt6_alloc_cow(rt, &fl6->daddr, &fl6->saddr); |
933 | else if (!(rt->dst.flags & DST_HOST)) | 933 | else if (!(rt->dst.flags & DST_HOST)) |
934 | nrt = rt6_alloc_clone(rt, &fl6->daddr); | 934 | nrt = rt6_alloc_clone(rt, &fl6->daddr); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 93825dd3a7c0..4f43537197ef 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -423,6 +423,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
423 | } | 423 | } |
424 | 424 | ||
425 | inet_csk_reqsk_queue_drop(sk, req, prev); | 425 | inet_csk_reqsk_queue_drop(sk, req, prev); |
426 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); | ||
426 | goto out; | 427 | goto out; |
427 | 428 | ||
428 | case TCP_SYN_SENT: | 429 | case TCP_SYN_SENT: |
@@ -958,8 +959,10 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
958 | goto drop; | 959 | goto drop; |
959 | } | 960 | } |
960 | 961 | ||
961 | if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) | 962 | if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) { |
963 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS); | ||
962 | goto drop; | 964 | goto drop; |
965 | } | ||
963 | 966 | ||
964 | req = inet6_reqsk_alloc(&tcp6_request_sock_ops); | 967 | req = inet6_reqsk_alloc(&tcp6_request_sock_ops); |
965 | if (req == NULL) | 968 | if (req == NULL) |
@@ -1108,6 +1111,7 @@ drop_and_release: | |||
1108 | drop_and_free: | 1111 | drop_and_free: |
1109 | reqsk_free(req); | 1112 | reqsk_free(req); |
1110 | drop: | 1113 | drop: |
1114 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); | ||
1111 | return 0; /* don't send reset */ | 1115 | return 0; /* don't send reset */ |
1112 | } | 1116 | } |
1113 | 1117 | ||
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index dfaa29b8b293..fb083295ff0b 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -443,7 +443,7 @@ try_again: | |||
443 | ip_cmsg_recv(msg, skb); | 443 | ip_cmsg_recv(msg, skb); |
444 | } else { | 444 | } else { |
445 | if (np->rxopt.all) | 445 | if (np->rxopt.all) |
446 | datagram_recv_ctl(sk, msg, skb); | 446 | ip6_datagram_recv_ctl(sk, msg, skb); |
447 | } | 447 | } |
448 | 448 | ||
449 | err = copied; | 449 | err = copied; |
@@ -1153,8 +1153,8 @@ do_udp_sendmsg: | |||
1153 | memset(opt, 0, sizeof(struct ipv6_txoptions)); | 1153 | memset(opt, 0, sizeof(struct ipv6_txoptions)); |
1154 | opt->tot_len = sizeof(*opt); | 1154 | opt->tot_len = sizeof(*opt); |
1155 | 1155 | ||
1156 | err = datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt, | 1156 | err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt, |
1157 | &hlimit, &tclass, &dontfrag); | 1157 | &hlimit, &tclass, &dontfrag); |
1158 | if (err < 0) { | 1158 | if (err < 0) { |
1159 | fl6_sock_release(flowlabel); | 1159 | fl6_sock_release(flowlabel); |
1160 | return err; | 1160 | return err; |
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 1a9f3723c13c..2ac884d0e89b 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c | |||
@@ -168,6 +168,51 @@ l2tp_session_id_hash_2(struct l2tp_net *pn, u32 session_id) | |||
168 | 168 | ||
169 | } | 169 | } |
170 | 170 | ||
171 | /* Lookup the tunnel socket, possibly involving the fs code if the socket is | ||
172 | * owned by userspace. A struct sock returned from this function must be | ||
173 | * released using l2tp_tunnel_sock_put once you're done with it. | ||
174 | */ | ||
175 | struct sock *l2tp_tunnel_sock_lookup(struct l2tp_tunnel *tunnel) | ||
176 | { | ||
177 | int err = 0; | ||
178 | struct socket *sock = NULL; | ||
179 | struct sock *sk = NULL; | ||
180 | |||
181 | if (!tunnel) | ||
182 | goto out; | ||
183 | |||
184 | if (tunnel->fd >= 0) { | ||
185 | /* Socket is owned by userspace, who might be in the process | ||
186 | * of closing it. Look the socket up using the fd to ensure | ||
187 | * consistency. | ||
188 | */ | ||
189 | sock = sockfd_lookup(tunnel->fd, &err); | ||
190 | if (sock) | ||
191 | sk = sock->sk; | ||
192 | } else { | ||
193 | /* Socket is owned by kernelspace */ | ||
194 | sk = tunnel->sock; | ||
195 | } | ||
196 | |||
197 | out: | ||
198 | return sk; | ||
199 | } | ||
200 | EXPORT_SYMBOL_GPL(l2tp_tunnel_sock_lookup); | ||
201 | |||
202 | /* Drop a reference to a tunnel socket obtained via. l2tp_tunnel_sock_put */ | ||
203 | void l2tp_tunnel_sock_put(struct sock *sk) | ||
204 | { | ||
205 | struct l2tp_tunnel *tunnel = l2tp_sock_to_tunnel(sk); | ||
206 | if (tunnel) { | ||
207 | if (tunnel->fd >= 0) { | ||
208 | /* Socket is owned by userspace */ | ||
209 | sockfd_put(sk->sk_socket); | ||
210 | } | ||
211 | sock_put(sk); | ||
212 | } | ||
213 | } | ||
214 | EXPORT_SYMBOL_GPL(l2tp_tunnel_sock_put); | ||
215 | |||
171 | /* Lookup a session by id in the global session list | 216 | /* Lookup a session by id in the global session list |
172 | */ | 217 | */ |
173 | static struct l2tp_session *l2tp_session_find_2(struct net *net, u32 session_id) | 218 | static struct l2tp_session *l2tp_session_find_2(struct net *net, u32 session_id) |
@@ -1123,8 +1168,6 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len | |||
1123 | struct udphdr *uh; | 1168 | struct udphdr *uh; |
1124 | struct inet_sock *inet; | 1169 | struct inet_sock *inet; |
1125 | __wsum csum; | 1170 | __wsum csum; |
1126 | int old_headroom; | ||
1127 | int new_headroom; | ||
1128 | int headroom; | 1171 | int headroom; |
1129 | int uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; | 1172 | int uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; |
1130 | int udp_len; | 1173 | int udp_len; |
@@ -1136,16 +1179,12 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len | |||
1136 | */ | 1179 | */ |
1137 | headroom = NET_SKB_PAD + sizeof(struct iphdr) + | 1180 | headroom = NET_SKB_PAD + sizeof(struct iphdr) + |
1138 | uhlen + hdr_len; | 1181 | uhlen + hdr_len; |
1139 | old_headroom = skb_headroom(skb); | ||
1140 | if (skb_cow_head(skb, headroom)) { | 1182 | if (skb_cow_head(skb, headroom)) { |
1141 | kfree_skb(skb); | 1183 | kfree_skb(skb); |
1142 | return NET_XMIT_DROP; | 1184 | return NET_XMIT_DROP; |
1143 | } | 1185 | } |
1144 | 1186 | ||
1145 | new_headroom = skb_headroom(skb); | ||
1146 | skb_orphan(skb); | 1187 | skb_orphan(skb); |
1147 | skb->truesize += new_headroom - old_headroom; | ||
1148 | |||
1149 | /* Setup L2TP header */ | 1188 | /* Setup L2TP header */ |
1150 | session->build_header(session, __skb_push(skb, hdr_len)); | 1189 | session->build_header(session, __skb_push(skb, hdr_len)); |
1151 | 1190 | ||
@@ -1607,6 +1646,7 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 | |||
1607 | tunnel->old_sk_destruct = sk->sk_destruct; | 1646 | tunnel->old_sk_destruct = sk->sk_destruct; |
1608 | sk->sk_destruct = &l2tp_tunnel_destruct; | 1647 | sk->sk_destruct = &l2tp_tunnel_destruct; |
1609 | tunnel->sock = sk; | 1648 | tunnel->sock = sk; |
1649 | tunnel->fd = fd; | ||
1610 | lockdep_set_class_and_name(&sk->sk_lock.slock, &l2tp_socket_class, "l2tp_sock"); | 1650 | lockdep_set_class_and_name(&sk->sk_lock.slock, &l2tp_socket_class, "l2tp_sock"); |
1611 | 1651 | ||
1612 | sk->sk_allocation = GFP_ATOMIC; | 1652 | sk->sk_allocation = GFP_ATOMIC; |
@@ -1642,24 +1682,32 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create); | |||
1642 | */ | 1682 | */ |
1643 | int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel) | 1683 | int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel) |
1644 | { | 1684 | { |
1645 | int err = 0; | 1685 | int err = -EBADF; |
1646 | struct socket *sock = tunnel->sock ? tunnel->sock->sk_socket : NULL; | 1686 | struct socket *sock = NULL; |
1687 | struct sock *sk = NULL; | ||
1688 | |||
1689 | sk = l2tp_tunnel_sock_lookup(tunnel); | ||
1690 | if (!sk) | ||
1691 | goto out; | ||
1692 | |||
1693 | sock = sk->sk_socket; | ||
1694 | BUG_ON(!sock); | ||
1647 | 1695 | ||
1648 | /* Force the tunnel socket to close. This will eventually | 1696 | /* Force the tunnel socket to close. This will eventually |
1649 | * cause the tunnel to be deleted via the normal socket close | 1697 | * cause the tunnel to be deleted via the normal socket close |
1650 | * mechanisms when userspace closes the tunnel socket. | 1698 | * mechanisms when userspace closes the tunnel socket. |
1651 | */ | 1699 | */ |
1652 | if (sock != NULL) { | 1700 | err = inet_shutdown(sock, 2); |
1653 | err = inet_shutdown(sock, 2); | ||
1654 | 1701 | ||
1655 | /* If the tunnel's socket was created by the kernel, | 1702 | /* If the tunnel's socket was created by the kernel, |
1656 | * close the socket here since the socket was not | 1703 | * close the socket here since the socket was not |
1657 | * created by userspace. | 1704 | * created by userspace. |
1658 | */ | 1705 | */ |
1659 | if (sock->file == NULL) | 1706 | if (sock->file == NULL) |
1660 | err = inet_release(sock); | 1707 | err = inet_release(sock); |
1661 | } | ||
1662 | 1708 | ||
1709 | l2tp_tunnel_sock_put(sk); | ||
1710 | out: | ||
1663 | return err; | 1711 | return err; |
1664 | } | 1712 | } |
1665 | EXPORT_SYMBOL_GPL(l2tp_tunnel_delete); | 1713 | EXPORT_SYMBOL_GPL(l2tp_tunnel_delete); |
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h index 56d583e083a7..e62204cad4fe 100644 --- a/net/l2tp/l2tp_core.h +++ b/net/l2tp/l2tp_core.h | |||
@@ -188,7 +188,8 @@ struct l2tp_tunnel { | |||
188 | int (*recv_payload_hook)(struct sk_buff *skb); | 188 | int (*recv_payload_hook)(struct sk_buff *skb); |
189 | void (*old_sk_destruct)(struct sock *); | 189 | void (*old_sk_destruct)(struct sock *); |
190 | struct sock *sock; /* Parent socket */ | 190 | struct sock *sock; /* Parent socket */ |
191 | int fd; | 191 | int fd; /* Parent fd, if tunnel socket |
192 | * was created by userspace */ | ||
192 | 193 | ||
193 | uint8_t priv[0]; /* private data */ | 194 | uint8_t priv[0]; /* private data */ |
194 | }; | 195 | }; |
@@ -228,6 +229,8 @@ out: | |||
228 | return tunnel; | 229 | return tunnel; |
229 | } | 230 | } |
230 | 231 | ||
232 | extern struct sock *l2tp_tunnel_sock_lookup(struct l2tp_tunnel *tunnel); | ||
233 | extern void l2tp_tunnel_sock_put(struct sock *sk); | ||
231 | extern struct l2tp_session *l2tp_session_find(struct net *net, struct l2tp_tunnel *tunnel, u32 session_id); | 234 | extern struct l2tp_session *l2tp_session_find(struct net *net, struct l2tp_tunnel *tunnel, u32 session_id); |
232 | extern struct l2tp_session *l2tp_session_find_nth(struct l2tp_tunnel *tunnel, int nth); | 235 | extern struct l2tp_session *l2tp_session_find_nth(struct l2tp_tunnel *tunnel, int nth); |
233 | extern struct l2tp_session *l2tp_session_find_by_ifname(struct net *net, char *ifname); | 236 | extern struct l2tp_session *l2tp_session_find_by_ifname(struct net *net, char *ifname); |
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index 927547171bc7..8ee4a86ae996 100644 --- a/net/l2tp/l2tp_ip6.c +++ b/net/l2tp/l2tp_ip6.c | |||
@@ -554,8 +554,8 @@ static int l2tp_ip6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
554 | memset(opt, 0, sizeof(struct ipv6_txoptions)); | 554 | memset(opt, 0, sizeof(struct ipv6_txoptions)); |
555 | opt->tot_len = sizeof(struct ipv6_txoptions); | 555 | opt->tot_len = sizeof(struct ipv6_txoptions); |
556 | 556 | ||
557 | err = datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt, | 557 | err = ip6_datagram_send_ctl(sock_net(sk), sk, msg, &fl6, opt, |
558 | &hlimit, &tclass, &dontfrag); | 558 | &hlimit, &tclass, &dontfrag); |
559 | if (err < 0) { | 559 | if (err < 0) { |
560 | fl6_sock_release(flowlabel); | 560 | fl6_sock_release(flowlabel); |
561 | return err; | 561 | return err; |
@@ -646,7 +646,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
646 | struct msghdr *msg, size_t len, int noblock, | 646 | struct msghdr *msg, size_t len, int noblock, |
647 | int flags, int *addr_len) | 647 | int flags, int *addr_len) |
648 | { | 648 | { |
649 | struct inet_sock *inet = inet_sk(sk); | 649 | struct ipv6_pinfo *np = inet6_sk(sk); |
650 | struct sockaddr_l2tpip6 *lsa = (struct sockaddr_l2tpip6 *)msg->msg_name; | 650 | struct sockaddr_l2tpip6 *lsa = (struct sockaddr_l2tpip6 *)msg->msg_name; |
651 | size_t copied = 0; | 651 | size_t copied = 0; |
652 | int err = -EOPNOTSUPP; | 652 | int err = -EOPNOTSUPP; |
@@ -688,8 +688,8 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
688 | lsa->l2tp_scope_id = IP6CB(skb)->iif; | 688 | lsa->l2tp_scope_id = IP6CB(skb)->iif; |
689 | } | 689 | } |
690 | 690 | ||
691 | if (inet->cmsg_flags) | 691 | if (np->rxopt.all) |
692 | ip_cmsg_recv(msg, skb); | 692 | ip6_datagram_recv_ctl(sk, msg, skb); |
693 | 693 | ||
694 | if (flags & MSG_TRUNC) | 694 | if (flags & MSG_TRUNC) |
695 | copied = skb->len; | 695 | copied = skb->len; |
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index 286366ef8930..716605c241f4 100644 --- a/net/l2tp/l2tp_ppp.c +++ b/net/l2tp/l2tp_ppp.c | |||
@@ -388,8 +388,6 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) | |||
388 | struct l2tp_session *session; | 388 | struct l2tp_session *session; |
389 | struct l2tp_tunnel *tunnel; | 389 | struct l2tp_tunnel *tunnel; |
390 | struct pppol2tp_session *ps; | 390 | struct pppol2tp_session *ps; |
391 | int old_headroom; | ||
392 | int new_headroom; | ||
393 | int uhlen, headroom; | 391 | int uhlen, headroom; |
394 | 392 | ||
395 | if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) | 393 | if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) |
@@ -408,7 +406,6 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) | |||
408 | if (tunnel == NULL) | 406 | if (tunnel == NULL) |
409 | goto abort_put_sess; | 407 | goto abort_put_sess; |
410 | 408 | ||
411 | old_headroom = skb_headroom(skb); | ||
412 | uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; | 409 | uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; |
413 | headroom = NET_SKB_PAD + | 410 | headroom = NET_SKB_PAD + |
414 | sizeof(struct iphdr) + /* IP header */ | 411 | sizeof(struct iphdr) + /* IP header */ |
@@ -418,9 +415,6 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) | |||
418 | if (skb_cow_head(skb, headroom)) | 415 | if (skb_cow_head(skb, headroom)) |
419 | goto abort_put_sess_tun; | 416 | goto abort_put_sess_tun; |
420 | 417 | ||
421 | new_headroom = skb_headroom(skb); | ||
422 | skb->truesize += new_headroom - old_headroom; | ||
423 | |||
424 | /* Setup PPP header */ | 418 | /* Setup PPP header */ |
425 | __skb_push(skb, sizeof(ppph)); | 419 | __skb_push(skb, sizeof(ppph)); |
426 | skb->data[0] = ppph[0]; | 420 | skb->data[0] = ppph[0]; |
diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c index a9327e2e48ce..670cbc3518de 100644 --- a/net/openvswitch/vport-netdev.c +++ b/net/openvswitch/vport-netdev.c | |||
@@ -35,10 +35,11 @@ | |||
35 | /* Must be called with rcu_read_lock. */ | 35 | /* Must be called with rcu_read_lock. */ |
36 | static void netdev_port_receive(struct vport *vport, struct sk_buff *skb) | 36 | static void netdev_port_receive(struct vport *vport, struct sk_buff *skb) |
37 | { | 37 | { |
38 | if (unlikely(!vport)) { | 38 | if (unlikely(!vport)) |
39 | kfree_skb(skb); | 39 | goto error; |
40 | return; | 40 | |
41 | } | 41 | if (unlikely(skb_warn_if_lro(skb))) |
42 | goto error; | ||
42 | 43 | ||
43 | /* Make our own copy of the packet. Otherwise we will mangle the | 44 | /* Make our own copy of the packet. Otherwise we will mangle the |
44 | * packet for anyone who came before us (e.g. tcpdump via AF_PACKET). | 45 | * packet for anyone who came before us (e.g. tcpdump via AF_PACKET). |
@@ -50,6 +51,10 @@ static void netdev_port_receive(struct vport *vport, struct sk_buff *skb) | |||
50 | 51 | ||
51 | skb_push(skb, ETH_HLEN); | 52 | skb_push(skb, ETH_HLEN); |
52 | ovs_vport_receive(vport, skb); | 53 | ovs_vport_receive(vport, skb); |
54 | return; | ||
55 | |||
56 | error: | ||
57 | kfree_skb(skb); | ||
53 | } | 58 | } |
54 | 59 | ||
55 | /* Called with rcu_read_lock and bottom-halves disabled. */ | 60 | /* Called with rcu_read_lock and bottom-halves disabled. */ |
@@ -169,9 +174,6 @@ static int netdev_send(struct vport *vport, struct sk_buff *skb) | |||
169 | goto error; | 174 | goto error; |
170 | } | 175 | } |
171 | 176 | ||
172 | if (unlikely(skb_warn_if_lro(skb))) | ||
173 | goto error; | ||
174 | |||
175 | skb->dev = netdev_vport->dev; | 177 | skb->dev = netdev_vport->dev; |
176 | len = skb->len; | 178 | len = skb->len; |
177 | dev_queue_xmit(skb); | 179 | dev_queue_xmit(skb); |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index e639645e8fec..c111bd0e083a 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -2361,13 +2361,15 @@ static int packet_release(struct socket *sock) | |||
2361 | 2361 | ||
2362 | packet_flush_mclist(sk); | 2362 | packet_flush_mclist(sk); |
2363 | 2363 | ||
2364 | memset(&req_u, 0, sizeof(req_u)); | 2364 | if (po->rx_ring.pg_vec) { |
2365 | 2365 | memset(&req_u, 0, sizeof(req_u)); | |
2366 | if (po->rx_ring.pg_vec) | ||
2367 | packet_set_ring(sk, &req_u, 1, 0); | 2366 | packet_set_ring(sk, &req_u, 1, 0); |
2367 | } | ||
2368 | 2368 | ||
2369 | if (po->tx_ring.pg_vec) | 2369 | if (po->tx_ring.pg_vec) { |
2370 | memset(&req_u, 0, sizeof(req_u)); | ||
2370 | packet_set_ring(sk, &req_u, 1, 1); | 2371 | packet_set_ring(sk, &req_u, 1, 1); |
2372 | } | ||
2371 | 2373 | ||
2372 | fanout_release(sk); | 2374 | fanout_release(sk); |
2373 | 2375 | ||
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 298c0ddfb57e..3d2acc7a9c80 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -438,18 +438,18 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
438 | if (q->rate) { | 438 | if (q->rate) { |
439 | struct sk_buff_head *list = &sch->q; | 439 | struct sk_buff_head *list = &sch->q; |
440 | 440 | ||
441 | delay += packet_len_2_sched_time(skb->len, q); | ||
442 | |||
443 | if (!skb_queue_empty(list)) { | 441 | if (!skb_queue_empty(list)) { |
444 | /* | 442 | /* |
445 | * Last packet in queue is reference point (now). | 443 | * Last packet in queue is reference point (now), |
446 | * First packet in queue is already in flight, | 444 | * calculate this time bonus and subtract |
447 | * calculate this time bonus and substract | ||
448 | * from delay. | 445 | * from delay. |
449 | */ | 446 | */ |
450 | delay -= now - netem_skb_cb(skb_peek(list))->time_to_send; | 447 | delay -= netem_skb_cb(skb_peek_tail(list))->time_to_send - now; |
448 | delay = max_t(psched_tdiff_t, 0, delay); | ||
451 | now = netem_skb_cb(skb_peek_tail(list))->time_to_send; | 449 | now = netem_skb_cb(skb_peek_tail(list))->time_to_send; |
452 | } | 450 | } |
451 | |||
452 | delay += packet_len_2_sched_time(skb->len, q); | ||
453 | } | 453 | } |
454 | 454 | ||
455 | cb->time_to_send = now + delay; | 455 | cb->time_to_send = now + delay; |
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 159b9bc5d633..d8420ae614dc 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c | |||
@@ -71,7 +71,7 @@ void sctp_auth_key_put(struct sctp_auth_bytes *key) | |||
71 | return; | 71 | return; |
72 | 72 | ||
73 | if (atomic_dec_and_test(&key->refcnt)) { | 73 | if (atomic_dec_and_test(&key->refcnt)) { |
74 | kfree(key); | 74 | kzfree(key); |
75 | SCTP_DBG_OBJCNT_DEC(keys); | 75 | SCTP_DBG_OBJCNT_DEC(keys); |
76 | } | 76 | } |
77 | } | 77 | } |
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 17a001bac2cc..1a9c5fb77310 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -249,6 +249,8 @@ void sctp_endpoint_free(struct sctp_endpoint *ep) | |||
249 | /* Final destructor for endpoint. */ | 249 | /* Final destructor for endpoint. */ |
250 | static void sctp_endpoint_destroy(struct sctp_endpoint *ep) | 250 | static void sctp_endpoint_destroy(struct sctp_endpoint *ep) |
251 | { | 251 | { |
252 | int i; | ||
253 | |||
252 | SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return); | 254 | SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return); |
253 | 255 | ||
254 | /* Free up the HMAC transform. */ | 256 | /* Free up the HMAC transform. */ |
@@ -271,6 +273,9 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep) | |||
271 | sctp_inq_free(&ep->base.inqueue); | 273 | sctp_inq_free(&ep->base.inqueue); |
272 | sctp_bind_addr_free(&ep->base.bind_addr); | 274 | sctp_bind_addr_free(&ep->base.bind_addr); |
273 | 275 | ||
276 | for (i = 0; i < SCTP_HOW_MANY_SECRETS; ++i) | ||
277 | memset(&ep->secret_key[i], 0, SCTP_SECRET_SIZE); | ||
278 | |||
274 | /* Remove and free the port */ | 279 | /* Remove and free the port */ |
275 | if (sctp_sk(ep->base.sk)->bind_hash) | 280 | if (sctp_sk(ep->base.sk)->bind_hash) |
276 | sctp_put_port(ep->base.sk); | 281 | sctp_put_port(ep->base.sk); |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 9e65758cb038..cedd9bf67b8c 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -3390,7 +3390,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk, | |||
3390 | 3390 | ||
3391 | ret = sctp_auth_set_key(sctp_sk(sk)->ep, asoc, authkey); | 3391 | ret = sctp_auth_set_key(sctp_sk(sk)->ep, asoc, authkey); |
3392 | out: | 3392 | out: |
3393 | kfree(authkey); | 3393 | kzfree(authkey); |
3394 | return ret; | 3394 | return ret; |
3395 | } | 3395 | } |
3396 | 3396 | ||
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index bfa31714581f..fb20f25ddec9 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -98,9 +98,25 @@ __rpc_add_timer(struct rpc_wait_queue *queue, struct rpc_task *task) | |||
98 | list_add(&task->u.tk_wait.timer_list, &queue->timer_list.list); | 98 | list_add(&task->u.tk_wait.timer_list, &queue->timer_list.list); |
99 | } | 99 | } |
100 | 100 | ||
101 | static void rpc_rotate_queue_owner(struct rpc_wait_queue *queue) | ||
102 | { | ||
103 | struct list_head *q = &queue->tasks[queue->priority]; | ||
104 | struct rpc_task *task; | ||
105 | |||
106 | if (!list_empty(q)) { | ||
107 | task = list_first_entry(q, struct rpc_task, u.tk_wait.list); | ||
108 | if (task->tk_owner == queue->owner) | ||
109 | list_move_tail(&task->u.tk_wait.list, q); | ||
110 | } | ||
111 | } | ||
112 | |||
101 | static void rpc_set_waitqueue_priority(struct rpc_wait_queue *queue, int priority) | 113 | static void rpc_set_waitqueue_priority(struct rpc_wait_queue *queue, int priority) |
102 | { | 114 | { |
103 | queue->priority = priority; | 115 | if (queue->priority != priority) { |
116 | /* Fairness: rotate the list when changing priority */ | ||
117 | rpc_rotate_queue_owner(queue); | ||
118 | queue->priority = priority; | ||
119 | } | ||
104 | } | 120 | } |
105 | 121 | ||
106 | static void rpc_set_waitqueue_owner(struct rpc_wait_queue *queue, pid_t pid) | 122 | static void rpc_set_waitqueue_owner(struct rpc_wait_queue *queue, pid_t pid) |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 0a148c9d2a5c..0f679df7d072 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -465,7 +465,7 @@ static int svc_udp_get_dest_address4(struct svc_rqst *rqstp, | |||
465 | } | 465 | } |
466 | 466 | ||
467 | /* | 467 | /* |
468 | * See net/ipv6/datagram.c : datagram_recv_ctl | 468 | * See net/ipv6/datagram.c : ip6_datagram_recv_ctl |
469 | */ | 469 | */ |
470 | static int svc_udp_get_dest_address6(struct svc_rqst *rqstp, | 470 | static int svc_udp_get_dest_address6(struct svc_rqst *rqstp, |
471 | struct cmsghdr *cmh) | 471 | struct cmsghdr *cmh) |
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 01592d7d4789..45f1618c8e23 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -1358,7 +1358,7 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info, | |||
1358 | &iwe, IW_EV_UINT_LEN); | 1358 | &iwe, IW_EV_UINT_LEN); |
1359 | } | 1359 | } |
1360 | 1360 | ||
1361 | buf = kmalloc(30, GFP_ATOMIC); | 1361 | buf = kmalloc(31, GFP_ATOMIC); |
1362 | if (buf) { | 1362 | if (buf) { |
1363 | memset(&iwe, 0, sizeof(iwe)); | 1363 | memset(&iwe, 0, sizeof(iwe)); |
1364 | iwe.cmd = IWEVCUSTOM; | 1364 | iwe.cmd = IWEVCUSTOM; |
diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile index bbbd276659ba..7203e66dcd6f 100644 --- a/samples/seccomp/Makefile +++ b/samples/seccomp/Makefile | |||
@@ -19,6 +19,7 @@ bpf-direct-objs := bpf-direct.o | |||
19 | 19 | ||
20 | # Try to match the kernel target. | 20 | # Try to match the kernel target. |
21 | ifndef CONFIG_64BIT | 21 | ifndef CONFIG_64BIT |
22 | ifndef CROSS_COMPILE | ||
22 | 23 | ||
23 | # s390 has -m31 flag to build 31 bit binaries | 24 | # s390 has -m31 flag to build 31 bit binaries |
24 | ifndef CONFIG_S390 | 25 | ifndef CONFIG_S390 |
@@ -35,6 +36,7 @@ HOSTLOADLIBES_bpf-direct += $(MFLAG) | |||
35 | HOSTLOADLIBES_bpf-fancy += $(MFLAG) | 36 | HOSTLOADLIBES_bpf-fancy += $(MFLAG) |
36 | HOSTLOADLIBES_dropper += $(MFLAG) | 37 | HOSTLOADLIBES_dropper += $(MFLAG) |
37 | endif | 38 | endif |
39 | endif | ||
38 | 40 | ||
39 | # Tell kbuild to always build the programs | 41 | # Tell kbuild to always build the programs |
40 | always := $(hostprogs-y) | 42 | always := $(hostprogs-y) |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4d2c7dfdaabd..2bb08a962ce3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -230,12 +230,12 @@ our $Inline = qr{inline|__always_inline|noinline}; | |||
230 | our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; | 230 | our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; |
231 | our $Lval = qr{$Ident(?:$Member)*}; | 231 | our $Lval = qr{$Ident(?:$Member)*}; |
232 | 232 | ||
233 | our $Float_hex = qr{(?i:0x[0-9a-f]+p-?[0-9]+[fl]?)}; | 233 | our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; |
234 | our $Float_dec = qr{(?i:((?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?))}; | 234 | our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; |
235 | our $Float_int = qr{(?i:[0-9]+e-?[0-9]+[fl]?)}; | 235 | our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; |
236 | our $Float = qr{$Float_hex|$Float_dec|$Float_int}; | 236 | our $Float = qr{$Float_hex|$Float_dec|$Float_int}; |
237 | our $Constant = qr{(?:$Float|(?i:(?:0x[0-9a-f]+|[0-9]+)[ul]*))}; | 237 | our $Constant = qr{$Float|(?i)(?:0x[0-9a-f]+|[0-9]+)[ul]*}; |
238 | our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; | 238 | our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; |
239 | our $Compare = qr{<=|>=|==|!=|<|>}; | 239 | our $Compare = qr{<=|>=|==|!=|<|>}; |
240 | our $Operators = qr{ | 240 | our $Operators = qr{ |
241 | <=|>=|==|!=| | 241 | <=|>=|==|!=| |
diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index a210c8d7b4bc..3b98159d9645 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig | |||
@@ -108,13 +108,18 @@ if SND_IMX_SOC | |||
108 | config SND_SOC_IMX_SSI | 108 | config SND_SOC_IMX_SSI |
109 | tristate | 109 | tristate |
110 | 110 | ||
111 | config SND_SOC_IMX_PCM_FIQ | 111 | config SND_SOC_IMX_PCM |
112 | tristate | 112 | tristate |
113 | |||
114 | config SND_SOC_IMX_PCM_FIQ | ||
115 | bool | ||
113 | select FIQ | 116 | select FIQ |
117 | select SND_SOC_IMX_PCM | ||
114 | 118 | ||
115 | config SND_SOC_IMX_PCM_DMA | 119 | config SND_SOC_IMX_PCM_DMA |
116 | tristate | 120 | bool |
117 | select SND_SOC_DMAENGINE_PCM | 121 | select SND_SOC_DMAENGINE_PCM |
122 | select SND_SOC_IMX_PCM | ||
118 | 123 | ||
119 | config SND_SOC_IMX_AUDMUX | 124 | config SND_SOC_IMX_AUDMUX |
120 | tristate | 125 | tristate |
diff --git a/sound/soc/fsl/Makefile b/sound/soc/fsl/Makefile index ec1457915d7c..afd34794db53 100644 --- a/sound/soc/fsl/Makefile +++ b/sound/soc/fsl/Makefile | |||
@@ -41,10 +41,7 @@ endif | |||
41 | obj-$(CONFIG_SND_SOC_IMX_SSI) += snd-soc-imx-ssi.o | 41 | obj-$(CONFIG_SND_SOC_IMX_SSI) += snd-soc-imx-ssi.o |
42 | obj-$(CONFIG_SND_SOC_IMX_AUDMUX) += snd-soc-imx-audmux.o | 42 | obj-$(CONFIG_SND_SOC_IMX_AUDMUX) += snd-soc-imx-audmux.o |
43 | 43 | ||
44 | obj-$(CONFIG_SND_SOC_IMX_PCM_FIQ) += snd-soc-imx-pcm-fiq.o | 44 | obj-$(CONFIG_SND_SOC_IMX_PCM) += snd-soc-imx-pcm.o |
45 | snd-soc-imx-pcm-fiq-y := imx-pcm-fiq.o imx-pcm.o | ||
46 | obj-$(CONFIG_SND_SOC_IMX_PCM_DMA) += snd-soc-imx-pcm-dma.o | ||
47 | snd-soc-imx-pcm-dma-y := imx-pcm-dma.o imx-pcm.o | ||
48 | 45 | ||
49 | # i.MX Machine Support | 46 | # i.MX Machine Support |
50 | snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o | 47 | snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o |
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c index bf363d8d044a..500f8ce55d78 100644 --- a/sound/soc/fsl/imx-pcm-dma.c +++ b/sound/soc/fsl/imx-pcm-dma.c | |||
@@ -154,26 +154,7 @@ static struct snd_soc_platform_driver imx_soc_platform_mx2 = { | |||
154 | .pcm_free = imx_pcm_free, | 154 | .pcm_free = imx_pcm_free, |
155 | }; | 155 | }; |
156 | 156 | ||
157 | static int imx_soc_platform_probe(struct platform_device *pdev) | 157 | int imx_pcm_dma_init(struct platform_device *pdev) |
158 | { | 158 | { |
159 | return snd_soc_register_platform(&pdev->dev, &imx_soc_platform_mx2); | 159 | return snd_soc_register_platform(&pdev->dev, &imx_soc_platform_mx2); |
160 | } | 160 | } |
161 | |||
162 | static int imx_soc_platform_remove(struct platform_device *pdev) | ||
163 | { | ||
164 | snd_soc_unregister_platform(&pdev->dev); | ||
165 | return 0; | ||
166 | } | ||
167 | |||
168 | static struct platform_driver imx_pcm_driver = { | ||
169 | .driver = { | ||
170 | .name = "imx-pcm-audio", | ||
171 | .owner = THIS_MODULE, | ||
172 | }, | ||
173 | .probe = imx_soc_platform_probe, | ||
174 | .remove = imx_soc_platform_remove, | ||
175 | }; | ||
176 | |||
177 | module_platform_driver(imx_pcm_driver); | ||
178 | MODULE_LICENSE("GPL"); | ||
179 | MODULE_ALIAS("platform:imx-pcm-audio"); | ||
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c index 5ec362ae4d01..920f945cb2f4 100644 --- a/sound/soc/fsl/imx-pcm-fiq.c +++ b/sound/soc/fsl/imx-pcm-fiq.c | |||
@@ -281,7 +281,7 @@ static struct snd_soc_platform_driver imx_soc_platform_fiq = { | |||
281 | .pcm_free = imx_pcm_fiq_free, | 281 | .pcm_free = imx_pcm_fiq_free, |
282 | }; | 282 | }; |
283 | 283 | ||
284 | static int imx_soc_platform_probe(struct platform_device *pdev) | 284 | int imx_pcm_fiq_init(struct platform_device *pdev) |
285 | { | 285 | { |
286 | struct imx_ssi *ssi = platform_get_drvdata(pdev); | 286 | struct imx_ssi *ssi = platform_get_drvdata(pdev); |
287 | int ret; | 287 | int ret; |
@@ -314,23 +314,3 @@ failed_register: | |||
314 | 314 | ||
315 | return ret; | 315 | return ret; |
316 | } | 316 | } |
317 | |||
318 | static int imx_soc_platform_remove(struct platform_device *pdev) | ||
319 | { | ||
320 | snd_soc_unregister_platform(&pdev->dev); | ||
321 | return 0; | ||
322 | } | ||
323 | |||
324 | static struct platform_driver imx_pcm_driver = { | ||
325 | .driver = { | ||
326 | .name = "imx-fiq-pcm-audio", | ||
327 | .owner = THIS_MODULE, | ||
328 | }, | ||
329 | |||
330 | .probe = imx_soc_platform_probe, | ||
331 | .remove = imx_soc_platform_remove, | ||
332 | }; | ||
333 | |||
334 | module_platform_driver(imx_pcm_driver); | ||
335 | |||
336 | MODULE_LICENSE("GPL"); | ||
diff --git a/sound/soc/fsl/imx-pcm.c b/sound/soc/fsl/imx-pcm.c index 0c9f188ddc68..0d0625bfcb65 100644 --- a/sound/soc/fsl/imx-pcm.c +++ b/sound/soc/fsl/imx-pcm.c | |||
@@ -31,6 +31,7 @@ int snd_imx_pcm_mmap(struct snd_pcm_substream *substream, | |||
31 | runtime->dma_bytes); | 31 | runtime->dma_bytes); |
32 | return ret; | 32 | return ret; |
33 | } | 33 | } |
34 | EXPORT_SYMBOL_GPL(snd_imx_pcm_mmap); | ||
34 | 35 | ||
35 | static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) | 36 | static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) |
36 | { | 37 | { |
@@ -79,6 +80,7 @@ int imx_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
79 | out: | 80 | out: |
80 | return ret; | 81 | return ret; |
81 | } | 82 | } |
83 | EXPORT_SYMBOL_GPL(imx_pcm_new); | ||
82 | 84 | ||
83 | void imx_pcm_free(struct snd_pcm *pcm) | 85 | void imx_pcm_free(struct snd_pcm *pcm) |
84 | { | 86 | { |
@@ -100,6 +102,39 @@ void imx_pcm_free(struct snd_pcm *pcm) | |||
100 | buf->area = NULL; | 102 | buf->area = NULL; |
101 | } | 103 | } |
102 | } | 104 | } |
105 | EXPORT_SYMBOL_GPL(imx_pcm_free); | ||
106 | |||
107 | static int imx_pcm_probe(struct platform_device *pdev) | ||
108 | { | ||
109 | if (strcmp(pdev->id_entry->name, "imx-fiq-pcm-audio") == 0) | ||
110 | return imx_pcm_fiq_init(pdev); | ||
111 | |||
112 | return imx_pcm_dma_init(pdev); | ||
113 | } | ||
114 | |||
115 | static int imx_pcm_remove(struct platform_device *pdev) | ||
116 | { | ||
117 | snd_soc_unregister_platform(&pdev->dev); | ||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | static struct platform_device_id imx_pcm_devtype[] = { | ||
122 | { .name = "imx-pcm-audio", }, | ||
123 | { .name = "imx-fiq-pcm-audio", }, | ||
124 | { /* sentinel */ } | ||
125 | }; | ||
126 | MODULE_DEVICE_TABLE(platform, imx_pcm_devtype); | ||
127 | |||
128 | static struct platform_driver imx_pcm_driver = { | ||
129 | .driver = { | ||
130 | .name = "imx-pcm", | ||
131 | .owner = THIS_MODULE, | ||
132 | }, | ||
133 | .id_table = imx_pcm_devtype, | ||
134 | .probe = imx_pcm_probe, | ||
135 | .remove = imx_pcm_remove, | ||
136 | }; | ||
137 | module_platform_driver(imx_pcm_driver); | ||
103 | 138 | ||
104 | MODULE_DESCRIPTION("Freescale i.MX PCM driver"); | 139 | MODULE_DESCRIPTION("Freescale i.MX PCM driver"); |
105 | MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>"); | 140 | MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>"); |
diff --git a/sound/soc/fsl/imx-pcm.h b/sound/soc/fsl/imx-pcm.h index 83c0ed7d55c9..5ae13a13a353 100644 --- a/sound/soc/fsl/imx-pcm.h +++ b/sound/soc/fsl/imx-pcm.h | |||
@@ -30,4 +30,22 @@ int snd_imx_pcm_mmap(struct snd_pcm_substream *substream, | |||
30 | int imx_pcm_new(struct snd_soc_pcm_runtime *rtd); | 30 | int imx_pcm_new(struct snd_soc_pcm_runtime *rtd); |
31 | void imx_pcm_free(struct snd_pcm *pcm); | 31 | void imx_pcm_free(struct snd_pcm *pcm); |
32 | 32 | ||
33 | #ifdef CONFIG_SND_SOC_IMX_PCM_DMA | ||
34 | int imx_pcm_dma_init(struct platform_device *pdev); | ||
35 | #else | ||
36 | static inline int imx_pcm_dma_init(struct platform_device *pdev) | ||
37 | { | ||
38 | return -ENODEV; | ||
39 | } | ||
40 | #endif | ||
41 | |||
42 | #ifdef CONFIG_SND_SOC_IMX_PCM_FIQ | ||
43 | int imx_pcm_fiq_init(struct platform_device *pdev); | ||
44 | #else | ||
45 | static inline int imx_pcm_fiq_init(struct platform_device *pdev) | ||
46 | { | ||
47 | return -ENODEV; | ||
48 | } | ||
49 | #endif | ||
50 | |||
33 | #endif /* _IMX_PCM_H */ | 51 | #endif /* _IMX_PCM_H */ |
diff --git a/tools/vm/.gitignore b/tools/vm/.gitignore new file mode 100644 index 000000000000..44f095fa2604 --- /dev/null +++ b/tools/vm/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | slabinfo | ||
2 | page-types | ||