diff options
| -rw-r--r-- | arch/arm/boot/compressed/head.S | 1 | ||||
| -rw-r--r-- | arch/arm/include/asm/unistd.h | 2 | ||||
| -rw-r--r-- | arch/arm/kernel/calls.S | 1 | ||||
| -rw-r--r-- | arch/arm/kernel/smp_twd.c | 48 | ||||
| -rw-r--r-- | arch/m68k/platform/coldfire/clk.c | 6 | ||||
| -rw-r--r-- | drivers/clk/Makefile | 1 | ||||
| -rw-r--r-- | drivers/clk/clk-devres.c | 55 | ||||
| -rw-r--r-- | drivers/clk/clkdev.c | 45 |
8 files changed, 106 insertions, 53 deletions
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 81769c1341fa..bc67cbff3944 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
| @@ -653,6 +653,7 @@ __armv7_mmu_cache_on: | |||
| 653 | mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs | 653 | mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs |
| 654 | #endif | 654 | #endif |
| 655 | mrc p15, 0, r0, c1, c0, 0 @ read control reg | 655 | mrc p15, 0, r0, c1, c0, 0 @ read control reg |
| 656 | bic r0, r0, #1 << 28 @ clear SCTLR.TRE | ||
| 656 | orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement | 657 | orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement |
| 657 | orr r0, r0, #0x003c @ write buffer | 658 | orr r0, r0, #0x003c @ write buffer |
| 658 | #ifdef CONFIG_MMU | 659 | #ifdef CONFIG_MMU |
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h index 0cab47d4a83f..2fde5fd1acce 100644 --- a/arch/arm/include/asm/unistd.h +++ b/arch/arm/include/asm/unistd.h | |||
| @@ -404,6 +404,7 @@ | |||
| 404 | #define __NR_setns (__NR_SYSCALL_BASE+375) | 404 | #define __NR_setns (__NR_SYSCALL_BASE+375) |
| 405 | #define __NR_process_vm_readv (__NR_SYSCALL_BASE+376) | 405 | #define __NR_process_vm_readv (__NR_SYSCALL_BASE+376) |
| 406 | #define __NR_process_vm_writev (__NR_SYSCALL_BASE+377) | 406 | #define __NR_process_vm_writev (__NR_SYSCALL_BASE+377) |
| 407 | /* 378 for kcmp */ | ||
| 407 | 408 | ||
| 408 | /* | 409 | /* |
| 409 | * The following SWIs are ARM private. | 410 | * The following SWIs are ARM private. |
| @@ -483,6 +484,7 @@ | |||
| 483 | */ | 484 | */ |
| 484 | #define __IGNORE_fadvise64_64 | 485 | #define __IGNORE_fadvise64_64 |
| 485 | #define __IGNORE_migrate_pages | 486 | #define __IGNORE_migrate_pages |
| 487 | #define __IGNORE_kcmp | ||
| 486 | 488 | ||
| 487 | #endif /* __KERNEL__ */ | 489 | #endif /* __KERNEL__ */ |
| 488 | #endif /* __ASM_ARM_UNISTD_H */ | 490 | #endif /* __ASM_ARM_UNISTD_H */ |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 463ff4a0ec8a..e337879595e5 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
| @@ -387,6 +387,7 @@ | |||
| 387 | /* 375 */ CALL(sys_setns) | 387 | /* 375 */ CALL(sys_setns) |
| 388 | CALL(sys_process_vm_readv) | 388 | CALL(sys_process_vm_readv) |
| 389 | CALL(sys_process_vm_writev) | 389 | CALL(sys_process_vm_writev) |
| 390 | CALL(sys_ni_syscall) /* reserved for sys_kcmp */ | ||
| 390 | #ifndef syscalls_counted | 391 | #ifndef syscalls_counted |
| 391 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls | 392 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls |
| 392 | #define syscalls_counted | 393 | #define syscalls_counted |
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index fef42b21cecb..e1f906989bb8 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/clk.h> | 13 | #include <linux/clk.h> |
| 14 | #include <linux/cpufreq.h> | ||
| 15 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
| 16 | #include <linux/device.h> | 15 | #include <linux/device.h> |
| 17 | #include <linux/err.h> | 16 | #include <linux/err.h> |
| @@ -96,7 +95,52 @@ static void twd_timer_stop(struct clock_event_device *clk) | |||
| 96 | disable_percpu_irq(clk->irq); | 95 | disable_percpu_irq(clk->irq); |
| 97 | } | 96 | } |
| 98 | 97 | ||
| 99 | #ifdef CONFIG_CPU_FREQ | 98 | #ifdef CONFIG_COMMON_CLK |
| 99 | |||
| 100 | /* | ||
| 101 | * Updates clockevent frequency when the cpu frequency changes. | ||
| 102 | * Called on the cpu that is changing frequency with interrupts disabled. | ||
| 103 | */ | ||
| 104 | static void twd_update_frequency(void *new_rate) | ||
| 105 | { | ||
| 106 | twd_timer_rate = *((unsigned long *) new_rate); | ||
| 107 | |||
| 108 | clockevents_update_freq(*__this_cpu_ptr(twd_evt), twd_timer_rate); | ||
| 109 | } | ||
| 110 | |||
| 111 | static int twd_rate_change(struct notifier_block *nb, | ||
| 112 | unsigned long flags, void *data) | ||
| 113 | { | ||
| 114 | struct clk_notifier_data *cnd = data; | ||
| 115 | |||
| 116 | /* | ||
| 117 | * The twd clock events must be reprogrammed to account for the new | ||
| 118 | * frequency. The timer is local to a cpu, so cross-call to the | ||
| 119 | * changing cpu. | ||
| 120 | */ | ||
| 121 | if (flags == POST_RATE_CHANGE) | ||
| 122 | smp_call_function(twd_update_frequency, | ||
| 123 | (void *)&cnd->new_rate, 1); | ||
| 124 | |||
| 125 | return NOTIFY_OK; | ||
| 126 | } | ||
| 127 | |||
| 128 | static struct notifier_block twd_clk_nb = { | ||
| 129 | .notifier_call = twd_rate_change, | ||
| 130 | }; | ||
| 131 | |||
| 132 | static int twd_clk_init(void) | ||
| 133 | { | ||
| 134 | if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk)) | ||
| 135 | return clk_notifier_register(twd_clk, &twd_clk_nb); | ||
| 136 | |||
| 137 | return 0; | ||
| 138 | } | ||
| 139 | core_initcall(twd_clk_init); | ||
| 140 | |||
| 141 | #elif defined (CONFIG_CPU_FREQ) | ||
| 142 | |||
| 143 | #include <linux/cpufreq.h> | ||
| 100 | 144 | ||
| 101 | /* | 145 | /* |
| 102 | * Updates clockevent frequency when the cpu frequency changes. | 146 | * Updates clockevent frequency when the cpu frequency changes. |
diff --git a/arch/m68k/platform/coldfire/clk.c b/arch/m68k/platform/coldfire/clk.c index 75f9ee967ea7..9cd13b4ce42b 100644 --- a/arch/m68k/platform/coldfire/clk.c +++ b/arch/m68k/platform/coldfire/clk.c | |||
| @@ -146,9 +146,3 @@ struct clk_ops clk_ops1 = { | |||
| 146 | }; | 146 | }; |
| 147 | #endif /* MCFPM_PPMCR1 */ | 147 | #endif /* MCFPM_PPMCR1 */ |
| 148 | #endif /* MCFPM_PPMCR0 */ | 148 | #endif /* MCFPM_PPMCR0 */ |
| 149 | |||
| 150 | struct clk *devm_clk_get(struct device *dev, const char *id) | ||
| 151 | { | ||
| 152 | return NULL; | ||
| 153 | } | ||
| 154 | EXPORT_SYMBOL(devm_clk_get); | ||
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 5869ea387054..72ce247a0e8d 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | # common clock types | 1 | # common clock types |
| 2 | obj-$(CONFIG_HAVE_CLK) += clk-devres.o | ||
| 2 | obj-$(CONFIG_CLKDEV_LOOKUP) += clkdev.o | 3 | obj-$(CONFIG_CLKDEV_LOOKUP) += clkdev.o |
| 3 | obj-$(CONFIG_COMMON_CLK) += clk.o clk-fixed-rate.o clk-gate.o \ | 4 | obj-$(CONFIG_COMMON_CLK) += clk.o clk-fixed-rate.o clk-gate.o \ |
| 4 | clk-mux.o clk-divider.o clk-fixed-factor.o | 5 | clk-mux.o clk-divider.o clk-fixed-factor.o |
diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c new file mode 100644 index 000000000000..8f571548870f --- /dev/null +++ b/drivers/clk/clk-devres.c | |||
| @@ -0,0 +1,55 @@ | |||
| 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 | |||
| 7 | #include <linux/clk.h> | ||
| 8 | #include <linux/device.h> | ||
| 9 | #include <linux/export.h> | ||
| 10 | #include <linux/gfp.h> | ||
| 11 | |||
| 12 | static void devm_clk_release(struct device *dev, void *res) | ||
| 13 | { | ||
| 14 | clk_put(*(struct clk **)res); | ||
| 15 | } | ||
| 16 | |||
| 17 | struct clk *devm_clk_get(struct device *dev, const char *id) | ||
| 18 | { | ||
| 19 | struct clk **ptr, *clk; | ||
| 20 | |||
| 21 | ptr = devres_alloc(devm_clk_release, sizeof(*ptr), GFP_KERNEL); | ||
| 22 | if (!ptr) | ||
| 23 | return ERR_PTR(-ENOMEM); | ||
| 24 | |||
| 25 | clk = clk_get(dev, id); | ||
| 26 | if (!IS_ERR(clk)) { | ||
| 27 | *ptr = clk; | ||
| 28 | devres_add(dev, ptr); | ||
| 29 | } else { | ||
| 30 | devres_free(ptr); | ||
| 31 | } | ||
| 32 | |||
| 33 | return clk; | ||
| 34 | } | ||
| 35 | EXPORT_SYMBOL(devm_clk_get); | ||
| 36 | |||
| 37 | static int devm_clk_match(struct device *dev, void *res, void *data) | ||
| 38 | { | ||
| 39 | struct clk **c = res; | ||
| 40 | if (!c || !*c) { | ||
| 41 | WARN_ON(!c || !*c); | ||
| 42 | return 0; | ||
| 43 | } | ||
| 44 | return *c == data; | ||
| 45 | } | ||
| 46 | |||
| 47 | void devm_clk_put(struct device *dev, struct clk *clk) | ||
| 48 | { | ||
| 49 | int ret; | ||
| 50 | |||
| 51 | ret = devres_release(dev, devm_clk_release, devm_clk_match, clk); | ||
| 52 | |||
| 53 | WARN_ON(ret); | ||
| 54 | } | ||
| 55 | EXPORT_SYMBOL(devm_clk_put); | ||
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index d423c9bdd71a..442a31363873 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c | |||
| @@ -171,51 +171,6 @@ void clk_put(struct clk *clk) | |||
| 171 | } | 171 | } |
| 172 | EXPORT_SYMBOL(clk_put); | 172 | EXPORT_SYMBOL(clk_put); |
| 173 | 173 | ||
| 174 | static void devm_clk_release(struct device *dev, void *res) | ||
| 175 | { | ||
| 176 | clk_put(*(struct clk **)res); | ||
| 177 | } | ||
| 178 | |||
| 179 | struct clk *devm_clk_get(struct device *dev, const char *id) | ||
| 180 | { | ||
| 181 | struct clk **ptr, *clk; | ||
| 182 | |||
| 183 | ptr = devres_alloc(devm_clk_release, sizeof(*ptr), GFP_KERNEL); | ||
| 184 | if (!ptr) | ||
| 185 | return ERR_PTR(-ENOMEM); | ||
| 186 | |||
| 187 | clk = clk_get(dev, id); | ||
| 188 | if (!IS_ERR(clk)) { | ||
| 189 | *ptr = clk; | ||
| 190 | devres_add(dev, ptr); | ||
| 191 | } else { | ||
| 192 | devres_free(ptr); | ||
| 193 | } | ||
| 194 | |||
| 195 | return clk; | ||
| 196 | } | ||
| 197 | EXPORT_SYMBOL(devm_clk_get); | ||
| 198 | |||
| 199 | static int devm_clk_match(struct device *dev, void *res, void *data) | ||
| 200 | { | ||
| 201 | struct clk **c = res; | ||
| 202 | if (!c || !*c) { | ||
| 203 | WARN_ON(!c || !*c); | ||
| 204 | return 0; | ||
| 205 | } | ||
| 206 | return *c == data; | ||
| 207 | } | ||
| 208 | |||
| 209 | void devm_clk_put(struct device *dev, struct clk *clk) | ||
| 210 | { | ||
| 211 | int ret; | ||
| 212 | |||
| 213 | ret = devres_destroy(dev, devm_clk_release, devm_clk_match, clk); | ||
| 214 | |||
| 215 | WARN_ON(ret); | ||
| 216 | } | ||
| 217 | EXPORT_SYMBOL(devm_clk_put); | ||
| 218 | |||
| 219 | void clkdev_add(struct clk_lookup *cl) | 174 | void clkdev_add(struct clk_lookup *cl) |
| 220 | { | 175 | { |
| 221 | mutex_lock(&clocks_mutex); | 176 | mutex_lock(&clocks_mutex); |
