Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'fixes', 'misc', 'pm' and 'sa1100' into for-next

+1201 -796
+4
Documentation/power/runtime_pm.txt
··· 468 468 - set the power.irq_safe flag for the device, causing the runtime-PM 469 469 callbacks to be invoked with interrupts off 470 470 471 + bool pm_runtime_is_irq_safe(struct device *dev); 472 + - return true if power.irq_safe flag was set for the device, causing 473 + the runtime-PM callbacks to be invoked with interrupts off 474 + 471 475 void pm_runtime_mark_last_busy(struct device *dev); 472 476 - set the power.last_busy field to the current time 473 477
+2
arch/arm/Kconfig
··· 702 702 select CPU_SA1100 703 703 select GENERIC_CLOCKEVENTS 704 704 select HAVE_IDE 705 + select IRQ_DOMAIN 705 706 select ISA 707 + select MULTI_IRQ_HANDLER 706 708 select NEED_MACH_MEMORY_H 707 709 select SPARSE_IRQ 708 710 help
+6 -7
arch/arm/common/sa1111.c
··· 282 282 } 283 283 284 284 if (i == 8) 285 - printk(KERN_ERR "Danger Will Robinson: failed to " 286 - "re-trigger IRQ%d\n", d->irq); 285 + pr_err("Danger Will Robinson: failed to re-trigger IRQ%d\n", 286 + d->irq); 287 287 return i == 8 ? -1 : 0; 288 288 } 289 289 ··· 384 384 } 385 385 386 386 if (i == 8) 387 - printk(KERN_ERR "Danger Will Robinson: failed to " 388 - "re-trigger IRQ%d\n", d->irq); 387 + pr_err("Danger Will Robinson: failed to re-trigger IRQ%d\n", 388 + d->irq); 389 389 return i == 8 ? -1 : 0; 390 390 } 391 391 ··· 740 740 goto err_unmap; 741 741 } 742 742 743 - printk(KERN_INFO "SA1111 Microprocessor Companion Chip: " 744 - "silicon revision %lx, metal revision %lx\n", 745 - (id & SKID_SIREV_MASK)>>4, (id & SKID_MTREV_MASK)); 743 + pr_info("SA1111 Microprocessor Companion Chip: silicon revision %lx, metal revision %lx\n", 744 + (id & SKID_SIREV_MASK) >> 4, id & SKID_MTREV_MASK); 746 745 747 746 /* 748 747 * We found it. Wake the chip up, and initialise.
+1
arch/arm/include/asm/hw_irq.h
··· 8 8 { 9 9 extern unsigned long irq_err_count; 10 10 irq_err_count++; 11 + pr_crit("unexpected IRQ trap at vector %02x\n", irq); 11 12 } 12 13 13 14 void set_irq_flags(unsigned int irq, unsigned int flags);
+17
arch/arm/include/asm/mcpm.h
··· 219 219 bool __mcpm_outbound_enter_critical(unsigned int this_cpu, unsigned int cluster); 220 220 int __mcpm_cluster_state(unsigned int cluster); 221 221 222 + /** 223 + * mcpm_sync_init - Initialize the cluster synchronization support 224 + * 225 + * @power_up_setup: platform specific function invoked during very 226 + * early CPU/cluster bringup stage. 227 + * 228 + * This prepares memory used by vlocks and the MCPM state machine used 229 + * across CPUs that may have their caches active or inactive. Must be 230 + * called only after a successful call to mcpm_platform_register(). 231 + * 232 + * The power_up_setup argument is a pointer to assembly code called when 233 + * the MMU and caches are still disabled during boot and no stack space is 234 + * available. The affinity level passed to that code corresponds to the 235 + * resource that needs to be initialized (e.g. 1 for cluster level, 0 for 236 + * CPU level). Proper exclusion mechanisms are already activated at that 237 + * point. 238 + */ 222 239 int __init mcpm_sync_init( 223 240 void (*power_up_setup)(unsigned int affinity_level)); 224 241
+2 -2
arch/arm/include/asm/percpu.h
··· 30 30 static inline unsigned long __my_cpu_offset(void) 31 31 { 32 32 unsigned long off; 33 - register unsigned long *sp asm ("sp"); 34 33 35 34 /* 36 35 * Read TPIDRPRW. 37 36 * We want to allow caching the value, so avoid using volatile and 38 37 * instead use a fake stack read to hazard against barrier(). 39 38 */ 40 - asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) : "Q" (*sp)); 39 + asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) 40 + : "Q" (*(const unsigned long *)current_stack_pointer)); 41 41 42 42 return off; 43 43 }
+9 -1
arch/arm/include/asm/pgalloc.h
··· 157 157 static inline void 158 158 pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep) 159 159 { 160 - __pmd_populate(pmdp, page_to_phys(ptep), _PAGE_USER_TABLE); 160 + extern pmdval_t user_pmd_table; 161 + pmdval_t prot; 162 + 163 + if (__LINUX_ARM_ARCH__ >= 6 && !IS_ENABLED(CONFIG_ARM_LPAE)) 164 + prot = user_pmd_table; 165 + else 166 + prot = _PAGE_USER_TABLE; 167 + 168 + __pmd_populate(pmdp, page_to_phys(ptep), prot); 161 169 } 162 170 #define pmd_pgtable(pmd) pmd_page(pmd) 163 171
+2
arch/arm/include/asm/pgtable-2level-hwdef.h
··· 20 20 #define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0) 21 21 #define PMD_TYPE_TABLE (_AT(pmdval_t, 1) << 0) 22 22 #define PMD_TYPE_SECT (_AT(pmdval_t, 2) << 0) 23 + #define PMD_PXNTABLE (_AT(pmdval_t, 1) << 2) /* v7 */ 23 24 #define PMD_BIT4 (_AT(pmdval_t, 1) << 4) 24 25 #define PMD_DOMAIN(x) (_AT(pmdval_t, (x)) << 5) 25 26 #define PMD_PROTECTION (_AT(pmdval_t, 1) << 9) /* v5 */ 26 27 /* 27 28 * - section 28 29 */ 30 + #define PMD_SECT_PXN (_AT(pmdval_t, 1) << 0) /* v7 */ 29 31 #define PMD_SECT_BUFFERABLE (_AT(pmdval_t, 1) << 2) 30 32 #define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3) 31 33 #define PMD_SECT_XN (_AT(pmdval_t, 1) << 4) /* v6 */
+1
arch/arm/include/asm/pgtable-3level-hwdef.h
··· 76 76 #define PTE_EXT_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */ 77 77 #define PTE_EXT_AF (_AT(pteval_t, 1) << 10) /* Access Flag */ 78 78 #define PTE_EXT_NG (_AT(pteval_t, 1) << 11) /* nG */ 79 + #define PTE_EXT_PXN (_AT(pteval_t, 1) << 53) /* PXN */ 79 80 #define PTE_EXT_XN (_AT(pteval_t, 1) << 54) /* XN */ 80 81 81 82 /*
+50 -10
arch/arm/include/asm/pgtable.h
··· 252 252 set_pte_ext(ptep, pteval, ext); 253 253 } 254 254 255 - #define PTE_BIT_FUNC(fn,op) \ 256 - static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } 255 + static inline pte_t clear_pte_bit(pte_t pte, pgprot_t prot) 256 + { 257 + pte_val(pte) &= ~pgprot_val(prot); 258 + return pte; 259 + } 257 260 258 - PTE_BIT_FUNC(wrprotect, |= L_PTE_RDONLY); 259 - PTE_BIT_FUNC(mkwrite, &= ~L_PTE_RDONLY); 260 - PTE_BIT_FUNC(mkclean, &= ~L_PTE_DIRTY); 261 - PTE_BIT_FUNC(mkdirty, |= L_PTE_DIRTY); 262 - PTE_BIT_FUNC(mkold, &= ~L_PTE_YOUNG); 263 - PTE_BIT_FUNC(mkyoung, |= L_PTE_YOUNG); 264 - PTE_BIT_FUNC(mkexec, &= ~L_PTE_XN); 265 - PTE_BIT_FUNC(mknexec, |= L_PTE_XN); 261 + static inline pte_t set_pte_bit(pte_t pte, pgprot_t prot) 262 + { 263 + pte_val(pte) |= pgprot_val(prot); 264 + return pte; 265 + } 266 + 267 + static inline pte_t pte_wrprotect(pte_t pte) 268 + { 269 + return set_pte_bit(pte, __pgprot(L_PTE_RDONLY)); 270 + } 271 + 272 + static inline pte_t pte_mkwrite(pte_t pte) 273 + { 274 + return clear_pte_bit(pte, __pgprot(L_PTE_RDONLY)); 275 + } 276 + 277 + static inline pte_t pte_mkclean(pte_t pte) 278 + { 279 + return clear_pte_bit(pte, __pgprot(L_PTE_DIRTY)); 280 + } 281 + 282 + static inline pte_t pte_mkdirty(pte_t pte) 283 + { 284 + return set_pte_bit(pte, __pgprot(L_PTE_DIRTY)); 285 + } 286 + 287 + static inline pte_t pte_mkold(pte_t pte) 288 + { 289 + return clear_pte_bit(pte, __pgprot(L_PTE_YOUNG)); 290 + } 291 + 292 + static inline pte_t pte_mkyoung(pte_t pte) 293 + { 294 + return set_pte_bit(pte, __pgprot(L_PTE_YOUNG)); 295 + } 296 + 297 + static inline pte_t pte_mkexec(pte_t pte) 298 + { 299 + return clear_pte_bit(pte, __pgprot(L_PTE_XN)); 300 + } 301 + 302 + static inline pte_t pte_mknexec(pte_t pte) 303 + { 304 + return set_pte_bit(pte, __pgprot(L_PTE_XN)); 305 + } 266 306 267 307 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 268 308 {
+2 -3
arch/arm/include/asm/ptrace.h
··· 154 154 return regs->ARM_sp; 155 155 } 156 156 157 - #define current_pt_regs(void) ({ \ 158 - register unsigned long sp asm ("sp"); \ 159 - (struct pt_regs *)((sp | (THREAD_SIZE - 1)) - 7) - 1; \ 157 + #define current_pt_regs(void) ({ (struct pt_regs *) \ 158 + ((current_stack_pointer | (THREAD_SIZE - 1)) - 7) - 1; \ 160 159 }) 161 160 162 161 #endif /* __ASSEMBLY__ */
+7 -2
arch/arm/include/asm/thread_info.h
··· 90 90 #define init_stack (init_thread_union.stack) 91 91 92 92 /* 93 + * how to get the current stack pointer in C 94 + */ 95 + register unsigned long current_stack_pointer asm ("sp"); 96 + 97 + /* 93 98 * how to get the thread information struct from C 94 99 */ 95 100 static inline struct thread_info *current_thread_info(void) __attribute_const__; 96 101 97 102 static inline struct thread_info *current_thread_info(void) 98 103 { 99 - register unsigned long sp asm ("sp"); 100 - return (struct thread_info *)(sp & ~(THREAD_SIZE - 1)); 104 + return (struct thread_info *) 105 + (current_stack_pointer & ~(THREAD_SIZE - 1)); 101 106 } 102 107 103 108 #define thread_saved_pc(tsk) \
+5
arch/arm/include/asm/vfp.h
··· 22 22 #define FPSID_NODOUBLE (1<<20) 23 23 #define FPSID_ARCH_BIT (16) 24 24 #define FPSID_ARCH_MASK (0xF << FPSID_ARCH_BIT) 25 + #define FPSID_CPUID_ARCH_MASK (0x7F << FPSID_ARCH_BIT) 25 26 #define FPSID_PART_BIT (8) 26 27 #define FPSID_PART_MASK (0xFF << FPSID_PART_BIT) 27 28 #define FPSID_VARIANT_BIT (4) ··· 76 75 /* MVFR0 bits */ 77 76 #define MVFR0_A_SIMD_BIT (0) 78 77 #define MVFR0_A_SIMD_MASK (0xf << MVFR0_A_SIMD_BIT) 78 + #define MVFR0_SP_BIT (4) 79 + #define MVFR0_SP_MASK (0xf << MVFR0_SP_BIT) 80 + #define MVFR0_DP_BIT (8) 81 + #define MVFR0_DP_MASK (0xf << MVFR0_DP_BIT) 79 82 80 83 /* Bit patterns for decoding the packaged operation descriptors */ 81 84 #define VFPOPDESC_LENGTH_BIT (9)
+2
arch/arm/kernel/Makefile
··· 47 47 obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o 48 48 obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o 49 49 obj-$(CONFIG_ARM_ARCH_TIMER) += arch_timer.o 50 + obj-$(CONFIG_FUNCTION_TRACER) += entry-ftrace.o 50 51 obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o insn.o 51 52 obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o insn.o 52 53 obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o ··· 85 84 obj-$(CONFIG_IWMMXT) += iwmmxt.o 86 85 obj-$(CONFIG_PERF_EVENTS) += perf_regs.o 87 86 obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o 87 + CFLAGS_pj4-cp0.o := -marm 88 88 AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt 89 89 obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o 90 90
+2 -4
arch/arm/kernel/atags_compat.c
··· 97 97 struct tag *tag = taglist; 98 98 99 99 if (params->u1.s.page_size != PAGE_SIZE) { 100 - printk(KERN_WARNING "Warning: bad configuration page, " 101 - "trying to continue\n"); 100 + pr_warn("Warning: bad configuration page, trying to continue\n"); 102 101 return; 103 102 } 104 103 ··· 108 109 params->u1.s.nr_pages != 0x04000 && 109 110 params->u1.s.nr_pages != 0x08000 && 110 111 params->u1.s.nr_pages != 0x10000) { 111 - printk(KERN_WARNING "Warning: bad NeTTrom parameters " 112 - "detected, using defaults\n"); 112 + pr_warn("Warning: bad NeTTrom parameters detected, using defaults\n"); 113 113 114 114 params->u1.s.nr_pages = 0x1000; /* 16MB */ 115 115 params->u1.s.ramdisk_size = 0;
+2 -3
arch/arm/kernel/atags_parse.c
··· 167 167 { 168 168 for (; t->hdr.size; t = tag_next(t)) 169 169 if (!parse_tag(t)) 170 - printk(KERN_WARNING 171 - "Ignoring unrecognised tag 0x%08x\n", 170 + pr_warn("Ignoring unrecognised tag 0x%08x\n", 172 171 t->hdr.tag); 173 172 } 174 173 ··· 192 193 */ 193 194 for_each_machine_desc(p) 194 195 if (machine_nr == p->nr) { 195 - printk("Machine: %s\n", p->name); 196 + pr_info("Machine: %s\n", p->name); 196 197 mdesc = p; 197 198 break; 198 199 }
+2 -2
arch/arm/kernel/atags_proc.c
··· 41 41 size_t size; 42 42 43 43 if (tag->hdr.tag != ATAG_CORE) { 44 - printk(KERN_INFO "No ATAGs?"); 44 + pr_info("No ATAGs?"); 45 45 return -EINVAL; 46 46 } 47 47 ··· 68 68 69 69 nomem: 70 70 kfree(b); 71 - printk(KERN_ERR "Exporting ATAGs: not enough memory\n"); 71 + pr_err("Exporting ATAGs: not enough memory\n"); 72 72 73 73 return -ENOMEM; 74 74 }
+1 -1
arch/arm/kernel/bios32.c
··· 355 355 /* 356 356 * Report what we did for this bus 357 357 */ 358 - printk(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n", 358 + pr_info("PCI: bus%d: Fast back to back transfers %sabled\n", 359 359 bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis"); 360 360 } 361 361 EXPORT_SYMBOL(pcibios_fixup_bus);
+2 -2
arch/arm/kernel/dma-isa.c
··· 213 213 for (chan = 0; chan < 8; chan++) { 214 214 int ret = isa_dma_add(chan, &isa_dma[chan]); 215 215 if (ret) 216 - printk(KERN_ERR "ISADMA%u: unable to register: %d\n", 217 - chan, ret); 216 + pr_err("ISADMA%u: unable to register: %d\n", 217 + chan, ret); 218 218 } 219 219 220 220 request_dma(DMA_ISA_CASCADE, "cascade");
+11 -15
arch/arm/kernel/dma.c
··· 79 79 return ret; 80 80 81 81 bad_dma: 82 - printk(KERN_ERR "dma: trying to allocate DMA%d\n", chan); 82 + pr_err("dma: trying to allocate DMA%d\n", chan); 83 83 return -EINVAL; 84 84 85 85 busy: ··· 100 100 goto bad_dma; 101 101 102 102 if (dma->active) { 103 - printk(KERN_ERR "dma%d: freeing active DMA\n", chan); 103 + pr_err("dma%d: freeing active DMA\n", chan); 104 104 dma->d_ops->disable(chan, dma); 105 105 dma->active = 0; 106 106 } ··· 111 111 return; 112 112 } 113 113 114 - printk(KERN_ERR "dma%d: trying to free free DMA\n", chan); 114 + pr_err("dma%d: trying to free free DMA\n", chan); 115 115 return; 116 116 117 117 bad_dma: 118 - printk(KERN_ERR "dma: trying to free DMA%d\n", chan); 118 + pr_err("dma: trying to free DMA%d\n", chan); 119 119 } 120 120 EXPORT_SYMBOL(free_dma); 121 121 ··· 126 126 dma_t *dma = dma_channel(chan); 127 127 128 128 if (dma->active) 129 - printk(KERN_ERR "dma%d: altering DMA SG while " 130 - "DMA active\n", chan); 129 + pr_err("dma%d: altering DMA SG while DMA active\n", chan); 131 130 132 131 dma->sg = sg; 133 132 dma->sgcount = nr_sg; ··· 143 144 dma_t *dma = dma_channel(chan); 144 145 145 146 if (dma->active) 146 - printk(KERN_ERR "dma%d: altering DMA address while " 147 - "DMA active\n", chan); 147 + pr_err("dma%d: altering DMA address while DMA active\n", chan); 148 148 149 149 dma->sg = NULL; 150 150 dma->addr = addr; ··· 160 162 dma_t *dma = dma_channel(chan); 161 163 162 164 if (dma->active) 163 - printk(KERN_ERR "dma%d: altering DMA count while " 164 - "DMA active\n", chan); 165 + pr_err("dma%d: altering DMA count while DMA active\n", chan); 165 166 166 167 dma->sg = NULL; 167 168 dma->count = count; ··· 175 178 dma_t *dma = dma_channel(chan); 176 179 177 180 if (dma->active) 178 - printk(KERN_ERR "dma%d: altering DMA mode while " 179 - "DMA active\n", chan); 181 + pr_err("dma%d: altering DMA mode while DMA active\n", chan); 180 182 181 183 dma->dma_mode = mode; 182 184 dma->invalid = 1; ··· 198 202 return; 199 203 200 204 free_dma: 201 - printk(KERN_ERR "dma%d: trying to enable free DMA\n", chan); 205 + pr_err("dma%d: trying to enable free DMA\n", chan); 202 206 BUG(); 203 207 } 204 208 EXPORT_SYMBOL(enable_dma); ··· 219 223 return; 220 224 221 225 free_dma: 222 - printk(KERN_ERR "dma%d: trying to disable free DMA\n", chan); 226 + pr_err("dma%d: trying to disable free DMA\n", chan); 223 227 BUG(); 224 228 } 225 229 EXPORT_SYMBOL(disable_dma); ··· 236 240 237 241 void set_dma_page(unsigned int chan, char pagenr) 238 242 { 239 - printk(KERN_ERR "dma%d: trying to set_dma_page\n", chan); 243 + pr_err("dma%d: trying to set_dma_page\n", chan); 240 244 } 241 245 EXPORT_SYMBOL(set_dma_page); 242 246
-235
arch/arm/kernel/entry-common.S
··· 109 109 #undef CALL 110 110 #define CALL(x) .long x 111 111 112 - #ifdef CONFIG_FUNCTION_TRACER 113 - /* 114 - * When compiling with -pg, gcc inserts a call to the mcount routine at the 115 - * start of every function. In mcount, apart from the function's address (in 116 - * lr), we need to get hold of the function's caller's address. 117 - * 118 - * Older GCCs (pre-4.4) inserted a call to a routine called mcount like this: 119 - * 120 - * bl mcount 121 - * 122 - * These versions have the limitation that in order for the mcount routine to 123 - * be able to determine the function's caller's address, an APCS-style frame 124 - * pointer (which is set up with something like the code below) is required. 125 - * 126 - * mov ip, sp 127 - * push {fp, ip, lr, pc} 128 - * sub fp, ip, #4 129 - * 130 - * With EABI, these frame pointers are not available unless -mapcs-frame is 131 - * specified, and if building as Thumb-2, not even then. 132 - * 133 - * Newer GCCs (4.4+) solve this problem by introducing a new version of mcount, 134 - * with call sites like: 135 - * 136 - * push {lr} 137 - * bl __gnu_mcount_nc 138 - * 139 - * With these compilers, frame pointers are not necessary. 140 - * 141 - * mcount can be thought of as a function called in the middle of a subroutine 142 - * call. As such, it needs to be transparent for both the caller and the 143 - * callee: the original lr needs to be restored when leaving mcount, and no 144 - * registers should be clobbered. (In the __gnu_mcount_nc implementation, we 145 - * clobber the ip register. This is OK because the ARM calling convention 146 - * allows it to be clobbered in subroutines and doesn't use it to hold 147 - * parameters.) 148 - * 149 - * When using dynamic ftrace, we patch out the mcount call by a "mov r0, r0" 150 - * for the mcount case, and a "pop {lr}" for the __gnu_mcount_nc case (see 151 - * arch/arm/kernel/ftrace.c). 152 - */ 153 - 154 - #ifndef CONFIG_OLD_MCOUNT 155 - #if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) 156 - #error Ftrace requires CONFIG_FRAME_POINTER=y with GCC older than 4.4.0. 157 - #endif 158 - #endif 159 - 160 - .macro mcount_adjust_addr rd, rn 161 - bic \rd, \rn, #1 @ clear the Thumb bit if present 162 - sub \rd, \rd, #MCOUNT_INSN_SIZE 163 - .endm 164 - 165 - .macro __mcount suffix 166 - mcount_enter 167 - ldr r0, =ftrace_trace_function 168 - ldr r2, [r0] 169 - adr r0, .Lftrace_stub 170 - cmp r0, r2 171 - bne 1f 172 - 173 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 174 - ldr r1, =ftrace_graph_return 175 - ldr r2, [r1] 176 - cmp r0, r2 177 - bne ftrace_graph_caller\suffix 178 - 179 - ldr r1, =ftrace_graph_entry 180 - ldr r2, [r1] 181 - ldr r0, =ftrace_graph_entry_stub 182 - cmp r0, r2 183 - bne ftrace_graph_caller\suffix 184 - #endif 185 - 186 - mcount_exit 187 - 188 - 1: mcount_get_lr r1 @ lr of instrumented func 189 - mcount_adjust_addr r0, lr @ instrumented function 190 - adr lr, BSYM(2f) 191 - mov pc, r2 192 - 2: mcount_exit 193 - .endm 194 - 195 - .macro __ftrace_caller suffix 196 - mcount_enter 197 - 198 - mcount_get_lr r1 @ lr of instrumented func 199 - mcount_adjust_addr r0, lr @ instrumented function 200 - 201 - .globl ftrace_call\suffix 202 - ftrace_call\suffix: 203 - bl ftrace_stub 204 - 205 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 206 - .globl ftrace_graph_call\suffix 207 - ftrace_graph_call\suffix: 208 - mov r0, r0 209 - #endif 210 - 211 - mcount_exit 212 - .endm 213 - 214 - .macro __ftrace_graph_caller 215 - sub r0, fp, #4 @ &lr of instrumented routine (&parent) 216 - #ifdef CONFIG_DYNAMIC_FTRACE 217 - @ called from __ftrace_caller, saved in mcount_enter 218 - ldr r1, [sp, #16] @ instrumented routine (func) 219 - mcount_adjust_addr r1, r1 220 - #else 221 - @ called from __mcount, untouched in lr 222 - mcount_adjust_addr r1, lr @ instrumented routine (func) 223 - #endif 224 - mov r2, fp @ frame pointer 225 - bl prepare_ftrace_return 226 - mcount_exit 227 - .endm 228 - 229 - #ifdef CONFIG_OLD_MCOUNT 230 - /* 231 - * mcount 232 - */ 233 - 234 - .macro mcount_enter 235 - stmdb sp!, {r0-r3, lr} 236 - .endm 237 - 238 - .macro mcount_get_lr reg 239 - ldr \reg, [fp, #-4] 240 - .endm 241 - 242 - .macro mcount_exit 243 - ldr lr, [fp, #-4] 244 - ldmia sp!, {r0-r3, pc} 245 - .endm 246 - 247 - ENTRY(mcount) 248 - #ifdef CONFIG_DYNAMIC_FTRACE 249 - stmdb sp!, {lr} 250 - ldr lr, [fp, #-4] 251 - ldmia sp!, {pc} 252 - #else 253 - __mcount _old 254 - #endif 255 - ENDPROC(mcount) 256 - 257 - #ifdef CONFIG_DYNAMIC_FTRACE 258 - ENTRY(ftrace_caller_old) 259 - __ftrace_caller _old 260 - ENDPROC(ftrace_caller_old) 261 - #endif 262 - 263 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 264 - ENTRY(ftrace_graph_caller_old) 265 - __ftrace_graph_caller 266 - ENDPROC(ftrace_graph_caller_old) 267 - #endif 268 - 269 - .purgem mcount_enter 270 - .purgem mcount_get_lr 271 - .purgem mcount_exit 272 - #endif 273 - 274 - /* 275 - * __gnu_mcount_nc 276 - */ 277 - 278 - .macro mcount_enter 279 - /* 280 - * This pad compensates for the push {lr} at the call site. Note that we are 281 - * unable to unwind through a function which does not otherwise save its lr. 282 - */ 283 - UNWIND(.pad #4) 284 - stmdb sp!, {r0-r3, lr} 285 - UNWIND(.save {r0-r3, lr}) 286 - .endm 287 - 288 - .macro mcount_get_lr reg 289 - ldr \reg, [sp, #20] 290 - .endm 291 - 292 - .macro mcount_exit 293 - ldmia sp!, {r0-r3, ip, lr} 294 - ret ip 295 - .endm 296 - 297 - ENTRY(__gnu_mcount_nc) 298 - UNWIND(.fnstart) 299 - #ifdef CONFIG_DYNAMIC_FTRACE 300 - mov ip, lr 301 - ldmia sp!, {lr} 302 - ret ip 303 - #else 304 - __mcount 305 - #endif 306 - UNWIND(.fnend) 307 - ENDPROC(__gnu_mcount_nc) 308 - 309 - #ifdef CONFIG_DYNAMIC_FTRACE 310 - ENTRY(ftrace_caller) 311 - UNWIND(.fnstart) 312 - __ftrace_caller 313 - UNWIND(.fnend) 314 - ENDPROC(ftrace_caller) 315 - #endif 316 - 317 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 318 - ENTRY(ftrace_graph_caller) 319 - UNWIND(.fnstart) 320 - __ftrace_graph_caller 321 - UNWIND(.fnend) 322 - ENDPROC(ftrace_graph_caller) 323 - #endif 324 - 325 - .purgem mcount_enter 326 - .purgem mcount_get_lr 327 - .purgem mcount_exit 328 - 329 - #ifdef CONFIG_FUNCTION_GRAPH_TRACER 330 - .globl return_to_handler 331 - return_to_handler: 332 - stmdb sp!, {r0-r3} 333 - mov r0, fp @ frame pointer 334 - bl ftrace_return_to_handler 335 - mov lr, r0 @ r0 has real ret addr 336 - ldmia sp!, {r0-r3} 337 - ret lr 338 - #endif 339 - 340 - ENTRY(ftrace_stub) 341 - .Lftrace_stub: 342 - ret lr 343 - ENDPROC(ftrace_stub) 344 - 345 - #endif /* CONFIG_FUNCTION_TRACER */ 346 - 347 112 /*============================================================================= 348 113 * SWI handler 349 114 *-----------------------------------------------------------------------------
+243
arch/arm/kernel/entry-ftrace.S
··· 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 <asm/assembler.h> 8 + #include <asm/ftrace.h> 9 + #include <asm/unwind.h> 10 + 11 + #include "entry-header.S" 12 + 13 + /* 14 + * When compiling with -pg, gcc inserts a call to the mcount routine at the 15 + * start of every function. In mcount, apart from the function's address (in 16 + * lr), we need to get hold of the function's caller's address. 17 + * 18 + * Older GCCs (pre-4.4) inserted a call to a routine called mcount like this: 19 + * 20 + * bl mcount 21 + * 22 + * These versions have the limitation that in order for the mcount routine to 23 + * be able to determine the function's caller's address, an APCS-style frame 24 + * pointer (which is set up with something like the code below) is required. 25 + * 26 + * mov ip, sp 27 + * push {fp, ip, lr, pc} 28 + * sub fp, ip, #4 29 + * 30 + * With EABI, these frame pointers are not available unless -mapcs-frame is 31 + * specified, and if building as Thumb-2, not even then. 32 + * 33 + * Newer GCCs (4.4+) solve this problem by introducing a new version of mcount, 34 + * with call sites like: 35 + * 36 + * push {lr} 37 + * bl __gnu_mcount_nc 38 + * 39 + * With these compilers, frame pointers are not necessary. 40 + * 41 + * mcount can be thought of as a function called in the middle of a subroutine 42 + * call. As such, it needs to be transparent for both the caller and the 43 + * callee: the original lr needs to be restored when leaving mcount, and no 44 + * registers should be clobbered. (In the __gnu_mcount_nc implementation, we 45 + * clobber the ip register. This is OK because the ARM calling convention 46 + * allows it to be clobbered in subroutines and doesn't use it to hold 47 + * parameters.) 48 + * 49 + * When using dynamic ftrace, we patch out the mcount call by a "mov r0, r0" 50 + * for the mcount case, and a "pop {lr}" for the __gnu_mcount_nc case (see 51 + * arch/arm/kernel/ftrace.c). 52 + */ 53 + 54 + #ifndef CONFIG_OLD_MCOUNT 55 + #if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) 56 + #error Ftrace requires CONFIG_FRAME_POINTER=y with GCC older than 4.4.0. 57 + #endif 58 + #endif 59 + 60 + .macro mcount_adjust_addr rd, rn 61 + bic \rd, \rn, #1 @ clear the Thumb bit if present 62 + sub \rd, \rd, #MCOUNT_INSN_SIZE 63 + .endm 64 + 65 + .macro __mcount suffix 66 + mcount_enter 67 + ldr r0, =ftrace_trace_function 68 + ldr r2, [r0] 69 + adr r0, .Lftrace_stub 70 + cmp r0, r2 71 + bne 1f 72 + 73 + #ifdef CONFIG_FUNCTION_GRAPH_TRACER 74 + ldr r1, =ftrace_graph_return 75 + ldr r2, [r1] 76 + cmp r0, r2 77 + bne ftrace_graph_caller\suffix 78 + 79 + ldr r1, =ftrace_graph_entry 80 + ldr r2, [r1] 81 + ldr r0, =ftrace_graph_entry_stub 82 + cmp r0, r2 83 + bne ftrace_graph_caller\suffix 84 + #endif 85 + 86 + mcount_exit 87 + 88 + 1: mcount_get_lr r1 @ lr of instrumented func 89 + mcount_adjust_addr r0, lr @ instrumented function 90 + adr lr, BSYM(2f) 91 + mov pc, r2 92 + 2: mcount_exit 93 + .endm 94 + 95 + .macro __ftrace_caller suffix 96 + mcount_enter 97 + 98 + mcount_get_lr r1 @ lr of instrumented func 99 + mcount_adjust_addr r0, lr @ instrumented function 100 + 101 + .globl ftrace_call\suffix 102 + ftrace_call\suffix: 103 + bl ftrace_stub 104 + 105 + #ifdef CONFIG_FUNCTION_GRAPH_TRACER 106 + .globl ftrace_graph_call\suffix 107 + ftrace_graph_call\suffix: 108 + mov r0, r0 109 + #endif 110 + 111 + mcount_exit 112 + .endm 113 + 114 + .macro __ftrace_graph_caller 115 + sub r0, fp, #4 @ &lr of instrumented routine (&parent) 116 + #ifdef CONFIG_DYNAMIC_FTRACE 117 + @ called from __ftrace_caller, saved in mcount_enter 118 + ldr r1, [sp, #16] @ instrumented routine (func) 119 + mcount_adjust_addr r1, r1 120 + #else 121 + @ called from __mcount, untouched in lr 122 + mcount_adjust_addr r1, lr @ instrumented routine (func) 123 + #endif 124 + mov r2, fp @ frame pointer 125 + bl prepare_ftrace_return 126 + mcount_exit 127 + .endm 128 + 129 + #ifdef CONFIG_OLD_MCOUNT 130 + /* 131 + * mcount 132 + */ 133 + 134 + .macro mcount_enter 135 + stmdb sp!, {r0-r3, lr} 136 + .endm 137 + 138 + .macro mcount_get_lr reg 139 + ldr \reg, [fp, #-4] 140 + .endm 141 + 142 + .macro mcount_exit 143 + ldr lr, [fp, #-4] 144 + ldmia sp!, {r0-r3, pc} 145 + .endm 146 + 147 + ENTRY(mcount) 148 + #ifdef CONFIG_DYNAMIC_FTRACE 149 + stmdb sp!, {lr} 150 + ldr lr, [fp, #-4] 151 + ldmia sp!, {pc} 152 + #else 153 + __mcount _old 154 + #endif 155 + ENDPROC(mcount) 156 + 157 + #ifdef CONFIG_DYNAMIC_FTRACE 158 + ENTRY(ftrace_caller_old) 159 + __ftrace_caller _old 160 + ENDPROC(ftrace_caller_old) 161 + #endif 162 + 163 + #ifdef CONFIG_FUNCTION_GRAPH_TRACER 164 + ENTRY(ftrace_graph_caller_old) 165 + __ftrace_graph_caller 166 + ENDPROC(ftrace_graph_caller_old) 167 + #endif 168 + 169 + .purgem mcount_enter 170 + .purgem mcount_get_lr 171 + .purgem mcount_exit 172 + #endif 173 + 174 + /* 175 + * __gnu_mcount_nc 176 + */ 177 + 178 + .macro mcount_enter 179 + /* 180 + * This pad compensates for the push {lr} at the call site. Note that we are 181 + * unable to unwind through a function which does not otherwise save its lr. 182 + */ 183 + UNWIND(.pad #4) 184 + stmdb sp!, {r0-r3, lr} 185 + UNWIND(.save {r0-r3, lr}) 186 + .endm 187 + 188 + .macro mcount_get_lr reg 189 + ldr \reg, [sp, #20] 190 + .endm 191 + 192 + .macro mcount_exit 193 + ldmia sp!, {r0-r3, ip, lr} 194 + ret ip 195 + .endm 196 + 197 + ENTRY(__gnu_mcount_nc) 198 + UNWIND(.fnstart) 199 + #ifdef CONFIG_DYNAMIC_FTRACE 200 + mov ip, lr 201 + ldmia sp!, {lr} 202 + ret ip 203 + #else 204 + __mcount 205 + #endif 206 + UNWIND(.fnend) 207 + ENDPROC(__gnu_mcount_nc) 208 + 209 + #ifdef CONFIG_DYNAMIC_FTRACE 210 + ENTRY(ftrace_caller) 211 + UNWIND(.fnstart) 212 + __ftrace_caller 213 + UNWIND(.fnend) 214 + ENDPROC(ftrace_caller) 215 + #endif 216 + 217 + #ifdef CONFIG_FUNCTION_GRAPH_TRACER 218 + ENTRY(ftrace_graph_caller) 219 + UNWIND(.fnstart) 220 + __ftrace_graph_caller 221 + UNWIND(.fnend) 222 + ENDPROC(ftrace_graph_caller) 223 + #endif 224 + 225 + .purgem mcount_enter 226 + .purgem mcount_get_lr 227 + .purgem mcount_exit 228 + 229 + #ifdef CONFIG_FUNCTION_GRAPH_TRACER 230 + .globl return_to_handler 231 + return_to_handler: 232 + stmdb sp!, {r0-r3} 233 + mov r0, fp @ frame pointer 234 + bl ftrace_return_to_handler 235 + mov lr, r0 @ r0 has real ret addr 236 + ldmia sp!, {r0-r3} 237 + ret lr 238 + #endif 239 + 240 + ENTRY(ftrace_stub) 241 + .Lftrace_stub: 242 + ret lr 243 + ENDPROC(ftrace_stub)
+6 -6
arch/arm/kernel/etm.c
··· 213 213 int length; 214 214 215 215 if (!t->etb_regs) { 216 - printk(KERN_INFO "No tracing hardware found\n"); 216 + pr_info("No tracing hardware found\n"); 217 217 return; 218 218 } 219 219 ··· 229 229 230 230 etb_writel(t, first, ETBR_READADDR); 231 231 232 - printk(KERN_INFO "Trace buffer contents length: %d\n", length); 233 - printk(KERN_INFO "--- ETB buffer begin ---\n"); 232 + pr_info("Trace buffer contents length: %d\n", length); 233 + pr_info("--- ETB buffer begin ---\n"); 234 234 for (; length; length--) 235 235 printk("%08x", cpu_to_be32(etb_readl(t, ETBR_READMEM))); 236 - printk(KERN_INFO "\n--- ETB buffer end ---\n"); 236 + pr_info("\n--- ETB buffer end ---\n"); 237 237 238 238 /* deassert the overflow bit */ 239 239 etb_writel(t, 1, ETBR_CTRL); ··· 633 633 634 634 retval = amba_driver_register(&etb_driver); 635 635 if (retval) { 636 - printk(KERN_ERR "Failed to register etb\n"); 636 + pr_err("Failed to register etb\n"); 637 637 return retval; 638 638 } 639 639 640 640 retval = amba_driver_register(&etm_driver); 641 641 if (retval) { 642 642 amba_driver_unregister(&etb_driver); 643 - printk(KERN_ERR "Failed to probe etm\n"); 643 + pr_err("Failed to probe etm\n"); 644 644 return retval; 645 645 } 646 646
+1 -1
arch/arm/kernel/fiq.c
··· 124 124 void release_fiq(struct fiq_handler *f) 125 125 { 126 126 if (current_fiq != f) { 127 - printk(KERN_ERR "%s FIQ trying to release %s FIQ\n", 127 + pr_err("%s FIQ trying to release %s FIQ\n", 128 128 f->name, current_fiq->name); 129 129 dump_stack(); 130 130 return;
+2 -3
arch/arm/kernel/io.c
··· 51 51 from++; 52 52 } 53 53 } 54 + EXPORT_SYMBOL(_memcpy_fromio); 54 55 55 56 /* 56 57 * Copy data from "real" memory space to IO memory space. ··· 67 66 to++; 68 67 } 69 68 } 69 + EXPORT_SYMBOL(_memcpy_toio); 70 70 71 71 /* 72 72 * "memset" on IO memory space. ··· 81 79 dst++; 82 80 } 83 81 } 84 - 85 - EXPORT_SYMBOL(_memcpy_fromio); 86 - EXPORT_SYMBOL(_memcpy_toio); 87 82 EXPORT_SYMBOL(_memset_io);
+4 -4
arch/arm/kernel/irq.c
··· 31 31 #include <linux/smp.h> 32 32 #include <linux/init.h> 33 33 #include <linux/seq_file.h> 34 + #include <linux/ratelimit.h> 34 35 #include <linux/errno.h> 35 36 #include <linux/list.h> 36 37 #include <linux/kallsyms.h> ··· 83 82 unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; 84 83 85 84 if (irq >= nr_irqs) { 86 - printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq); 85 + pr_err("Trying to set irq flags for IRQ%d\n", irq); 87 86 return; 88 87 } 89 88 ··· 136 135 #endif 137 136 138 137 #ifdef CONFIG_HOTPLUG_CPU 139 - 140 138 static bool migrate_one_irq(struct irq_desc *desc) 141 139 { 142 140 struct irq_data *d = irq_desc_get_irq_data(desc); ··· 187 187 affinity_broken = migrate_one_irq(desc); 188 188 raw_spin_unlock(&desc->lock); 189 189 190 - if (affinity_broken && printk_ratelimit()) 191 - pr_warn("IRQ%u no longer affine to CPU%u\n", 190 + if (affinity_broken) 191 + pr_warn_ratelimited("IRQ%u no longer affine to CPU%u\n", 192 192 i, smp_processor_id()); 193 193 } 194 194
+13
arch/arm/kernel/iwmmxt.S
··· 58 58 #define MMX_SIZE (0x98) 59 59 60 60 .text 61 + .arm 61 62 62 63 /* 63 64 * Lazy switching of Concan coprocessor context ··· 183 182 tmcr wCon, r2 184 183 ret lr 185 184 185 + ENDPROC(iwmmxt_task_enable) 186 + 186 187 /* 187 188 * Back up Concan regs to save area and disable access to them 188 189 * (mainly for gdb or sleep mode usage) ··· 235 232 1: msr cpsr_c, ip @ restore interrupt mode 236 233 ldmfd sp!, {r4, pc} 237 234 235 + ENDPROC(iwmmxt_task_disable) 236 + 238 237 /* 239 238 * Copy Concan state to given memory address 240 239 * ··· 272 267 bl concan_dump 273 268 msr cpsr_c, ip @ restore interrupt mode 274 269 ret r3 270 + 271 + ENDPROC(iwmmxt_task_copy) 275 272 276 273 /* 277 274 * Restore Concan state from given memory address ··· 311 304 msr cpsr_c, ip @ restore interrupt mode 312 305 ret r3 313 306 307 + ENDPROC(iwmmxt_task_restore) 308 + 314 309 /* 315 310 * Concan handling on task switch 316 311 * ··· 344 335 mrc p15, 0, r1, c2, c0, 0 345 336 sub pc, lr, r1, lsr #32 @ cpwait and return 346 337 338 + ENDPROC(iwmmxt_task_switch) 339 + 347 340 /* 348 341 * Remove Concan ownership of given task 349 342 * ··· 363 352 streq r0, [r3] @ then clear ownership 364 353 msr cpsr_c, r2 @ restore interrupts 365 354 ret lr 355 + 356 + ENDPROC(iwmmxt_task_release) 366 357 367 358 .data 368 359 concan_owner:
+3 -3
arch/arm/kernel/machine_kexec.c
··· 126 126 msecs--; 127 127 } 128 128 if (atomic_read(&waiting_for_crash_ipi) > 0) 129 - printk(KERN_WARNING "Non-crashing CPUs did not react to IPI\n"); 129 + pr_warn("Non-crashing CPUs did not react to IPI\n"); 130 130 131 131 crash_save_cpu(regs, smp_processor_id()); 132 132 machine_kexec_mask_interrupts(); 133 133 134 - printk(KERN_INFO "Loading crashdump kernel...\n"); 134 + pr_info("Loading crashdump kernel...\n"); 135 135 } 136 136 137 137 /* ··· 177 177 reboot_entry_phys = (unsigned long)reboot_entry + 178 178 (reboot_code_buffer_phys - (unsigned long)reboot_code_buffer); 179 179 180 - printk(KERN_INFO "Bye!\n"); 180 + pr_info("Bye!\n"); 181 181 182 182 if (kexec_reinit) 183 183 kexec_reinit();
+1 -1
arch/arm/kernel/module.c
··· 251 251 #endif 252 252 253 253 default: 254 - printk(KERN_ERR "%s: unknown relocation: %u\n", 254 + pr_err("%s: unknown relocation: %u\n", 255 255 module->name, ELF32_R_TYPE(rel->r_info)); 256 256 return -ENOEXEC; 257 257 }
+2 -2
arch/arm/kernel/process.c
··· 51 51 static const char *processor_modes[] __maybe_unused = { 52 52 "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" , 53 53 "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26", 54 - "USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" , 55 - "UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32" 54 + "USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "MON_32" , "ABT_32" , 55 + "UK8_32" , "UK9_32" , "HYP_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32" 56 56 }; 57 57 58 58 static const char *isa_modes[] __maybe_unused = {
+1 -2
arch/arm/kernel/return_address.c
··· 39 39 { 40 40 struct return_address_data data; 41 41 struct stackframe frame; 42 - register unsigned long current_sp asm ("sp"); 43 42 44 43 data.level = level + 2; 45 44 data.addr = NULL; 46 45 47 46 frame.fp = (unsigned long)__builtin_frame_address(0); 48 - frame.sp = current_sp; 47 + frame.sp = current_stack_pointer; 49 48 frame.lr = (unsigned long)__builtin_return_address(0); 50 49 frame.pc = (unsigned long)return_address; 51 50
+1
arch/arm/kernel/setup.c
··· 900 900 mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type); 901 901 machine_desc = mdesc; 902 902 machine_name = mdesc->name; 903 + dump_stack_set_arch_desc("%s", mdesc->name); 903 904 904 905 if (mdesc->reboot_mode != REBOOT_HARD) 905 906 reboot_mode = mdesc->reboot_mode;
-1
arch/arm/kernel/signal.c
··· 592 592 } 593 593 syscall = 0; 594 594 } else if (thread_flags & _TIF_UPROBE) { 595 - clear_thread_flag(TIF_UPROBE); 596 595 uprobe_notify_resume(regs); 597 596 } else { 598 597 clear_thread_flag(TIF_NOTIFY_RESUME);
+6 -9
arch/arm/kernel/smp.c
··· 225 225 pr_err("CPU%u: cpu didn't die\n", cpu); 226 226 return; 227 227 } 228 - printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); 228 + pr_notice("CPU%u: shutdown\n", cpu); 229 229 230 230 /* 231 231 * platform_cpu_kill() is generally expected to do the powering off ··· 235 235 * the requesting CPU and the dying CPU actually losing power. 236 236 */ 237 237 if (!platform_cpu_kill(cpu)) 238 - printk("CPU%u: unable to kill\n", cpu); 238 + pr_err("CPU%u: unable to kill\n", cpu); 239 239 } 240 240 241 241 /* ··· 351 351 352 352 cpu_init(); 353 353 354 - printk("CPU%u: Booted secondary processor\n", cpu); 354 + pr_debug("CPU%u: Booted secondary processor\n", cpu); 355 355 356 356 preempt_disable(); 357 357 trace_hardirqs_off(); ··· 387 387 388 388 void __init smp_cpus_done(unsigned int max_cpus) 389 389 { 390 - printk(KERN_INFO "SMP: Total of %d processors activated.\n", 391 - num_online_cpus()); 392 - 393 390 hyp_mode_check(); 394 391 } 395 392 ··· 518 521 if (system_state == SYSTEM_BOOTING || 519 522 system_state == SYSTEM_RUNNING) { 520 523 raw_spin_lock(&stop_lock); 521 - printk(KERN_CRIT "CPU%u: stopping\n", cpu); 524 + pr_crit("CPU%u: stopping\n", cpu); 522 525 dump_stack(); 523 526 raw_spin_unlock(&stop_lock); 524 527 } ··· 612 615 break; 613 616 614 617 default: 615 - printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n", 616 - cpu, ipinr); 618 + pr_crit("CPU%u: Unknown IPI message 0x%x\n", 619 + cpu, ipinr); 617 620 break; 618 621 } 619 622
+2 -2
arch/arm/kernel/smp_twd.c
··· 199 199 * the timer ticks 200 200 */ 201 201 if (twd_timer_rate == 0) { 202 - printk(KERN_INFO "Calibrating local timer... "); 202 + pr_info("Calibrating local timer... "); 203 203 204 204 /* Wait for a tick to start */ 205 205 waitjiffies = get_jiffies_64() + 1; ··· 223 223 224 224 twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5); 225 225 226 - printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000, 226 + pr_cont("%lu.%02luMHz.\n", twd_timer_rate / 1000000, 227 227 (twd_timer_rate / 10000) % 100); 228 228 } 229 229 }
+1 -3
arch/arm/kernel/stacktrace.c
··· 134 134 frame.pc = thread_saved_pc(tsk); 135 135 #endif 136 136 } else { 137 - register unsigned long current_sp asm ("sp"); 138 - 139 137 /* We don't want this function nor the caller */ 140 138 data.skip += 2; 141 139 frame.fp = (unsigned long)__builtin_frame_address(0); 142 - frame.sp = current_sp; 140 + frame.sp = current_stack_pointer; 143 141 frame.lr = (unsigned long)__builtin_return_address(0); 144 142 frame.pc = (unsigned long)__save_stack_trace; 145 143 }
+1 -1
arch/arm/kernel/swp_emulate.c
··· 260 260 return -ENOMEM; 261 261 #endif /* CONFIG_PROC_FS */ 262 262 263 - printk(KERN_NOTICE "Registering SWP/SWPB emulation handler\n"); 263 + pr_notice("Registering SWP/SWPB emulation handler\n"); 264 264 register_undef_hook(&swp_hook); 265 265 266 266 return 0;
+1 -1
arch/arm/kernel/thumbee.c
··· 72 72 if ((pfr0 & 0x0000f000) != 0x00001000) 73 73 return 0; 74 74 75 - printk(KERN_INFO "ThumbEE CPU extension supported.\n"); 75 + pr_info("ThumbEE CPU extension supported.\n"); 76 76 elf_hwcap |= HWCAP_THUMBEE; 77 77 thread_register_notifier(&thumbee_notifier_block); 78 78
+2 -2
arch/arm/kernel/topology.c
··· 165 165 166 166 set_capacity_scale(cpu, cpu_capacity(cpu) / middle_capacity); 167 167 168 - printk(KERN_INFO "CPU%u: update cpu_capacity %lu\n", 168 + pr_info("CPU%u: update cpu_capacity %lu\n", 169 169 cpu, arch_scale_cpu_capacity(NULL, cpu)); 170 170 } 171 171 ··· 269 269 270 270 update_cpu_capacity(cpuid); 271 271 272 - printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n", 272 + pr_info("CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n", 273 273 cpuid, cpu_topology[cpuid].thread_id, 274 274 cpu_topology[cpuid].core_id, 275 275 cpu_topology[cpuid].socket_id, mpidr);
+21 -21
arch/arm/kernel/traps.c
··· 198 198 } 199 199 200 200 if (!fp) { 201 - printk("no frame pointer"); 201 + pr_cont("no frame pointer"); 202 202 ok = 0; 203 203 } else if (verify_stack(fp)) { 204 - printk("invalid frame pointer 0x%08x", fp); 204 + pr_cont("invalid frame pointer 0x%08x", fp); 205 205 ok = 0; 206 206 } else if (fp < (unsigned long)end_of_stack(tsk)) 207 - printk("frame pointer underflow"); 208 - printk("\n"); 207 + pr_cont("frame pointer underflow"); 208 + pr_cont("\n"); 209 209 210 210 if (ok) 211 211 c_backtrace(fp, mode); ··· 240 240 static int die_counter; 241 241 int ret; 242 242 243 - printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP 244 - S_ISA "\n", str, err, ++die_counter); 243 + pr_emerg("Internal error: %s: %x [#%d]" S_PREEMPT S_SMP S_ISA "\n", 244 + str, err, ++die_counter); 245 245 246 246 /* trap and error numbers are mostly meaningless on ARM */ 247 247 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV); ··· 250 250 251 251 print_modules(); 252 252 __show_regs(regs); 253 - printk(KERN_EMERG "Process %.*s (pid: %d, stack limit = 0x%p)\n", 254 - TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), end_of_stack(tsk)); 253 + pr_emerg("Process %.*s (pid: %d, stack limit = 0x%p)\n", 254 + TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), end_of_stack(tsk)); 255 255 256 256 if (!user_mode(regs) || in_interrupt()) { 257 257 dump_mem(KERN_EMERG, "Stack: ", regs->ARM_sp, ··· 446 446 die_sig: 447 447 #ifdef CONFIG_DEBUG_USER 448 448 if (user_debug & UDBG_UNDEFINED) { 449 - printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n", 449 + pr_info("%s (%d): undefined instruction: pc=%p\n", 450 450 current->comm, task_pid_nr(current), pc); 451 451 __show_regs(regs); 452 452 dump_instr(KERN_INFO, regs); ··· 496 496 { 497 497 console_verbose(); 498 498 499 - printk(KERN_CRIT "Bad mode in %s handler detected\n", handler[reason]); 499 + pr_crit("Bad mode in %s handler detected\n", handler[reason]); 500 500 501 501 die("Oops - bad mode", regs, 0); 502 502 local_irq_disable(); ··· 516 516 517 517 #ifdef CONFIG_DEBUG_USER 518 518 if (user_debug & UDBG_SYSCALL) { 519 - printk(KERN_ERR "[%d] %s: obsolete system call %08x.\n", 519 + pr_err("[%d] %s: obsolete system call %08x.\n", 520 520 task_pid_nr(current), current->comm, n); 521 521 dump_instr(KERN_ERR, regs); 522 522 } ··· 694 694 * something catastrophic has happened 695 695 */ 696 696 if (user_debug & UDBG_SYSCALL) { 697 - printk("[%d] %s: arm syscall %d\n", 697 + pr_err("[%d] %s: arm syscall %d\n", 698 698 task_pid_nr(current), current->comm, no); 699 699 dump_instr("", regs); 700 700 if (user_mode(regs)) { ··· 753 753 754 754 void __bad_xchg(volatile void *ptr, int size) 755 755 { 756 - printk("xchg: bad data size: pc 0x%p, ptr 0x%p, size %d\n", 757 - __builtin_return_address(0), ptr, size); 756 + pr_err("xchg: bad data size: pc 0x%p, ptr 0x%p, size %d\n", 757 + __builtin_return_address(0), ptr, size); 758 758 BUG(); 759 759 } 760 760 EXPORT_SYMBOL(__bad_xchg); ··· 771 771 772 772 #ifdef CONFIG_DEBUG_USER 773 773 if (user_debug & UDBG_BADABORT) { 774 - printk(KERN_ERR "[%d] %s: bad data abort: code %d instr 0x%08lx\n", 775 - task_pid_nr(current), current->comm, code, instr); 774 + pr_err("[%d] %s: bad data abort: code %d instr 0x%08lx\n", 775 + task_pid_nr(current), current->comm, code, instr); 776 776 dump_instr(KERN_ERR, regs); 777 777 show_pte(current->mm, addr); 778 778 } ··· 788 788 789 789 void __readwrite_bug(const char *fn) 790 790 { 791 - printk("%s called, but not implemented\n", fn); 791 + pr_err("%s called, but not implemented\n", fn); 792 792 BUG(); 793 793 } 794 794 EXPORT_SYMBOL(__readwrite_bug); 795 795 796 796 void __pte_error(const char *file, int line, pte_t pte) 797 797 { 798 - printk("%s:%d: bad pte %08llx.\n", file, line, (long long)pte_val(pte)); 798 + pr_err("%s:%d: bad pte %08llx.\n", file, line, (long long)pte_val(pte)); 799 799 } 800 800 801 801 void __pmd_error(const char *file, int line, pmd_t pmd) 802 802 { 803 - printk("%s:%d: bad pmd %08llx.\n", file, line, (long long)pmd_val(pmd)); 803 + pr_err("%s:%d: bad pmd %08llx.\n", file, line, (long long)pmd_val(pmd)); 804 804 } 805 805 806 806 void __pgd_error(const char *file, int line, pgd_t pgd) 807 807 { 808 - printk("%s:%d: bad pgd %08llx.\n", file, line, (long long)pgd_val(pgd)); 808 + pr_err("%s:%d: bad pgd %08llx.\n", file, line, (long long)pgd_val(pgd)); 809 809 } 810 810 811 811 asmlinkage void __div0(void) 812 812 { 813 - printk("Division by zero in kernel.\n"); 813 + pr_err("Division by zero in kernel.\n"); 814 814 dump_stack(); 815 815 } 816 816 EXPORT_SYMBOL(__div0);
+1 -2
arch/arm/kernel/unwind.c
··· 471 471 void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk) 472 472 { 473 473 struct stackframe frame; 474 - register unsigned long current_sp asm ("sp"); 475 474 476 475 pr_debug("%s(regs = %p tsk = %p)\n", __func__, regs, tsk); 477 476 ··· 484 485 frame.pc = regs->ARM_lr; 485 486 } else if (tsk == current) { 486 487 frame.fp = (unsigned long)__builtin_frame_address(0); 487 - frame.sp = current_sp; 488 + frame.sp = current_stack_pointer; 488 489 frame.lr = (unsigned long)__builtin_return_address(0); 489 490 frame.pc = (unsigned long)unwind_backtrace; 490 491 } else {
+3 -4
arch/arm/kernel/xscale-cp0.c
··· 157 157 158 158 if (cpu_has_iwmmxt()) { 159 159 #ifndef CONFIG_IWMMXT 160 - printk(KERN_WARNING "CAUTION: XScale iWMMXt coprocessor " 161 - "detected, but kernel support is missing.\n"); 160 + pr_warn("CAUTION: XScale iWMMXt coprocessor detected, but kernel support is missing.\n"); 162 161 #else 163 - printk(KERN_INFO "XScale iWMMXt coprocessor detected.\n"); 162 + pr_info("XScale iWMMXt coprocessor detected.\n"); 164 163 elf_hwcap |= HWCAP_IWMMXT; 165 164 thread_register_notifier(&iwmmxt_notifier_block); 166 165 #endif 167 166 } else { 168 - printk(KERN_INFO "XScale DSP coprocessor detected.\n"); 167 + pr_info("XScale DSP coprocessor detected.\n"); 169 168 thread_register_notifier(&dsp_notifier_block); 170 169 cp_access |= 1; 171 170 }
+5
arch/arm/lib/copy_from_user.S
··· 12 12 13 13 #include <linux/linkage.h> 14 14 #include <asm/assembler.h> 15 + #include <asm/unwind.h> 15 16 16 17 /* 17 18 * Prototype: ··· 76 75 .macro enter reg1 reg2 77 76 mov r3, #0 78 77 stmdb sp!, {r0, r2, r3, \reg1, \reg2} 78 + .endm 79 + 80 + .macro usave reg1 reg2 81 + UNWIND( .save {r0, r2, r3, \reg1, \reg2} ) 79 82 .endm 80 83 81 84 .macro exit reg1 reg2
+30
arch/arm/lib/copy_template.S
··· 53 53 * data as needed by the implementation including this code. Called 54 54 * upon code entry. 55 55 * 56 + * usave reg1 reg2 57 + * 58 + * Unwind annotation macro is corresponding for 'enter' macro. 59 + * It tell unwinder that preserved some provided registers on the stack 60 + * and additional data by a prior 'enter' macro. 61 + * 56 62 * exit reg1 reg2 57 63 * 58 64 * Restore registers with the values previously saved with the ··· 73 67 */ 74 68 75 69 70 + UNWIND( .fnstart ) 76 71 enter r4, lr 72 + UNWIND( .fnend ) 73 + 74 + UNWIND( .fnstart ) 75 + usave r4, lr @ in first stmdb block 77 76 78 77 subs r2, r2, #4 79 78 blt 8f ··· 90 79 91 80 1: subs r2, r2, #(28) 92 81 stmfd sp!, {r5 - r8} 82 + UNWIND( .fnend ) 83 + 84 + UNWIND( .fnstart ) 85 + usave r4, lr 86 + UNWIND( .save {r5 - r8} ) @ in second stmfd block 93 87 blt 5f 94 88 95 89 CALGN( ands ip, r0, #31 ) ··· 160 144 CALGN( bcs 2b ) 161 145 162 146 7: ldmfd sp!, {r5 - r8} 147 + UNWIND( .fnend ) @ end of second stmfd block 163 148 149 + UNWIND( .fnstart ) 150 + usave r4, lr @ still in first stmdb block 164 151 8: movs r2, r2, lsl #31 165 152 ldr1b r1, r3, ne, abort=21f 166 153 ldr1b r1, r4, cs, abort=21f ··· 192 173 ldr1w r1, lr, abort=21f 193 174 beq 17f 194 175 bgt 18f 176 + UNWIND( .fnend ) 195 177 196 178 197 179 .macro forward_copy_shift pull push 198 180 181 + UNWIND( .fnstart ) 182 + usave r4, lr @ still in first stmdb block 199 183 subs r2, r2, #28 200 184 blt 14f 201 185 ··· 209 187 CALGN( bcc 15f ) 210 188 211 189 11: stmfd sp!, {r5 - r9} 190 + UNWIND( .fnend ) 212 191 192 + UNWIND( .fnstart ) 193 + usave r4, lr 194 + UNWIND( .save {r5 - r9} ) @ in new second stmfd block 213 195 PLD( pld [r1, #0] ) 214 196 PLD( subs r2, r2, #96 ) 215 197 PLD( pld [r1, #28] ) ··· 247 221 PLD( bge 13b ) 248 222 249 223 ldmfd sp!, {r5 - r9} 224 + UNWIND( .fnend ) @ end of the second stmfd block 250 225 226 + UNWIND( .fnstart ) 227 + usave r4, lr @ still in first stmdb block 251 228 14: ands ip, r2, #28 252 229 beq 16f 253 230 ··· 265 236 266 237 16: sub r1, r1, #(\push / 8) 267 238 b 8b 239 + UNWIND( .fnend ) 268 240 269 241 .endm 270 242
+5
arch/arm/lib/copy_to_user.S
··· 12 12 13 13 #include <linux/linkage.h> 14 14 #include <asm/assembler.h> 15 + #include <asm/unwind.h> 15 16 16 17 /* 17 18 * Prototype: ··· 79 78 .macro enter reg1 reg2 80 79 mov r3, #0 81 80 stmdb sp!, {r0, r2, r3, \reg1, \reg2} 81 + .endm 82 + 83 + .macro usave reg1 reg2 84 + UNWIND( .save {r0, r2, r3, \reg1, \reg2} ) 82 85 .endm 83 86 84 87 .macro exit reg1 reg2
+5
arch/arm/lib/memcpy.S
··· 12 12 13 13 #include <linux/linkage.h> 14 14 #include <asm/assembler.h> 15 + #include <asm/unwind.h> 15 16 16 17 #define LDR1W_SHIFT 0 17 18 #define STR1W_SHIFT 0 ··· 47 46 48 47 .macro enter reg1 reg2 49 48 stmdb sp!, {r0, \reg1, \reg2} 49 + .endm 50 + 51 + .macro usave reg1 reg2 52 + UNWIND( .save {r0, \reg1, \reg2} ) 50 53 .endm 51 54 52 55 .macro exit reg1 reg2
+28
arch/arm/lib/memmove.S
··· 12 12 13 13 #include <linux/linkage.h> 14 14 #include <asm/assembler.h> 15 + #include <asm/unwind.h> 15 16 16 17 .text 17 18 ··· 28 27 */ 29 28 30 29 ENTRY(memmove) 30 + UNWIND( .fnstart ) 31 31 32 32 subs ip, r0, r1 33 33 cmphi r2, ip 34 34 bls memcpy 35 35 36 36 stmfd sp!, {r0, r4, lr} 37 + UNWIND( .fnend ) 38 + 39 + UNWIND( .fnstart ) 40 + UNWIND( .save {r0, r4, lr} ) @ in first stmfd block 37 41 add r1, r1, r2 38 42 add r0, r0, r2 39 43 subs r2, r2, #4 ··· 51 45 52 46 1: subs r2, r2, #(28) 53 47 stmfd sp!, {r5 - r8} 48 + UNWIND( .fnend ) 49 + 50 + UNWIND( .fnstart ) 51 + UNWIND( .save {r0, r4, lr} ) 52 + UNWIND( .save {r5 - r8} ) @ in second stmfd block 54 53 blt 5f 55 54 56 55 CALGN( ands ip, r0, #31 ) ··· 108 97 CALGN( bcs 2b ) 109 98 110 99 7: ldmfd sp!, {r5 - r8} 100 + UNWIND( .fnend ) @ end of second stmfd block 101 + 102 + UNWIND( .fnstart ) 103 + UNWIND( .save {r0, r4, lr} ) @ still in first stmfd block 111 104 112 105 8: movs r2, r2, lsl #31 113 106 ldrneb r3, [r1, #-1]! ··· 139 124 ldr r3, [r1, #0] 140 125 beq 17f 141 126 blt 18f 127 + UNWIND( .fnend ) 142 128 143 129 144 130 .macro backward_copy_shift push pull 145 131 132 + UNWIND( .fnstart ) 133 + UNWIND( .save {r0, r4, lr} ) @ still in first stmfd block 146 134 subs r2, r2, #28 147 135 blt 14f 148 136 ··· 155 137 CALGN( bcc 15f ) 156 138 157 139 11: stmfd sp!, {r5 - r9} 140 + UNWIND( .fnend ) 141 + 142 + UNWIND( .fnstart ) 143 + UNWIND( .save {r0, r4, lr} ) 144 + UNWIND( .save {r5 - r9} ) @ in new second stmfd block 158 145 159 146 PLD( pld [r1, #-4] ) 160 147 PLD( subs r2, r2, #96 ) ··· 194 171 PLD( bge 13b ) 195 172 196 173 ldmfd sp!, {r5 - r9} 174 + UNWIND( .fnend ) @ end of the second stmfd block 175 + 176 + UNWIND( .fnstart ) 177 + UNWIND( .save {r0, r4, lr} ) @ still in first stmfd block 197 178 198 179 14: ands ip, r2, #28 199 180 beq 16f ··· 213 186 214 187 16: add r1, r1, #(\pull / 8) 215 188 b 8b 189 + UNWIND( .fnend ) 216 190 217 191 .endm 218 192
+12
arch/arm/lib/memset.S
··· 11 11 */ 12 12 #include <linux/linkage.h> 13 13 #include <asm/assembler.h> 14 + #include <asm/unwind.h> 14 15 15 16 .text 16 17 .align 5 17 18 18 19 ENTRY(memset) 20 + UNWIND( .fnstart ) 19 21 ands r3, r0, #3 @ 1 unaligned? 20 22 mov ip, r0 @ preserve r0 as return value 21 23 bne 6f @ 1 ··· 36 34 * We need 2 extra registers for this loop - use r8 and the LR 37 35 */ 38 36 stmfd sp!, {r8, lr} 37 + UNWIND( .fnend ) 38 + UNWIND( .fnstart ) 39 + UNWIND( .save {r8, lr} ) 39 40 mov r8, r1 40 41 mov lr, r1 41 42 ··· 58 53 tst r2, #16 59 54 stmneia ip!, {r1, r3, r8, lr} 60 55 ldmfd sp!, {r8, lr} 56 + UNWIND( .fnend ) 61 57 62 58 #else 63 59 ··· 68 62 */ 69 63 70 64 stmfd sp!, {r4-r8, lr} 65 + UNWIND( .fnend ) 66 + UNWIND( .fnstart ) 67 + UNWIND( .save {r4-r8, lr} ) 71 68 mov r4, r1 72 69 mov r5, r1 73 70 mov r6, r1 ··· 103 94 tst r2, #16 104 95 stmneia ip!, {r4-r7} 105 96 ldmfd sp!, {r4-r8, lr} 97 + UNWIND( .fnend ) 106 98 107 99 #endif 108 100 101 + UNWIND( .fnstart ) 109 102 4: tst r2, #8 110 103 stmneia ip!, {r1, r3} 111 104 tst r2, #4 ··· 131 120 strb r1, [ip], #1 @ 1 132 121 add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) 133 122 b 1b 123 + UNWIND( .fnend ) 134 124 ENDPROC(memset)
+12
arch/arm/lib/memzero.S
··· 9 9 */ 10 10 #include <linux/linkage.h> 11 11 #include <asm/assembler.h> 12 + #include <asm/unwind.h> 12 13 13 14 .text 14 15 .align 5 ··· 19 18 * mis-aligned by, and r1 is the number of bytes. If r1 < 4, then we 20 19 * don't bother; we use byte stores instead. 21 20 */ 21 + UNWIND( .fnstart ) 22 22 1: subs r1, r1, #4 @ 1 do we have enough 23 23 blt 5f @ 1 bytes to align with? 24 24 cmp r3, #2 @ 1 ··· 49 47 * use the LR 50 48 */ 51 49 str lr, [sp, #-4]! @ 1 50 + UNWIND( .fnend ) 51 + UNWIND( .fnstart ) 52 + UNWIND( .save {lr} ) 52 53 mov ip, r2 @ 1 53 54 mov lr, r2 @ 1 54 55 ··· 71 66 tst r1, #16 @ 1 16 bytes or more? 72 67 stmneia r0!, {r2, r3, ip, lr} @ 4 73 68 ldr lr, [sp], #4 @ 1 69 + UNWIND( .fnend ) 74 70 75 71 #else 76 72 ··· 81 75 */ 82 76 83 77 stmfd sp!, {r4-r7, lr} 78 + UNWIND( .fnend ) 79 + UNWIND( .fnstart ) 80 + UNWIND( .save {r4-r7, lr} ) 84 81 mov r4, r2 85 82 mov r5, r2 86 83 mov r6, r2 ··· 114 105 tst r1, #16 115 106 stmneia r0!, {r4-r7} 116 107 ldmfd sp!, {r4-r7, lr} 108 + UNWIND( .fnend ) 117 109 118 110 #endif 119 111 112 + UNWIND( .fnstart ) 120 113 4: tst r1, #8 @ 1 8 bytes or more? 121 114 stmneia r0!, {r2, r3} @ 2 122 115 tst r1, #4 @ 1 4 bytes or more? ··· 133 122 tst r1, #1 @ 1 a byte left over 134 123 strneb r2, [r0], #1 @ 1 135 124 ret lr @ 1 125 + UNWIND( .fnend ) 136 126 ENDPROC(__memzero)
+36 -7
arch/arm/mach-sa1100/clock.c
··· 15 15 #include <linux/clkdev.h> 16 16 17 17 #include <mach/hardware.h> 18 + #include <mach/generic.h> 18 19 19 20 struct clkops { 20 21 void (*enable)(struct clk *); 21 22 void (*disable)(struct clk *); 23 + unsigned long (*get_rate)(struct clk *); 22 24 }; 23 25 24 26 struct clk { ··· 34 32 } 35 33 36 34 static DEFINE_SPINLOCK(clocks_lock); 37 - 38 - /* Dummy clk routine to build generic kernel parts that may be using them */ 39 - unsigned long clk_get_rate(struct clk *clk) 40 - { 41 - return 0; 42 - } 43 - EXPORT_SYMBOL(clk_get_rate); 44 35 45 36 static void clk_gpio27_enable(struct clk *clk) 46 37 { ··· 51 56 TUCR = 0; 52 57 GPDR &= ~GPIO_32_768kHz; 53 58 GAFR &= ~GPIO_32_768kHz; 59 + } 60 + 61 + static void clk_cpu_enable(struct clk *clk) 62 + { 63 + } 64 + 65 + static void clk_cpu_disable(struct clk *clk) 66 + { 67 + } 68 + 69 + static unsigned long clk_cpu_get_rate(struct clk *clk) 70 + { 71 + return sa11x0_getspeed(0) * 1000; 54 72 } 55 73 56 74 int clk_enable(struct clk *clk) ··· 95 87 } 96 88 EXPORT_SYMBOL(clk_disable); 97 89 90 + unsigned long clk_get_rate(struct clk *clk) 91 + { 92 + if (clk && clk->ops && clk->ops->get_rate) 93 + return clk->ops->get_rate(clk); 94 + 95 + return 0; 96 + } 97 + EXPORT_SYMBOL(clk_get_rate); 98 + 98 99 const struct clkops clk_gpio27_ops = { 99 100 .enable = clk_gpio27_enable, 100 101 .disable = clk_gpio27_disable, 101 102 }; 102 103 104 + const struct clkops clk_cpu_ops = { 105 + .enable = clk_cpu_enable, 106 + .disable = clk_cpu_disable, 107 + .get_rate = clk_cpu_get_rate, 108 + }; 109 + 103 110 static DEFINE_CLK(gpio27, &clk_gpio27_ops); 111 + 112 + static DEFINE_CLK(cpu, &clk_cpu_ops); 104 113 105 114 static struct clk_lookup sa11xx_clkregs[] = { 106 115 CLKDEV_INIT("sa1111.0", NULL, &clk_gpio27), 107 116 CLKDEV_INIT("sa1100-rtc", NULL, NULL), 117 + CLKDEV_INIT("sa11x0-fb", NULL, &clk_cpu), 118 + CLKDEV_INIT("sa11x0-pcmcia", NULL, &clk_cpu), 119 + /* sa1111 names devices using internal offsets, PCMCIA is at 0x1800 */ 120 + CLKDEV_INIT("1800", NULL, &clk_cpu), 108 121 }; 109 122 110 123 static int __init sa11xx_clk_init(void)
+7 -48
arch/arm/mach-sa1100/collie.c
··· 30 30 #include <linux/gpio_keys.h> 31 31 #include <linux/input.h> 32 32 #include <linux/gpio.h> 33 - #include <linux/pda_power.h> 33 + #include <linux/power/gpio-charger.h> 34 34 35 35 #include <video/sa1100fb.h> 36 36 ··· 131 131 /* 132 132 * Collie AC IN 133 133 */ 134 - static int collie_power_init(struct device *dev) 135 - { 136 - int ret = gpio_request(COLLIE_GPIO_AC_IN, "ac in"); 137 - if (ret) 138 - goto err_gpio_req; 139 - 140 - ret = gpio_direction_input(COLLIE_GPIO_AC_IN); 141 - if (ret) 142 - goto err_gpio_in; 143 - 144 - return 0; 145 - 146 - err_gpio_in: 147 - gpio_free(COLLIE_GPIO_AC_IN); 148 - err_gpio_req: 149 - return ret; 150 - } 151 - 152 - static void collie_power_exit(struct device *dev) 153 - { 154 - gpio_free(COLLIE_GPIO_AC_IN); 155 - } 156 - 157 - static int collie_power_ac_online(void) 158 - { 159 - return gpio_get_value(COLLIE_GPIO_AC_IN) == 2; 160 - } 161 - 162 134 static char *collie_ac_supplied_to[] = { 163 135 "main-battery", 164 136 "backup-battery", 165 137 }; 166 138 167 - static struct pda_power_pdata collie_power_data = { 168 - .init = collie_power_init, 169 - .is_ac_online = collie_power_ac_online, 170 - .exit = collie_power_exit, 139 + 140 + static struct gpio_charger_platform_data collie_power_data = { 141 + .name = "charger", 142 + .type = POWER_SUPPLY_TYPE_MAINS, 143 + .gpio = COLLIE_GPIO_AC_IN, 171 144 .supplied_to = collie_ac_supplied_to, 172 145 .num_supplicants = ARRAY_SIZE(collie_ac_supplied_to), 173 146 }; 174 147 175 - static struct resource collie_power_resource[] = { 176 - { 177 - .name = "ac", 178 - .flags = IORESOURCE_IRQ | 179 - IORESOURCE_IRQ_HIGHEDGE | 180 - IORESOURCE_IRQ_LOWEDGE, 181 - }, 182 - }; 183 - 184 148 static struct platform_device collie_power_device = { 185 - .name = "pda-power", 149 + .name = "gpio-charger", 186 150 .id = -1, 187 151 .dev.platform_data = &collie_power_data, 188 - .resource = collie_power_resource, 189 - .num_resources = ARRAY_SIZE(collie_power_resource), 190 152 }; 191 153 192 154 #ifdef CONFIG_SHARP_LOCOMO ··· 381 419 PCFR = PCFR_OPDE; 382 420 383 421 GPSR |= _COLLIE_GPIO_UCB1x00_RESET; 384 - 385 - collie_power_resource[0].start = gpio_to_irq(COLLIE_GPIO_AC_IN); 386 - collie_power_resource[0].end = gpio_to_irq(COLLIE_GPIO_AC_IN); 387 422 388 423 sa11x0_ppc_configure_mcp(); 389 424
-41
arch/arm/mach-sa1100/include/mach/entry-macro.S
··· 1 - /* 2 - * arch/arm/mach-sa1100/include/mach/entry-macro.S 3 - * 4 - * Low-level IRQ helper macros for SA1100-based platforms 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without any 8 - * warranty of any kind, whether express or implied. 9 - */ 10 - 11 - .macro get_irqnr_preamble, base, tmp 12 - mov \base, #0xfa000000 @ ICIP = 0xfa050000 13 - add \base, \base, #0x00050000 14 - .endm 15 - 16 - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 17 - ldr \irqstat, [\base] @ get irqs 18 - ldr \irqnr, [\base, #4] @ ICMR = 0xfa050004 19 - ands \irqstat, \irqstat, \irqnr 20 - mov \irqnr, #0 21 - beq 1001f 22 - tst \irqstat, #0xff 23 - moveq \irqstat, \irqstat, lsr #8 24 - addeq \irqnr, \irqnr, #8 25 - tsteq \irqstat, #0xff 26 - moveq \irqstat, \irqstat, lsr #8 27 - addeq \irqnr, \irqnr, #8 28 - tsteq \irqstat, #0xff 29 - moveq \irqstat, \irqstat, lsr #8 30 - addeq \irqnr, \irqnr, #8 31 - tst \irqstat, #0x0f 32 - moveq \irqstat, \irqstat, lsr #4 33 - addeq \irqnr, \irqnr, #4 34 - tst \irqstat, #0x03 35 - moveq \irqstat, \irqstat, lsr #2 36 - addeq \irqnr, \irqnr, #2 37 - tst \irqstat, #0x01 38 - addeqs \irqnr, \irqnr, #1 39 - 1001: 40 - .endm 41 -
+51 -51
arch/arm/mach-sa1100/include/mach/irqs.h
··· 8 8 * 2001/11/14 RMK Cleaned up and standardised a lot of the IRQs. 9 9 */ 10 10 11 - #define IRQ_GPIO0 0 12 - #define IRQ_GPIO1 1 13 - #define IRQ_GPIO2 2 14 - #define IRQ_GPIO3 3 15 - #define IRQ_GPIO4 4 16 - #define IRQ_GPIO5 5 17 - #define IRQ_GPIO6 6 18 - #define IRQ_GPIO7 7 19 - #define IRQ_GPIO8 8 20 - #define IRQ_GPIO9 9 21 - #define IRQ_GPIO10 10 22 - #define IRQ_GPIO11_27 11 23 - #define IRQ_LCD 12 /* LCD controller */ 24 - #define IRQ_Ser0UDC 13 /* Ser. port 0 UDC */ 25 - #define IRQ_Ser1SDLC 14 /* Ser. port 1 SDLC */ 26 - #define IRQ_Ser1UART 15 /* Ser. port 1 UART */ 27 - #define IRQ_Ser2ICP 16 /* Ser. port 2 ICP */ 28 - #define IRQ_Ser3UART 17 /* Ser. port 3 UART */ 29 - #define IRQ_Ser4MCP 18 /* Ser. port 4 MCP */ 30 - #define IRQ_Ser4SSP 19 /* Ser. port 4 SSP */ 31 - #define IRQ_DMA0 20 /* DMA controller channel 0 */ 32 - #define IRQ_DMA1 21 /* DMA controller channel 1 */ 33 - #define IRQ_DMA2 22 /* DMA controller channel 2 */ 34 - #define IRQ_DMA3 23 /* DMA controller channel 3 */ 35 - #define IRQ_DMA4 24 /* DMA controller channel 4 */ 36 - #define IRQ_DMA5 25 /* DMA controller channel 5 */ 37 - #define IRQ_OST0 26 /* OS Timer match 0 */ 38 - #define IRQ_OST1 27 /* OS Timer match 1 */ 39 - #define IRQ_OST2 28 /* OS Timer match 2 */ 40 - #define IRQ_OST3 29 /* OS Timer match 3 */ 41 - #define IRQ_RTC1Hz 30 /* RTC 1 Hz clock */ 42 - #define IRQ_RTCAlrm 31 /* RTC Alarm */ 11 + #define IRQ_GPIO0 1 12 + #define IRQ_GPIO1 2 13 + #define IRQ_GPIO2 3 14 + #define IRQ_GPIO3 4 15 + #define IRQ_GPIO4 5 16 + #define IRQ_GPIO5 6 17 + #define IRQ_GPIO6 7 18 + #define IRQ_GPIO7 8 19 + #define IRQ_GPIO8 9 20 + #define IRQ_GPIO9 10 21 + #define IRQ_GPIO10 11 22 + #define IRQ_GPIO11_27 12 23 + #define IRQ_LCD 13 /* LCD controller */ 24 + #define IRQ_Ser0UDC 14 /* Ser. port 0 UDC */ 25 + #define IRQ_Ser1SDLC 15 /* Ser. port 1 SDLC */ 26 + #define IRQ_Ser1UART 16 /* Ser. port 1 UART */ 27 + #define IRQ_Ser2ICP 17 /* Ser. port 2 ICP */ 28 + #define IRQ_Ser3UART 18 /* Ser. port 3 UART */ 29 + #define IRQ_Ser4MCP 19 /* Ser. port 4 MCP */ 30 + #define IRQ_Ser4SSP 20 /* Ser. port 4 SSP */ 31 + #define IRQ_DMA0 21 /* DMA controller channel 0 */ 32 + #define IRQ_DMA1 22 /* DMA controller channel 1 */ 33 + #define IRQ_DMA2 23 /* DMA controller channel 2 */ 34 + #define IRQ_DMA3 24 /* DMA controller channel 3 */ 35 + #define IRQ_DMA4 25 /* DMA controller channel 4 */ 36 + #define IRQ_DMA5 26 /* DMA controller channel 5 */ 37 + #define IRQ_OST0 27 /* OS Timer match 0 */ 38 + #define IRQ_OST1 28 /* OS Timer match 1 */ 39 + #define IRQ_OST2 29 /* OS Timer match 2 */ 40 + #define IRQ_OST3 30 /* OS Timer match 3 */ 41 + #define IRQ_RTC1Hz 31 /* RTC 1 Hz clock */ 42 + #define IRQ_RTCAlrm 32 /* RTC Alarm */ 43 43 44 - #define IRQ_GPIO11 32 45 - #define IRQ_GPIO12 33 46 - #define IRQ_GPIO13 34 47 - #define IRQ_GPIO14 35 48 - #define IRQ_GPIO15 36 49 - #define IRQ_GPIO16 37 50 - #define IRQ_GPIO17 38 51 - #define IRQ_GPIO18 39 52 - #define IRQ_GPIO19 40 53 - #define IRQ_GPIO20 41 54 - #define IRQ_GPIO21 42 55 - #define IRQ_GPIO22 43 56 - #define IRQ_GPIO23 44 57 - #define IRQ_GPIO24 45 58 - #define IRQ_GPIO25 46 59 - #define IRQ_GPIO26 47 60 - #define IRQ_GPIO27 48 44 + #define IRQ_GPIO11 33 45 + #define IRQ_GPIO12 34 46 + #define IRQ_GPIO13 35 47 + #define IRQ_GPIO14 36 48 + #define IRQ_GPIO15 37 49 + #define IRQ_GPIO16 38 50 + #define IRQ_GPIO17 39 51 + #define IRQ_GPIO18 40 52 + #define IRQ_GPIO19 41 53 + #define IRQ_GPIO20 42 54 + #define IRQ_GPIO21 43 55 + #define IRQ_GPIO22 44 56 + #define IRQ_GPIO23 45 57 + #define IRQ_GPIO24 46 58 + #define IRQ_GPIO25 47 59 + #define IRQ_GPIO26 48 60 + #define IRQ_GPIO27 49 61 61 62 62 /* 63 63 * The next 16 interrupts are for board specific purposes. Since ··· 65 65 * these. If you need more, increase IRQ_BOARD_END, but keep it 66 66 * within sensible limits. IRQs 49 to 64 are available. 67 67 */ 68 - #define IRQ_BOARD_START 49 69 - #define IRQ_BOARD_END 65 68 + #define IRQ_BOARD_START 50 69 + #define IRQ_BOARD_END 66 70 70 71 71 /* 72 72 * Figure out the MAX IRQ number.
+131 -100
arch/arm/mach-sa1100/irq.c
··· 14 14 #include <linux/interrupt.h> 15 15 #include <linux/io.h> 16 16 #include <linux/irq.h> 17 + #include <linux/irqdomain.h> 17 18 #include <linux/ioport.h> 18 19 #include <linux/syscore_ops.h> 19 20 20 21 #include <mach/hardware.h> 21 22 #include <mach/irqs.h> 22 23 #include <asm/mach/irq.h> 24 + #include <asm/exception.h> 23 25 24 26 #include "generic.h" 25 27 28 + 29 + /* 30 + * We don't need to ACK IRQs on the SA1100 unless they're GPIOs 31 + * this is for internal IRQs i.e. from IRQ LCD to RTCAlrm. 32 + */ 33 + static void sa1100_mask_irq(struct irq_data *d) 34 + { 35 + ICMR &= ~BIT(d->hwirq); 36 + } 37 + 38 + static void sa1100_unmask_irq(struct irq_data *d) 39 + { 40 + ICMR |= BIT(d->hwirq); 41 + } 42 + 43 + /* 44 + * Apart form GPIOs, only the RTC alarm can be a wakeup event. 45 + */ 46 + static int sa1100_set_wake(struct irq_data *d, unsigned int on) 47 + { 48 + if (BIT(d->hwirq) == IC_RTCAlrm) { 49 + if (on) 50 + PWER |= PWER_RTC; 51 + else 52 + PWER &= ~PWER_RTC; 53 + return 0; 54 + } 55 + return -EINVAL; 56 + } 57 + 58 + static struct irq_chip sa1100_normal_chip = { 59 + .name = "SC", 60 + .irq_ack = sa1100_mask_irq, 61 + .irq_mask = sa1100_mask_irq, 62 + .irq_unmask = sa1100_unmask_irq, 63 + .irq_set_wake = sa1100_set_wake, 64 + }; 65 + 66 + static int sa1100_normal_irqdomain_map(struct irq_domain *d, 67 + unsigned int irq, irq_hw_number_t hwirq) 68 + { 69 + irq_set_chip_and_handler(irq, &sa1100_normal_chip, 70 + handle_level_irq); 71 + set_irq_flags(irq, IRQF_VALID); 72 + 73 + return 0; 74 + } 75 + 76 + static struct irq_domain_ops sa1100_normal_irqdomain_ops = { 77 + .map = sa1100_normal_irqdomain_map, 78 + .xlate = irq_domain_xlate_onetwocell, 79 + }; 80 + 81 + static struct irq_domain *sa1100_normal_irqdomain; 26 82 27 83 /* 28 84 * SA1100 GPIO edge detection for IRQs: ··· 89 33 static int GPIO_IRQ_falling_edge; 90 34 static int GPIO_IRQ_mask = (1 << 11) - 1; 91 35 92 - /* 93 - * To get the GPIO number from an IRQ number 94 - */ 95 - #define GPIO_11_27_IRQ(i) ((i) - 21) 96 - #define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq)) 97 - 98 36 static int sa1100_gpio_type(struct irq_data *d, unsigned int type) 99 37 { 100 38 unsigned int mask; 101 39 102 - if (d->irq <= 10) 103 - mask = 1 << d->irq; 104 - else 105 - mask = GPIO11_27_MASK(d->irq); 40 + mask = BIT(d->hwirq); 106 41 107 42 if (type == IRQ_TYPE_PROBE) { 108 43 if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask) ··· 117 70 } 118 71 119 72 /* 120 - * GPIO IRQs must be acknowledged. This is for IRQs from 0 to 10. 73 + * GPIO IRQs must be acknowledged. 121 74 */ 122 - static void sa1100_low_gpio_ack(struct irq_data *d) 75 + static void sa1100_gpio_ack(struct irq_data *d) 123 76 { 124 - GEDR = (1 << d->irq); 77 + GEDR = BIT(d->hwirq); 125 78 } 126 79 127 - static void sa1100_low_gpio_mask(struct irq_data *d) 128 - { 129 - ICMR &= ~(1 << d->irq); 130 - } 131 - 132 - static void sa1100_low_gpio_unmask(struct irq_data *d) 133 - { 134 - ICMR |= 1 << d->irq; 135 - } 136 - 137 - static int sa1100_low_gpio_wake(struct irq_data *d, unsigned int on) 80 + static int sa1100_gpio_wake(struct irq_data *d, unsigned int on) 138 81 { 139 82 if (on) 140 - PWER |= 1 << d->irq; 83 + PWER |= BIT(d->hwirq); 141 84 else 142 - PWER &= ~(1 << d->irq); 85 + PWER &= ~BIT(d->hwirq); 143 86 return 0; 144 87 } 145 88 89 + /* 90 + * This is for IRQs from 0 to 10. 91 + */ 146 92 static struct irq_chip sa1100_low_gpio_chip = { 147 93 .name = "GPIO-l", 148 - .irq_ack = sa1100_low_gpio_ack, 149 - .irq_mask = sa1100_low_gpio_mask, 150 - .irq_unmask = sa1100_low_gpio_unmask, 94 + .irq_ack = sa1100_gpio_ack, 95 + .irq_mask = sa1100_mask_irq, 96 + .irq_unmask = sa1100_unmask_irq, 151 97 .irq_set_type = sa1100_gpio_type, 152 - .irq_set_wake = sa1100_low_gpio_wake, 98 + .irq_set_wake = sa1100_gpio_wake, 153 99 }; 100 + 101 + static int sa1100_low_gpio_irqdomain_map(struct irq_domain *d, 102 + unsigned int irq, irq_hw_number_t hwirq) 103 + { 104 + irq_set_chip_and_handler(irq, &sa1100_low_gpio_chip, 105 + handle_edge_irq); 106 + set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 107 + 108 + return 0; 109 + } 110 + 111 + static struct irq_domain_ops sa1100_low_gpio_irqdomain_ops = { 112 + .map = sa1100_low_gpio_irqdomain_map, 113 + .xlate = irq_domain_xlate_onetwocell, 114 + }; 115 + 116 + static struct irq_domain *sa1100_low_gpio_irqdomain; 154 117 155 118 /* 156 119 * IRQ11 (GPIO11 through 27) handler. We enter here with the ··· 198 141 * In addition, the IRQs are all collected up into one bit in the 199 142 * interrupt controller registers. 200 143 */ 201 - static void sa1100_high_gpio_ack(struct irq_data *d) 202 - { 203 - unsigned int mask = GPIO11_27_MASK(d->irq); 204 - 205 - GEDR = mask; 206 - } 207 - 208 144 static void sa1100_high_gpio_mask(struct irq_data *d) 209 145 { 210 - unsigned int mask = GPIO11_27_MASK(d->irq); 146 + unsigned int mask = BIT(d->hwirq); 211 147 212 148 GPIO_IRQ_mask &= ~mask; 213 149 ··· 210 160 211 161 static void sa1100_high_gpio_unmask(struct irq_data *d) 212 162 { 213 - unsigned int mask = GPIO11_27_MASK(d->irq); 163 + unsigned int mask = BIT(d->hwirq); 214 164 215 165 GPIO_IRQ_mask |= mask; 216 166 ··· 218 168 GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask; 219 169 } 220 170 221 - static int sa1100_high_gpio_wake(struct irq_data *d, unsigned int on) 222 - { 223 - if (on) 224 - PWER |= GPIO11_27_MASK(d->irq); 225 - else 226 - PWER &= ~GPIO11_27_MASK(d->irq); 227 - return 0; 228 - } 229 - 230 171 static struct irq_chip sa1100_high_gpio_chip = { 231 172 .name = "GPIO-h", 232 - .irq_ack = sa1100_high_gpio_ack, 173 + .irq_ack = sa1100_gpio_ack, 233 174 .irq_mask = sa1100_high_gpio_mask, 234 175 .irq_unmask = sa1100_high_gpio_unmask, 235 176 .irq_set_type = sa1100_gpio_type, 236 - .irq_set_wake = sa1100_high_gpio_wake, 177 + .irq_set_wake = sa1100_gpio_wake, 237 178 }; 238 179 239 - /* 240 - * We don't need to ACK IRQs on the SA1100 unless they're GPIOs 241 - * this is for internal IRQs i.e. from 11 to 31. 242 - */ 243 - static void sa1100_mask_irq(struct irq_data *d) 180 + static int sa1100_high_gpio_irqdomain_map(struct irq_domain *d, 181 + unsigned int irq, irq_hw_number_t hwirq) 244 182 { 245 - ICMR &= ~(1 << d->irq); 183 + irq_set_chip_and_handler(irq, &sa1100_high_gpio_chip, 184 + handle_edge_irq); 185 + set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 186 + 187 + return 0; 246 188 } 247 189 248 - static void sa1100_unmask_irq(struct irq_data *d) 249 - { 250 - ICMR |= (1 << d->irq); 251 - } 252 - 253 - /* 254 - * Apart form GPIOs, only the RTC alarm can be a wakeup event. 255 - */ 256 - static int sa1100_set_wake(struct irq_data *d, unsigned int on) 257 - { 258 - if (d->irq == IRQ_RTCAlrm) { 259 - if (on) 260 - PWER |= PWER_RTC; 261 - else 262 - PWER &= ~PWER_RTC; 263 - return 0; 264 - } 265 - return -EINVAL; 266 - } 267 - 268 - static struct irq_chip sa1100_normal_chip = { 269 - .name = "SC", 270 - .irq_ack = sa1100_mask_irq, 271 - .irq_mask = sa1100_mask_irq, 272 - .irq_unmask = sa1100_unmask_irq, 273 - .irq_set_wake = sa1100_set_wake, 190 + static struct irq_domain_ops sa1100_high_gpio_irqdomain_ops = { 191 + .map = sa1100_high_gpio_irqdomain_map, 192 + .xlate = irq_domain_xlate_onetwocell, 274 193 }; 194 + 195 + static struct irq_domain *sa1100_high_gpio_irqdomain; 275 196 276 197 static struct resource irq_resource = 277 198 DEFINE_RES_MEM_NAMED(0x90050000, SZ_64K, "irqs"); ··· 312 291 313 292 device_initcall(sa1100irq_init_devicefs); 314 293 294 + static asmlinkage void __exception_irq_entry 295 + sa1100_handle_irq(struct pt_regs *regs) 296 + { 297 + uint32_t icip, icmr, mask; 298 + 299 + do { 300 + icip = (ICIP); 301 + icmr = (ICMR); 302 + mask = icip & icmr; 303 + 304 + if (mask == 0) 305 + break; 306 + 307 + handle_IRQ(ffs(mask) - 1 + IRQ_GPIO0, regs); 308 + } while (1); 309 + } 310 + 315 311 void __init sa1100_init_irq(void) 316 312 { 317 - unsigned int irq; 318 - 319 313 request_resource(&iomem_resource, &irq_resource); 320 314 321 315 /* disable all IRQs */ ··· 350 314 */ 351 315 ICCR = 1; 352 316 353 - for (irq = 0; irq <= 10; irq++) { 354 - irq_set_chip_and_handler(irq, &sa1100_low_gpio_chip, 355 - handle_edge_irq); 356 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 357 - } 317 + sa1100_low_gpio_irqdomain = irq_domain_add_legacy(NULL, 318 + 11, IRQ_GPIO0, 0, 319 + &sa1100_low_gpio_irqdomain_ops, NULL); 358 320 359 - for (irq = 12; irq <= 31; irq++) { 360 - irq_set_chip_and_handler(irq, &sa1100_normal_chip, 361 - handle_level_irq); 362 - set_irq_flags(irq, IRQF_VALID); 363 - } 321 + sa1100_normal_irqdomain = irq_domain_add_legacy(NULL, 322 + 21, IRQ_GPIO11_27, 11, 323 + &sa1100_normal_irqdomain_ops, NULL); 364 324 365 - for (irq = 32; irq <= 48; irq++) { 366 - irq_set_chip_and_handler(irq, &sa1100_high_gpio_chip, 367 - handle_edge_irq); 368 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 369 - } 325 + sa1100_high_gpio_irqdomain = irq_domain_add_legacy(NULL, 326 + 17, IRQ_GPIO11, 11, 327 + &sa1100_high_gpio_irqdomain_ops, NULL); 370 328 371 329 /* 372 330 * Install handler for GPIO 11-27 edge detect interrupts 373 331 */ 374 - irq_set_chip(IRQ_GPIO11_27, &sa1100_normal_chip); 375 332 irq_set_chained_handler(IRQ_GPIO11_27, sa1100_high_gpio_handler); 333 + 334 + set_handle_irq(sa1100_handle_irq); 376 335 377 336 sa1100_init_gpio(); 378 337 }
+1 -1
arch/arm/mm/Makefile
··· 6 6 iomap.o 7 7 8 8 obj-$(CONFIG_MMU) += fault-armv.o flush.o idmap.o ioremap.o \ 9 - mmap.o pgd.o mmu.o 9 + mmap.o pgd.o mmu.o pageattr.o 10 10 11 11 ifneq ($(CONFIG_MMU),y) 12 12 obj-y += nommu.o
+5 -5
arch/arm/mm/alignment.c
··· 113 113 new_usermode |= UM_FIXUP; 114 114 115 115 if (warn) 116 - printk(KERN_WARNING "alignment: ignoring faults is unsafe on this CPU. Defaulting to fixup mode.\n"); 116 + pr_warn("alignment: ignoring faults is unsafe on this CPU. Defaulting to fixup mode.\n"); 117 117 } 118 118 119 119 return new_usermode; ··· 523 523 * processor for us. 524 524 */ 525 525 if (addr != eaddr) { 526 - printk(KERN_ERR "LDMSTM: PC = %08lx, instr = %08lx, " 526 + pr_err("LDMSTM: PC = %08lx, instr = %08lx, " 527 527 "addr = %08lx, eaddr = %08lx\n", 528 528 instruction_pointer(regs), instr, addr, eaddr); 529 529 show_regs(regs); ··· 567 567 return TYPE_FAULT; 568 568 569 569 bad: 570 - printk(KERN_ERR "Alignment trap: not handling ldm with s-bit set\n"); 570 + pr_err("Alignment trap: not handling ldm with s-bit set\n"); 571 571 return TYPE_ERROR; 572 572 } 573 573 ··· 899 899 return 0; 900 900 901 901 swp: 902 - printk(KERN_ERR "Alignment trap: not handling swp instruction\n"); 902 + pr_err("Alignment trap: not handling swp instruction\n"); 903 903 904 904 bad: 905 905 /* 906 906 * Oops, we didn't handle the instruction. 907 907 */ 908 - printk(KERN_ERR "Alignment trap: not handling instruction " 908 + pr_err("Alignment trap: not handling instruction " 909 909 "%0*lx at [<%08lx>]\n", 910 910 isize << 1, 911 911 isize == 2 ? tinstr : instr, instrptr);
+3 -3
arch/arm/mm/cache-feroceon-l2.c
··· 313 313 */ 314 314 u = read_extra_features(); 315 315 if (!(u & 0x01000000)) { 316 - printk(KERN_INFO "Feroceon L2: Disabling L2 prefetch.\n"); 316 + pr_info("Feroceon L2: Disabling L2 prefetch.\n"); 317 317 write_extra_features(u | 0x01000000); 318 318 } 319 319 } ··· 326 326 if (!(u & 0x00400000)) { 327 327 int i, d; 328 328 329 - printk(KERN_INFO "Feroceon L2: Enabling L2\n"); 329 + pr_info("Feroceon L2: Enabling L2\n"); 330 330 331 331 d = flush_and_disable_dcache(); 332 332 i = invalidate_and_disable_icache(); ··· 353 353 354 354 enable_l2(); 355 355 356 - printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n", 356 + pr_info("Feroceon L2: Cache support initialised%s.\n", 357 357 l2_wt_override ? ", in WT override mode" : ""); 358 358 } 359 359 #ifdef CONFIG_OF
+6 -6
arch/arm/mm/cache-tauros2.c
··· 185 185 u &= ~0x01000000; 186 186 else 187 187 u |= 0x01000000; 188 - printk(KERN_INFO "Tauros2: %s L2 prefetch.\n", 188 + pr_info("Tauros2: %s L2 prefetch.\n", 189 189 (features & CACHE_TAUROS2_PREFETCH_ON) 190 190 ? "Enabling" : "Disabling"); 191 191 ··· 193 193 u |= 0x00100000; 194 194 else 195 195 u &= ~0x00100000; 196 - printk(KERN_INFO "Tauros2: %s line fill burt8.\n", 196 + pr_info("Tauros2: %s line fill burt8.\n", 197 197 (features & CACHE_TAUROS2_LINEFILL_BURST8) 198 198 ? "Enabling" : "Disabling"); 199 199 ··· 216 216 */ 217 217 feat = read_extra_features(); 218 218 if (!(feat & 0x00400000)) { 219 - printk(KERN_INFO "Tauros2: Enabling L2 cache.\n"); 219 + pr_info("Tauros2: Enabling L2 cache.\n"); 220 220 write_extra_features(feat | 0x00400000); 221 221 } 222 222 ··· 253 253 */ 254 254 actlr = read_actlr(); 255 255 if (!(actlr & 0x00000002)) { 256 - printk(KERN_INFO "Tauros2: Enabling L2 cache.\n"); 256 + pr_info("Tauros2: Enabling L2 cache.\n"); 257 257 write_actlr(actlr | 0x00000002); 258 258 } 259 259 ··· 262 262 #endif 263 263 264 264 if (mode == NULL) { 265 - printk(KERN_CRIT "Tauros2: Unable to detect CPU mode.\n"); 265 + pr_crit("Tauros2: Unable to detect CPU mode.\n"); 266 266 return; 267 267 } 268 268 269 - printk(KERN_INFO "Tauros2: L2 cache support initialised " 269 + pr_info("Tauros2: L2 cache support initialised " 270 270 "in %s mode.\n", mode); 271 271 } 272 272
+34 -24
arch/arm/mm/context.c
··· 184 184 u64 asid = atomic64_read(&mm->context.id); 185 185 u64 generation = atomic64_read(&asid_generation); 186 186 187 - if (asid != 0 && is_reserved_asid(asid)) { 187 + if (asid != 0) { 188 188 /* 189 - * Our current ASID was active during a rollover, we can 190 - * continue to use it and this was just a false alarm. 189 + * If our current ASID was active during a rollover, we 190 + * can continue to use it and this was just a false alarm. 191 191 */ 192 - asid = generation | (asid & ~ASID_MASK); 193 - } else { 192 + if (is_reserved_asid(asid)) 193 + return generation | (asid & ~ASID_MASK); 194 + 194 195 /* 195 - * Allocate a free ASID. If we can't find one, take a 196 - * note of the currently active ASIDs and mark the TLBs 197 - * as requiring flushes. We always count from ASID #1, 198 - * as we reserve ASID #0 to switch via TTBR0 and to 199 - * avoid speculative page table walks from hitting in 200 - * any partial walk caches, which could be populated 201 - * from overlapping level-1 descriptors used to map both 202 - * the module area and the userspace stack. 196 + * We had a valid ASID in a previous life, so try to re-use 197 + * it if possible., 203 198 */ 204 - asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, cur_idx); 205 - if (asid == NUM_USER_ASIDS) { 206 - generation = atomic64_add_return(ASID_FIRST_VERSION, 207 - &asid_generation); 208 - flush_context(cpu); 209 - asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1); 210 - } 211 - __set_bit(asid, asid_map); 212 - cur_idx = asid; 213 - asid |= generation; 214 - cpumask_clear(mm_cpumask(mm)); 199 + asid &= ~ASID_MASK; 200 + if (!__test_and_set_bit(asid, asid_map)) 201 + goto bump_gen; 215 202 } 216 203 204 + /* 205 + * Allocate a free ASID. If we can't find one, take a note of the 206 + * currently active ASIDs and mark the TLBs as requiring flushes. 207 + * We always count from ASID #1, as we reserve ASID #0 to switch 208 + * via TTBR0 and to avoid speculative page table walks from hitting 209 + * in any partial walk caches, which could be populated from 210 + * overlapping level-1 descriptors used to map both the module 211 + * area and the userspace stack. 212 + */ 213 + asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, cur_idx); 214 + if (asid == NUM_USER_ASIDS) { 215 + generation = atomic64_add_return(ASID_FIRST_VERSION, 216 + &asid_generation); 217 + flush_context(cpu); 218 + asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1); 219 + } 220 + 221 + __set_bit(asid, asid_map); 222 + cur_idx = asid; 223 + 224 + bump_gen: 225 + asid |= generation; 226 + cpumask_clear(mm_cpumask(mm)); 217 227 return asid; 218 228 } 219 229
+1 -1
arch/arm/mm/copypage-v6.c
··· 62 62 __asm__("mcrr p15, 0, %1, %0, c6 @ 0xec401f06" 63 63 : 64 64 : "r" (kto), 65 - "r" ((unsigned long)kto + PAGE_SIZE - L1_CACHE_BYTES) 65 + "r" ((unsigned long)kto + PAGE_SIZE - 1) 66 66 : "cc"); 67 67 } 68 68
+3 -3
arch/arm/mm/fault-armv.c
··· 235 235 const char *reason; 236 236 unsigned long v = 1; 237 237 238 - printk(KERN_INFO "CPU: Testing write buffer coherency: "); 238 + pr_info("CPU: Testing write buffer coherency: "); 239 239 240 240 page = alloc_page(GFP_KERNEL); 241 241 if (page) { ··· 261 261 } 262 262 263 263 if (v) { 264 - printk("failed, %s\n", reason); 264 + pr_cont("failed, %s\n", reason); 265 265 shared_pte_mask = L_PTE_MT_UNCACHED; 266 266 } else { 267 - printk("ok\n"); 267 + pr_cont("ok\n"); 268 268 } 269 269 }
+15 -16
arch/arm/mm/fault.c
··· 63 63 if (!mm) 64 64 mm = &init_mm; 65 65 66 - printk(KERN_ALERT "pgd = %p\n", mm->pgd); 66 + pr_alert("pgd = %p\n", mm->pgd); 67 67 pgd = pgd_offset(mm, addr); 68 - printk(KERN_ALERT "[%08lx] *pgd=%08llx", 68 + pr_alert("[%08lx] *pgd=%08llx", 69 69 addr, (long long)pgd_val(*pgd)); 70 70 71 71 do { ··· 77 77 break; 78 78 79 79 if (pgd_bad(*pgd)) { 80 - printk("(bad)"); 80 + pr_cont("(bad)"); 81 81 break; 82 82 } 83 83 84 84 pud = pud_offset(pgd, addr); 85 85 if (PTRS_PER_PUD != 1) 86 - printk(", *pud=%08llx", (long long)pud_val(*pud)); 86 + pr_cont(", *pud=%08llx", (long long)pud_val(*pud)); 87 87 88 88 if (pud_none(*pud)) 89 89 break; 90 90 91 91 if (pud_bad(*pud)) { 92 - printk("(bad)"); 92 + pr_cont("(bad)"); 93 93 break; 94 94 } 95 95 96 96 pmd = pmd_offset(pud, addr); 97 97 if (PTRS_PER_PMD != 1) 98 - printk(", *pmd=%08llx", (long long)pmd_val(*pmd)); 98 + pr_cont(", *pmd=%08llx", (long long)pmd_val(*pmd)); 99 99 100 100 if (pmd_none(*pmd)) 101 101 break; 102 102 103 103 if (pmd_bad(*pmd)) { 104 - printk("(bad)"); 104 + pr_cont("(bad)"); 105 105 break; 106 106 } 107 107 ··· 110 110 break; 111 111 112 112 pte = pte_offset_map(pmd, addr); 113 - printk(", *pte=%08llx", (long long)pte_val(*pte)); 113 + pr_cont(", *pte=%08llx", (long long)pte_val(*pte)); 114 114 #ifndef CONFIG_ARM_LPAE 115 - printk(", *ppte=%08llx", 115 + pr_cont(", *ppte=%08llx", 116 116 (long long)pte_val(pte[PTE_HWTABLE_PTRS])); 117 117 #endif 118 118 pte_unmap(pte); 119 119 } while(0); 120 120 121 - printk("\n"); 121 + pr_cont("\n"); 122 122 } 123 123 #else /* CONFIG_MMU */ 124 124 void show_pte(struct mm_struct *mm, unsigned long addr) ··· 142 142 * No handler, we'll have to terminate things with extreme prejudice. 143 143 */ 144 144 bust_spinlocks(1); 145 - printk(KERN_ALERT 146 - "Unable to handle kernel %s at virtual address %08lx\n", 147 - (addr < PAGE_SIZE) ? "NULL pointer dereference" : 148 - "paging request", addr); 145 + pr_alert("Unable to handle kernel %s at virtual address %08lx\n", 146 + (addr < PAGE_SIZE) ? "NULL pointer dereference" : 147 + "paging request", addr); 149 148 150 149 show_pte(mm, addr); 151 150 die("Oops", regs, fsr); ··· 550 551 if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs)) 551 552 return; 552 553 553 - printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n", 554 + pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n", 554 555 inf->name, fsr, addr); 555 556 556 557 info.si_signo = inf->sig; ··· 582 583 if (!inf->fn(addr, ifsr | FSR_LNX_PF, regs)) 583 584 return; 584 585 585 - printk(KERN_ALERT "Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n", 586 + pr_alert("Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n", 586 587 inf->name, ifsr, addr); 587 588 588 589 info.si_signo = inf->sig;
+1 -1
arch/arm/mm/flush.c
··· 33 33 asm( "mcrr p15, 0, %1, %0, c14\n" 34 34 " mcr p15, 0, %2, c7, c10, 4" 35 35 : 36 - : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero) 36 + : "r" (to), "r" (to + PAGE_SIZE - 1), "r" (zero) 37 37 : "cc"); 38 38 } 39 39
+2 -2
arch/arm/mm/init.c
··· 67 67 68 68 static int __init parse_tag_initrd(const struct tag *tag) 69 69 { 70 - printk(KERN_WARNING "ATAG_INITRD is deprecated; " 70 + pr_warn("ATAG_INITRD is deprecated; " 71 71 "please update your bootloader.\n"); 72 72 phys_initrd_start = __virt_to_phys(tag->u.initrd.start); 73 73 phys_initrd_size = tag->u.initrd.size; ··· 544 544 #define MLM(b, t) b, t, ((t) - (b)) >> 20 545 545 #define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K) 546 546 547 - printk(KERN_NOTICE "Virtual kernel memory layout:\n" 547 + pr_notice("Virtual kernel memory layout:\n" 548 548 " vector : 0x%08lx - 0x%08lx (%4ld kB)\n" 549 549 #ifdef CONFIG_HAVE_TCM 550 550 " DTCM : 0x%08lx - 0x%08lx (%4ld kB)\n"
+32 -62
arch/arm/mm/mmu.c
··· 52 52 */ 53 53 pmd_t *top_pmd; 54 54 55 + pmdval_t user_pmd_table = _PAGE_USER_TABLE; 56 + 55 57 #define CPOLICY_UNCACHED 0 56 58 #define CPOLICY_BUFFERED 1 57 59 #define CPOLICY_WRITETHROUGH 2 ··· 194 192 static int __init early_nocache(char *__unused) 195 193 { 196 194 char *p = "buffered"; 197 - printk(KERN_WARNING "nocache is deprecated; use cachepolicy=%s\n", p); 195 + pr_warn("nocache is deprecated; use cachepolicy=%s\n", p); 198 196 early_cachepolicy(p); 199 197 return 0; 200 198 } ··· 203 201 static int __init early_nowrite(char *__unused) 204 202 { 205 203 char *p = "uncached"; 206 - printk(KERN_WARNING "nowb is deprecated; use cachepolicy=%s\n", p); 204 + pr_warn("nowb is deprecated; use cachepolicy=%s\n", p); 207 205 early_cachepolicy(p); 208 206 return 0; 209 207 } ··· 356 354 } 357 355 EXPORT_SYMBOL(get_mem_type); 358 356 359 - #define PTE_SET_FN(_name, pteop) \ 360 - static int pte_set_##_name(pte_t *ptep, pgtable_t token, unsigned long addr, \ 361 - void *data) \ 362 - { \ 363 - pte_t pte = pteop(*ptep); \ 364 - \ 365 - set_pte_ext(ptep, pte, 0); \ 366 - return 0; \ 367 - } \ 368 - 369 - #define SET_MEMORY_FN(_name, callback) \ 370 - int set_memory_##_name(unsigned long addr, int numpages) \ 371 - { \ 372 - unsigned long start = addr; \ 373 - unsigned long size = PAGE_SIZE*numpages; \ 374 - unsigned end = start + size; \ 375 - \ 376 - if (start < MODULES_VADDR || start >= MODULES_END) \ 377 - return -EINVAL;\ 378 - \ 379 - if (end < MODULES_VADDR || end >= MODULES_END) \ 380 - return -EINVAL; \ 381 - \ 382 - apply_to_page_range(&init_mm, start, size, callback, NULL); \ 383 - flush_tlb_kernel_range(start, end); \ 384 - return 0;\ 385 - } 386 - 387 - PTE_SET_FN(ro, pte_wrprotect) 388 - PTE_SET_FN(rw, pte_mkwrite) 389 - PTE_SET_FN(x, pte_mkexec) 390 - PTE_SET_FN(nx, pte_mknexec) 391 - 392 - SET_MEMORY_FN(ro, pte_set_ro) 393 - SET_MEMORY_FN(rw, pte_set_rw) 394 - SET_MEMORY_FN(x, pte_set_x) 395 - SET_MEMORY_FN(nx, pte_set_nx) 396 - 397 357 /* 398 358 * Adjust the PMD section entries according to the CPU in use. 399 359 */ ··· 492 528 hyp_device_pgprot = mem_types[MT_DEVICE].prot_pte; 493 529 s2_device_pgprot = mem_types[MT_DEVICE].prot_pte_s2; 494 530 531 + #ifndef CONFIG_ARM_LPAE 495 532 /* 496 533 * We don't use domains on ARMv6 (since this causes problems with 497 534 * v6/v7 kernels), so we must use a separate memory type for user 498 535 * r/o, kernel r/w to map the vectors page. 499 536 */ 500 - #ifndef CONFIG_ARM_LPAE 501 537 if (cpu_arch == CPU_ARCH_ARMv6) 502 538 vecs_pgprot |= L_PTE_MT_VECTORS; 539 + 540 + /* 541 + * Check is it with support for the PXN bit 542 + * in the Short-descriptor translation table format descriptors. 543 + */ 544 + if (cpu_arch == CPU_ARCH_ARMv7 && 545 + (read_cpuid_ext(CPUID_EXT_MMFR0) & 0xF) == 4) { 546 + user_pmd_table |= PMD_PXNTABLE; 547 + } 503 548 #endif 504 549 505 550 /* ··· 578 605 } 579 606 kern_pgprot |= PTE_EXT_AF; 580 607 vecs_pgprot |= PTE_EXT_AF; 608 + 609 + /* 610 + * Set PXN for user mappings 611 + */ 612 + user_pgprot |= PTE_EXT_PXN; 581 613 #endif 582 614 583 615 for (i = 0; i < 16; i++) { ··· 764 786 length = PAGE_ALIGN(md->length); 765 787 766 788 if (!(cpu_architecture() >= CPU_ARCH_ARMv6 || cpu_is_xsc3())) { 767 - printk(KERN_ERR "MM: CPU does not support supersection " 768 - "mapping for 0x%08llx at 0x%08lx\n", 789 + pr_err("MM: CPU does not support supersection mapping for 0x%08llx at 0x%08lx\n", 769 790 (long long)__pfn_to_phys((u64)md->pfn), addr); 770 791 return; 771 792 } ··· 776 799 * of the actual domain assignments in use. 777 800 */ 778 801 if (type->domain) { 779 - printk(KERN_ERR "MM: invalid domain in supersection " 780 - "mapping for 0x%08llx at 0x%08lx\n", 802 + pr_err("MM: invalid domain in supersection mapping for 0x%08llx at 0x%08lx\n", 781 803 (long long)__pfn_to_phys((u64)md->pfn), addr); 782 804 return; 783 805 } 784 806 785 807 if ((addr | length | __pfn_to_phys(md->pfn)) & ~SUPERSECTION_MASK) { 786 - printk(KERN_ERR "MM: cannot create mapping for 0x%08llx" 787 - " at 0x%08lx invalid alignment\n", 808 + pr_err("MM: cannot create mapping for 0x%08llx at 0x%08lx invalid alignment\n", 788 809 (long long)__pfn_to_phys((u64)md->pfn), addr); 789 810 return; 790 811 } ··· 825 850 pgd_t *pgd; 826 851 827 852 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) { 828 - printk(KERN_WARNING "BUG: not creating mapping for 0x%08llx" 829 - " at 0x%08lx in user region\n", 830 - (long long)__pfn_to_phys((u64)md->pfn), md->virtual); 853 + pr_warn("BUG: not creating mapping for 0x%08llx at 0x%08lx in user region\n", 854 + (long long)__pfn_to_phys((u64)md->pfn), md->virtual); 831 855 return; 832 856 } 833 857 834 858 if ((md->type == MT_DEVICE || md->type == MT_ROM) && 835 859 md->virtual >= PAGE_OFFSET && 836 860 (md->virtual < VMALLOC_START || md->virtual >= VMALLOC_END)) { 837 - printk(KERN_WARNING "BUG: mapping for 0x%08llx" 838 - " at 0x%08lx out of vmalloc space\n", 839 - (long long)__pfn_to_phys((u64)md->pfn), md->virtual); 861 + pr_warn("BUG: mapping for 0x%08llx at 0x%08lx out of vmalloc space\n", 862 + (long long)__pfn_to_phys((u64)md->pfn), md->virtual); 840 863 } 841 864 842 865 type = &mem_types[md->type]; ··· 854 881 length = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK)); 855 882 856 883 if (type->prot_l1 == 0 && ((addr | phys | length) & ~SECTION_MASK)) { 857 - printk(KERN_WARNING "BUG: map for 0x%08llx at 0x%08lx can not " 858 - "be mapped using pages, ignoring.\n", 859 - (long long)__pfn_to_phys(md->pfn), addr); 884 + pr_warn("BUG: map for 0x%08llx at 0x%08lx can not be mapped using pages, ignoring.\n", 885 + (long long)__pfn_to_phys(md->pfn), addr); 860 886 return; 861 887 } 862 888 ··· 1025 1053 1026 1054 if (vmalloc_reserve < SZ_16M) { 1027 1055 vmalloc_reserve = SZ_16M; 1028 - printk(KERN_WARNING 1029 - "vmalloc area too small, limiting to %luMB\n", 1056 + pr_warn("vmalloc area too small, limiting to %luMB\n", 1030 1057 vmalloc_reserve >> 20); 1031 1058 } 1032 1059 1033 1060 if (vmalloc_reserve > VMALLOC_END - (PAGE_OFFSET + SZ_32M)) { 1034 1061 vmalloc_reserve = VMALLOC_END - (PAGE_OFFSET + SZ_32M); 1035 - printk(KERN_WARNING 1036 - "vmalloc area is too big, limiting to %luMB\n", 1062 + pr_warn("vmalloc area is too big, limiting to %luMB\n", 1037 1063 vmalloc_reserve >> 20); 1038 1064 } 1039 1065 ··· 1064 1094 1065 1095 if (highmem) { 1066 1096 pr_notice("Ignoring RAM at %pa-%pa (!CONFIG_HIGHMEM)\n", 1067 - &block_start, &block_end); 1097 + &block_start, &block_end); 1068 1098 memblock_remove(reg->base, reg->size); 1069 1099 continue; 1070 1100 } ··· 1073 1103 phys_addr_t overlap_size = reg->size - size_limit; 1074 1104 1075 1105 pr_notice("Truncating RAM at %pa-%pa to -%pa", 1076 - &block_start, &block_end, &vmalloc_limit); 1106 + &block_start, &block_end, &vmalloc_limit); 1077 1107 memblock_remove(vmalloc_limit, overlap_size); 1078 1108 block_end = vmalloc_limit; 1079 1109 }
+91
arch/arm/mm/pageattr.c
··· 1 + /* 2 + * Copyright (c) 2014, The Linux Foundation. All rights reserved. 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 version 2 and 6 + * only version 2 as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope that it will be useful, 9 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 + * GNU General Public License for more details. 12 + */ 13 + #include <linux/mm.h> 14 + #include <linux/module.h> 15 + 16 + #include <asm/pgtable.h> 17 + #include <asm/tlbflush.h> 18 + 19 + struct page_change_data { 20 + pgprot_t set_mask; 21 + pgprot_t clear_mask; 22 + }; 23 + 24 + static int change_page_range(pte_t *ptep, pgtable_t token, unsigned long addr, 25 + void *data) 26 + { 27 + struct page_change_data *cdata = data; 28 + pte_t pte = *ptep; 29 + 30 + pte = clear_pte_bit(pte, cdata->clear_mask); 31 + pte = set_pte_bit(pte, cdata->set_mask); 32 + 33 + set_pte_ext(ptep, pte, 0); 34 + return 0; 35 + } 36 + 37 + static int change_memory_common(unsigned long addr, int numpages, 38 + pgprot_t set_mask, pgprot_t clear_mask) 39 + { 40 + unsigned long start = addr; 41 + unsigned long size = PAGE_SIZE*numpages; 42 + unsigned long end = start + size; 43 + int ret; 44 + struct page_change_data data; 45 + 46 + if (!IS_ALIGNED(addr, PAGE_SIZE)) { 47 + start &= PAGE_MASK; 48 + end = start + size; 49 + WARN_ON_ONCE(1); 50 + } 51 + 52 + if (!is_module_address(start) || !is_module_address(end - 1)) 53 + return -EINVAL; 54 + 55 + data.set_mask = set_mask; 56 + data.clear_mask = clear_mask; 57 + 58 + ret = apply_to_page_range(&init_mm, start, size, change_page_range, 59 + &data); 60 + 61 + flush_tlb_kernel_range(start, end); 62 + return ret; 63 + } 64 + 65 + int set_memory_ro(unsigned long addr, int numpages) 66 + { 67 + return change_memory_common(addr, numpages, 68 + __pgprot(L_PTE_RDONLY), 69 + __pgprot(0)); 70 + } 71 + 72 + int set_memory_rw(unsigned long addr, int numpages) 73 + { 74 + return change_memory_common(addr, numpages, 75 + __pgprot(0), 76 + __pgprot(L_PTE_RDONLY)); 77 + } 78 + 79 + int set_memory_nx(unsigned long addr, int numpages) 80 + { 81 + return change_memory_common(addr, numpages, 82 + __pgprot(L_PTE_XN), 83 + __pgprot(0)); 84 + } 85 + 86 + int set_memory_x(unsigned long addr, int numpages) 87 + { 88 + return change_memory_common(addr, numpages, 89 + __pgprot(0), 90 + __pgprot(L_PTE_XN)); 91 + }
+3 -2
arch/arm/mm/proc-v7.S
··· 591 591 /* 592 592 * Some Krait processors don't indicate support for SDIV and UDIV 593 593 * instructions in the ARM instruction set, even though they actually 594 - * do support them. 594 + * do support them. They also don't indicate support for fused multiply 595 + * instructions even though they actually do support them. 595 596 */ 596 - __v7_proc __v7_setup, hwcaps = HWCAP_IDIV 597 + __v7_proc __v7_setup, hwcaps = HWCAP_IDIV | HWCAP_VFPv4 597 598 .size __krait_proc_info, . - __krait_proc_info 598 599 599 600 /*
+4 -4
arch/arm/nwfpe/fpmodule.c
··· 86 86 static int __init fpe_init(void) 87 87 { 88 88 if (sizeof(FPA11) > sizeof(union fp_state)) { 89 - printk(KERN_ERR "nwfpe: bad structure size\n"); 89 + pr_err("nwfpe: bad structure size\n"); 90 90 return -EINVAL; 91 91 } 92 92 93 93 if (sizeof(FPREG) != 12) { 94 - printk(KERN_ERR "nwfpe: bad register size\n"); 94 + pr_err("nwfpe: bad register size\n"); 95 95 return -EINVAL; 96 96 } 97 97 if (fpe_type[0] && strcmp(fpe_type, "nwfpe")) 98 98 return 0; 99 99 100 100 /* Display title, version and copyright information. */ 101 - printk(KERN_WARNING "NetWinder Floating Point Emulator V0.97 (" 102 - NWFPE_BITS " precision)\n"); 101 + pr_info("NetWinder Floating Point Emulator V0.97 (" 102 + NWFPE_BITS " precision)\n"); 103 103 104 104 thread_register_notifier(&nwfpe_notifier_block); 105 105
+6
arch/arm/vfp/vfphw.S
··· 197 197 tst r5, #FPSCR_IXE 198 198 bne process_exception 199 199 200 + tst r5, #FPSCR_LENGTH_MASK 201 + beq skip 202 + orr r1, r1, #FPEXC_DEX 203 + b process_exception 204 + skip: 205 + 200 206 @ Fall into hand on to next handler - appropriate coproc instr 201 207 @ not recognised by VFP 202 208
+56 -46
arch/arm/vfp/vfpmodule.c
··· 738 738 vfp_vector = vfp_null_entry; 739 739 740 740 pr_info("VFP support v0.3: "); 741 - if (VFP_arch) 741 + if (VFP_arch) { 742 742 pr_cont("not present\n"); 743 - else if (vfpsid & FPSID_NODOUBLE) { 744 - pr_cont("no double precision support\n"); 745 - } else { 746 - hotcpu_notifier(vfp_hotplug, 0); 747 - 748 - VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ 749 - pr_cont("implementor %02x architecture %d part %02x variant %x rev %x\n", 750 - (vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT, 751 - (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT, 752 - (vfpsid & FPSID_PART_MASK) >> FPSID_PART_BIT, 753 - (vfpsid & FPSID_VARIANT_MASK) >> FPSID_VARIANT_BIT, 754 - (vfpsid & FPSID_REV_MASK) >> FPSID_REV_BIT); 755 - 756 - vfp_vector = vfp_support_entry; 757 - 758 - thread_register_notifier(&vfp_notifier_block); 759 - vfp_pm_init(); 760 - 761 - /* 762 - * We detected VFP, and the support code is 763 - * in place; report VFP support to userspace. 764 - */ 765 - elf_hwcap |= HWCAP_VFP; 766 - #ifdef CONFIG_VFPv3 767 - if (VFP_arch >= 2) { 768 - elf_hwcap |= HWCAP_VFPv3; 769 - 770 - /* 771 - * Check for VFPv3 D16 and VFPv4 D16. CPUs in 772 - * this configuration only have 16 x 64bit 773 - * registers. 774 - */ 775 - if (((fmrx(MVFR0) & MVFR0_A_SIMD_MASK)) == 1) 776 - elf_hwcap |= HWCAP_VFPv3D16; /* also v4-D16 */ 777 - else 778 - elf_hwcap |= HWCAP_VFPD32; 779 - } 780 - #endif 743 + return 0; 744 + /* Extract the architecture on CPUID scheme */ 745 + } else if ((read_cpuid_id() & 0x000f0000) == 0x000f0000) { 746 + VFP_arch = vfpsid & FPSID_CPUID_ARCH_MASK; 747 + VFP_arch >>= FPSID_ARCH_BIT; 781 748 /* 782 749 * Check for the presence of the Advanced SIMD 783 750 * load/store instructions, integer and single 784 751 * precision floating point operations. Only check 785 752 * for NEON if the hardware has the MVFR registers. 786 753 */ 787 - if ((read_cpuid_id() & 0x000f0000) == 0x000f0000) { 788 - #ifdef CONFIG_NEON 789 - if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100) 790 - elf_hwcap |= HWCAP_NEON; 791 - #endif 792 - #ifdef CONFIG_VFPv3 754 + if (IS_ENABLED(CONFIG_NEON) && 755 + (fmrx(MVFR1) & 0x000fff00) == 0x00011100) 756 + elf_hwcap |= HWCAP_NEON; 757 + 758 + if (IS_ENABLED(CONFIG_VFPv3)) { 759 + u32 mvfr0 = fmrx(MVFR0); 760 + if (((mvfr0 & MVFR0_DP_MASK) >> MVFR0_DP_BIT) == 0x2 || 761 + ((mvfr0 & MVFR0_SP_MASK) >> MVFR0_SP_BIT) == 0x2) { 762 + elf_hwcap |= HWCAP_VFPv3; 763 + /* 764 + * Check for VFPv3 D16 and VFPv4 D16. CPUs in 765 + * this configuration only have 16 x 64bit 766 + * registers. 767 + */ 768 + if ((mvfr0 & MVFR0_A_SIMD_MASK) == 1) 769 + /* also v4-D16 */ 770 + elf_hwcap |= HWCAP_VFPv3D16; 771 + else 772 + elf_hwcap |= HWCAP_VFPD32; 773 + } 774 + 793 775 if ((fmrx(MVFR1) & 0xf0000000) == 0x10000000) 794 776 elf_hwcap |= HWCAP_VFPv4; 795 - #endif 796 777 } 778 + /* Extract the architecture version on pre-cpuid scheme */ 779 + } else { 780 + if (vfpsid & FPSID_NODOUBLE) { 781 + pr_cont("no double precision support\n"); 782 + return 0; 783 + } 784 + 785 + VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; 797 786 } 787 + 788 + hotcpu_notifier(vfp_hotplug, 0); 789 + 790 + vfp_vector = vfp_support_entry; 791 + 792 + thread_register_notifier(&vfp_notifier_block); 793 + vfp_pm_init(); 794 + 795 + /* 796 + * We detected VFP, and the support code is 797 + * in place; report VFP support to userspace. 798 + */ 799 + elf_hwcap |= HWCAP_VFP; 800 + 801 + pr_cont("implementor %02x architecture %d part %02x variant %x rev %x\n", 802 + (vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT, 803 + VFP_arch, 804 + (vfpsid & FPSID_PART_MASK) >> FPSID_PART_BIT, 805 + (vfpsid & FPSID_VARIANT_MASK) >> FPSID_VARIANT_BIT, 806 + (vfpsid & FPSID_REV_MASK) >> FPSID_REV_BIT); 807 + 798 808 return 0; 799 809 } 800 810
+1 -1
arch/arm/vfp/vfpsingle.c
··· 290 290 u32 z, a; 291 291 292 292 if ((significand & 0xc0000000) != 0x40000000) { 293 - printk(KERN_WARNING "VFP: estimate_sqrt: invalid significand\n"); 293 + pr_warn("VFP: estimate_sqrt: invalid significand\n"); 294 294 } 295 295 296 296 a = significand << 1;
+11 -4
drivers/amba/bus.c
··· 95 95 struct amba_device *pcdev = to_amba_device(dev); 96 96 int ret = pm_generic_runtime_suspend(dev); 97 97 98 - if (ret == 0 && dev->driver) 99 - clk_disable_unprepare(pcdev->pclk); 98 + if (ret == 0 && dev->driver) { 99 + if (pm_runtime_is_irq_safe(dev)) 100 + clk_disable(pcdev->pclk); 101 + else 102 + clk_disable_unprepare(pcdev->pclk); 103 + } 100 104 101 105 return ret; 102 106 } ··· 111 107 int ret; 112 108 113 109 if (dev->driver) { 114 - ret = clk_prepare_enable(pcdev->pclk); 110 + if (pm_runtime_is_irq_safe(dev)) 111 + ret = clk_enable(pcdev->pclk); 112 + else 113 + ret = clk_prepare_enable(pcdev->pclk); 115 114 /* Failure is probably fatal to the system, but... */ 116 115 if (ret) 117 116 return ret; ··· 122 115 123 116 return pm_generic_runtime_resume(dev); 124 117 } 125 - #endif 118 + #endif /* CONFIG_PM */ 126 119 127 120 static const struct dev_pm_ops amba_pm = { 128 121 .suspend = pm_generic_suspend,
+95 -4
drivers/dma/pl330.c
··· 27 27 #include <linux/of.h> 28 28 #include <linux/of_dma.h> 29 29 #include <linux/err.h> 30 + #include <linux/pm_runtime.h> 30 31 31 32 #include "dmaengine.h" 32 33 #define PL330_MAX_CHAN 8 ··· 265 264 /* The number of default descriptors */ 266 265 267 266 #define NR_DEFAULT_DESC 16 267 + 268 + /* Delay for runtime PM autosuspend, ms */ 269 + #define PL330_AUTOSUSPEND_DELAY 20 268 270 269 271 /* Populated by the PL330 core driver for DMA API driver's info */ 270 272 struct pl330_config { ··· 1962 1958 struct dma_pl330_chan *pch = (struct dma_pl330_chan *)data; 1963 1959 struct dma_pl330_desc *desc, *_dt; 1964 1960 unsigned long flags; 1961 + bool power_down = false; 1965 1962 1966 1963 spin_lock_irqsave(&pch->lock, flags); 1967 1964 ··· 1977 1972 /* Try to submit a req imm. next to the last completed cookie */ 1978 1973 fill_queue(pch); 1979 1974 1980 - /* Make sure the PL330 Channel thread is active */ 1981 - spin_lock(&pch->thread->dmac->lock); 1982 - _start(pch->thread); 1983 - spin_unlock(&pch->thread->dmac->lock); 1975 + if (list_empty(&pch->work_list)) { 1976 + spin_lock(&pch->thread->dmac->lock); 1977 + _stop(pch->thread); 1978 + spin_unlock(&pch->thread->dmac->lock); 1979 + power_down = true; 1980 + } else { 1981 + /* Make sure the PL330 Channel thread is active */ 1982 + spin_lock(&pch->thread->dmac->lock); 1983 + _start(pch->thread); 1984 + spin_unlock(&pch->thread->dmac->lock); 1985 + } 1984 1986 1985 1987 while (!list_empty(&pch->completed_list)) { 1986 1988 dma_async_tx_callback callback; ··· 2002 1990 if (pch->cyclic) { 2003 1991 desc->status = PREP; 2004 1992 list_move_tail(&desc->node, &pch->work_list); 1993 + if (power_down) { 1994 + spin_lock(&pch->thread->dmac->lock); 1995 + _start(pch->thread); 1996 + spin_unlock(&pch->thread->dmac->lock); 1997 + power_down = false; 1998 + } 2005 1999 } else { 2006 2000 desc->status = FREE; 2007 2001 list_move_tail(&desc->node, &pch->dmac->desc_pool); ··· 2022 2004 } 2023 2005 } 2024 2006 spin_unlock_irqrestore(&pch->lock, flags); 2007 + 2008 + /* If work list empty, power down */ 2009 + if (power_down) { 2010 + pm_runtime_mark_last_busy(pch->dmac->ddma.dev); 2011 + pm_runtime_put_autosuspend(pch->dmac->ddma.dev); 2012 + } 2025 2013 } 2026 2014 2027 2015 bool pl330_filter(struct dma_chan *chan, void *param) ··· 2097 2073 2098 2074 switch (cmd) { 2099 2075 case DMA_TERMINATE_ALL: 2076 + pm_runtime_get_sync(pl330->ddma.dev); 2100 2077 spin_lock_irqsave(&pch->lock, flags); 2101 2078 2102 2079 spin_lock(&pl330->lock); ··· 2124 2099 dma_cookie_complete(&desc->txd); 2125 2100 } 2126 2101 2102 + if (!list_empty(&pch->work_list)) 2103 + pm_runtime_put(pl330->ddma.dev); 2104 + 2127 2105 list_splice_tail_init(&pch->submitted_list, &pl330->desc_pool); 2128 2106 list_splice_tail_init(&pch->work_list, &pl330->desc_pool); 2129 2107 list_splice_tail_init(&pch->completed_list, &pl330->desc_pool); 2130 2108 spin_unlock_irqrestore(&pch->lock, flags); 2109 + pm_runtime_mark_last_busy(pl330->ddma.dev); 2110 + pm_runtime_put_autosuspend(pl330->ddma.dev); 2131 2111 break; 2132 2112 case DMA_SLAVE_CONFIG: 2133 2113 slave_config = (struct dma_slave_config *)arg; ··· 2168 2138 2169 2139 tasklet_kill(&pch->task); 2170 2140 2141 + pm_runtime_get_sync(pch->dmac->ddma.dev); 2171 2142 spin_lock_irqsave(&pch->lock, flags); 2172 2143 2173 2144 pl330_release_channel(pch->thread); ··· 2178 2147 list_splice_tail_init(&pch->work_list, &pch->dmac->desc_pool); 2179 2148 2180 2149 spin_unlock_irqrestore(&pch->lock, flags); 2150 + pm_runtime_mark_last_busy(pch->dmac->ddma.dev); 2151 + pm_runtime_put_autosuspend(pch->dmac->ddma.dev); 2181 2152 } 2182 2153 2183 2154 static enum dma_status ··· 2195 2162 unsigned long flags; 2196 2163 2197 2164 spin_lock_irqsave(&pch->lock, flags); 2165 + if (list_empty(&pch->work_list)) { 2166 + /* 2167 + * Warn on nothing pending. Empty submitted_list may 2168 + * break our pm_runtime usage counter as it is 2169 + * updated on work_list emptiness status. 2170 + */ 2171 + WARN_ON(list_empty(&pch->submitted_list)); 2172 + pm_runtime_get_sync(pch->dmac->ddma.dev); 2173 + } 2198 2174 list_splice_tail_init(&pch->submitted_list, &pch->work_list); 2199 2175 spin_unlock_irqrestore(&pch->lock, flags); 2200 2176 ··· 2627 2585 return 0; 2628 2586 } 2629 2587 2588 + /* 2589 + * Runtime PM callbacks are provided by amba/bus.c driver. 2590 + * 2591 + * It is assumed here that IRQ safe runtime PM is chosen in probe and amba 2592 + * bus driver will only disable/enable the clock in runtime PM callbacks. 2593 + */ 2594 + static int __maybe_unused pl330_suspend(struct device *dev) 2595 + { 2596 + struct amba_device *pcdev = to_amba_device(dev); 2597 + 2598 + pm_runtime_disable(dev); 2599 + 2600 + if (!pm_runtime_status_suspended(dev)) { 2601 + /* amba did not disable the clock */ 2602 + amba_pclk_disable(pcdev); 2603 + } 2604 + amba_pclk_unprepare(pcdev); 2605 + 2606 + return 0; 2607 + } 2608 + 2609 + static int __maybe_unused pl330_resume(struct device *dev) 2610 + { 2611 + struct amba_device *pcdev = to_amba_device(dev); 2612 + int ret; 2613 + 2614 + ret = amba_pclk_prepare(pcdev); 2615 + if (ret) 2616 + return ret; 2617 + 2618 + if (!pm_runtime_status_suspended(dev)) 2619 + ret = amba_pclk_enable(pcdev); 2620 + 2621 + pm_runtime_enable(dev); 2622 + 2623 + return ret; 2624 + } 2625 + 2626 + static SIMPLE_DEV_PM_OPS(pl330_pm, pl330_suspend, pl330_resume); 2627 + 2630 2628 static int 2631 2629 pl330_probe(struct amba_device *adev, const struct amba_id *id) 2632 2630 { ··· 2820 2738 pcfg->data_buf_dep, pcfg->data_bus_width / 8, pcfg->num_chan, 2821 2739 pcfg->num_peri, pcfg->num_events); 2822 2740 2741 + pm_runtime_irq_safe(&adev->dev); 2742 + pm_runtime_use_autosuspend(&adev->dev); 2743 + pm_runtime_set_autosuspend_delay(&adev->dev, PL330_AUTOSUSPEND_DELAY); 2744 + pm_runtime_mark_last_busy(&adev->dev); 2745 + pm_runtime_put_autosuspend(&adev->dev); 2746 + 2823 2747 return 0; 2824 2748 probe_err3: 2825 2749 /* Idle the DMAC */ ··· 2851 2763 { 2852 2764 struct pl330_dmac *pl330 = amba_get_drvdata(adev); 2853 2765 struct dma_pl330_chan *pch, *_p; 2766 + 2767 + pm_runtime_get_noresume(pl330->ddma.dev); 2854 2768 2855 2769 if (adev->dev.of_node) 2856 2770 of_dma_controller_free(adev->dev.of_node); ··· 2892 2802 .drv = { 2893 2803 .owner = THIS_MODULE, 2894 2804 .name = "dma-pl330", 2805 + .pm = &pl330_pm, 2895 2806 }, 2896 2807 .id_table = pl330_ids, 2897 2808 .probe = pl330_probe,
+1
drivers/pcmcia/sa1100_generic.c
··· 93 93 for (i = 0; i < sinfo->nskt; i++) 94 94 soc_pcmcia_remove_one(&sinfo->skt[i]); 95 95 96 + clk_put(sinfo->clk); 96 97 kfree(sinfo); 97 98 return 0; 98 99 }
+7
drivers/pcmcia/sa1111_generic.c
··· 145 145 return -ENOMEM; 146 146 147 147 s->soc.nr = ops->first + i; 148 + s->soc.clk = clk_get(&dev->dev, NULL); 149 + if (IS_ERR(s->soc.clk)) { 150 + ret = PTR_ERR(s->soc.clk); 151 + kfree(s); 152 + return ret; 153 + } 148 154 soc_pcmcia_init_one(&s->soc, ops, &dev->dev); 149 155 s->dev = dev; 150 156 if (s->soc.nr) { ··· 226 220 for (; s; s = next) { 227 221 next = s->next; 228 222 soc_pcmcia_remove_one(&s->soc); 223 + clk_put(s->soc.clk); 229 224 kfree(s); 230 225 } 231 226
+12 -2
drivers/pcmcia/sa11xx_base.c
··· 135 135 static int 136 136 sa1100_pcmcia_set_timing(struct soc_pcmcia_socket *skt) 137 137 { 138 - return sa1100_pcmcia_set_mecr(skt, cpufreq_get(0)); 138 + unsigned long clk = clk_get_rate(skt->clk); 139 + 140 + return sa1100_pcmcia_set_mecr(skt, clk / 1000); 139 141 } 140 142 141 143 static int 142 144 sa1100_pcmcia_show_timing(struct soc_pcmcia_socket *skt, char *buf) 143 145 { 144 146 struct soc_pcmcia_timing timing; 145 - unsigned int clock = cpufreq_get(0); 147 + unsigned int clock = clk_get_rate(skt->clk); 146 148 unsigned long mecr = MECR; 147 149 char *p = buf; 148 150 ··· 220 218 struct skt_dev_info *sinfo; 221 219 struct soc_pcmcia_socket *skt; 222 220 int i, ret = 0; 221 + struct clk *clk; 222 + 223 + clk = clk_get(dev, NULL); 224 + if (IS_ERR(clk)) 225 + return PTR_ERR(clk); 223 226 224 227 sa11xx_drv_pcmcia_ops(ops); 225 228 ··· 233 226 return -ENOMEM; 234 227 235 228 sinfo->nskt = nr; 229 + sinfo->clk = clk; 236 230 237 231 /* Initialize processor specific parameters */ 238 232 for (i = 0; i < nr; i++) { 239 233 skt = &sinfo->skt[i]; 240 234 241 235 skt->nr = first + i; 236 + skt->clk = clk; 242 237 soc_pcmcia_init_one(skt, ops, dev); 243 238 244 239 ret = sa11xx_drv_pcmcia_add_one(skt); ··· 251 242 if (ret) { 252 243 while (--i >= 0) 253 244 soc_pcmcia_remove_one(&sinfo->skt[i]); 245 + clk_put(clk); 254 246 kfree(sinfo); 255 247 } else { 256 248 dev_set_drvdata(dev, sinfo);
+4
drivers/pcmcia/soc_common.c
··· 120 120 121 121 if (skt->ops->hw_shutdown) 122 122 skt->ops->hw_shutdown(skt); 123 + 124 + clk_disable_unprepare(skt->clk); 123 125 } 124 126 125 127 static void soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) ··· 132 130 static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 133 131 { 134 132 int ret = 0, i; 133 + 134 + clk_prepare_enable(skt->clk); 135 135 136 136 if (skt->ops->hw_init) { 137 137 ret = skt->ops->hw_init(skt);
+23 -7
drivers/video/fbdev/sa1100fb.c
··· 178 178 #include <linux/dma-mapping.h> 179 179 #include <linux/mutex.h> 180 180 #include <linux/io.h> 181 + #include <linux/clk.h> 181 182 182 183 #include <video/sa1100fb.h> 183 184 ··· 417 416 var->transp.offset); 418 417 419 418 #ifdef CONFIG_CPU_FREQ 420 - dev_dbg(fbi->dev, "dma period = %d ps, clock = %d kHz\n", 419 + dev_dbg(fbi->dev, "dma period = %d ps, clock = %ld kHz\n", 421 420 sa1100fb_display_dma_period(var), 422 - cpufreq_get(smp_processor_id())); 421 + clk_get_rate(fbi->clk) / 1000); 423 422 #endif 424 423 425 424 return 0; ··· 593 592 * Calculate the PCD value from the clock rate (in picoseconds). 594 593 * We take account of the PPCR clock setting. 595 594 */ 596 - static inline unsigned int get_pcd(unsigned int pixclock, unsigned int cpuclock) 595 + static inline unsigned int get_pcd(struct sa1100fb_info *fbi, 596 + unsigned int pixclock) 597 597 { 598 - unsigned int pcd = cpuclock / 100; 598 + unsigned int pcd = clk_get_rate(fbi->clk) / 100 / 1000; 599 599 600 600 pcd *= pixclock; 601 601 pcd /= 10000000; ··· 675 673 LCCR2_BegFrmDel(var->upper_margin) + 676 674 LCCR2_EndFrmDel(var->lower_margin); 677 675 678 - pcd = get_pcd(var->pixclock, cpufreq_get(0)); 676 + pcd = get_pcd(fbi, var->pixclock); 679 677 new_regs.lccr3 = LCCR3_PixClkDiv(pcd) | fbi->inf->lccr3 | 680 678 (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | 681 679 (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); ··· 789 787 fbi->palette_cpu[0] &= 0xcfff; 790 788 fbi->palette_cpu[0] |= palette_pbs(&fbi->fb.var); 791 789 790 + /* enable LCD controller clock */ 791 + clk_prepare_enable(fbi->clk); 792 + 792 793 /* Sequence from 11.7.10 */ 793 794 writel_relaxed(fbi->reg_lccr3, fbi->base + LCCR3); 794 795 writel_relaxed(fbi->reg_lccr2, fbi->base + LCCR2); ··· 836 831 837 832 schedule_timeout(20 * HZ / 1000); 838 833 remove_wait_queue(&fbi->ctrlr_wait, &wait); 834 + 835 + /* disable LCD controller clock */ 836 + clk_disable_unprepare(fbi->clk); 839 837 } 840 838 841 839 /* ··· 1017 1009 void *data) 1018 1010 { 1019 1011 struct sa1100fb_info *fbi = TO_INF(nb, freq_transition); 1020 - struct cpufreq_freqs *f = data; 1021 1012 u_int pcd; 1022 1013 1023 1014 switch (val) { ··· 1025 1018 break; 1026 1019 1027 1020 case CPUFREQ_POSTCHANGE: 1028 - pcd = get_pcd(fbi->fb.var.pixclock, f->new); 1021 + pcd = get_pcd(fbi, fbi->fb.var.pixclock); 1029 1022 fbi->reg_lccr3 = (fbi->reg_lccr3 & ~0xff) | LCCR3_PixClkDiv(pcd); 1030 1023 set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE); 1031 1024 break; ··· 1232 1225 if (!fbi) 1233 1226 goto failed; 1234 1227 1228 + fbi->clk = clk_get(&pdev->dev, NULL); 1229 + if (IS_ERR(fbi->clk)) { 1230 + ret = PTR_ERR(fbi->clk); 1231 + fbi->clk = NULL; 1232 + goto failed; 1233 + } 1234 + 1235 1235 fbi->base = ioremap(res->start, resource_size(res)); 1236 1236 if (!fbi->base) 1237 1237 goto failed; ··· 1291 1277 failed: 1292 1278 if (fbi) 1293 1279 iounmap(fbi->base); 1280 + if (fbi->clk) 1281 + clk_put(fbi->clk); 1294 1282 kfree(fbi); 1295 1283 release_mem_region(res->start, resource_size(res)); 1296 1284 return ret;
+1
drivers/video/fbdev/sa1100fb.h
··· 68 68 #endif 69 69 70 70 const struct sa1100fb_mach_info *inf; 71 + struct clk *clk; 71 72 }; 72 73 73 74 #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member)
+10
include/linux/amba/bus.h
··· 97 97 #define amba_pclk_disable(d) \ 98 98 do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) 99 99 100 + static inline int amba_pclk_prepare(struct amba_device *dev) 101 + { 102 + return clk_prepare(dev->pclk); 103 + } 104 + 105 + static inline void amba_pclk_unprepare(struct amba_device *dev) 106 + { 107 + clk_unprepare(dev->pclk); 108 + } 109 + 100 110 /* Some drivers don't use the struct amba_device */ 101 111 #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) 102 112 #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f)
+6
include/linux/pm_runtime.h
··· 128 128 ACCESS_ONCE(dev->power.last_busy) = jiffies; 129 129 } 130 130 131 + static inline bool pm_runtime_is_irq_safe(struct device *dev) 132 + { 133 + return dev->power.irq_safe; 134 + } 135 + 131 136 #else /* !CONFIG_PM_RUNTIME */ 132 137 133 138 static inline int __pm_runtime_idle(struct device *dev, int rpmflags) ··· 172 167 173 168 static inline void pm_runtime_no_callbacks(struct device *dev) {} 174 169 static inline void pm_runtime_irq_safe(struct device *dev) {} 170 + static inline bool pm_runtime_is_irq_safe(struct device *dev) { return false; } 175 171 176 172 static inline bool pm_runtime_callbacks_present(struct device *dev) { return false; } 177 173 static inline void pm_runtime_mark_last_busy(struct device *dev) {}