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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6:
sparc: Support show_unhandled_signals.
sparc: use __ratelimit
sunxvr500: Additional PCI id for sunxvr500 driver
sparc: use asm-generic/scatterlist.h
sparc64: If 'slot-names' property exist, create sysfs PCI slot information.
sparc: remove trailing space in messages
sparc: remove redundant return statements

+176 -100
+1 -20
arch/sparc/include/asm/scatterlist.h
··· 1 1 #ifndef _SPARC_SCATTERLIST_H 2 2 #define _SPARC_SCATTERLIST_H 3 3 4 - #include <asm/page.h> 5 - #include <asm/types.h> 6 - 7 - struct scatterlist { 8 - #ifdef CONFIG_DEBUG_SG 9 - unsigned long sg_magic; 10 - #endif 11 - unsigned long page_link; 12 - unsigned int offset; 13 - 14 - unsigned int length; 15 - 16 - dma_addr_t dma_address; 17 - __u32 dma_length; 18 - }; 19 - 20 - #define sg_dma_address(sg) ((sg)->dma_address) 21 4 #define sg_dma_len(sg) ((sg)->dma_length) 22 5 23 - #define ISA_DMA_THRESHOLD (~0UL) 24 - 25 - #define ARCH_HAS_SG_CHAIN 6 + #include <asm-generic/scatterlist.h> 26 7 27 8 #endif /* !(_SPARC_SCATTERLIST_H) */
-2
arch/sparc/kernel/devices.c
··· 143 143 144 144 if (ARCH_SUN4C) 145 145 sun4c_probe_memerr_reg(); 146 - 147 - return; 148 146 }
+1 -1
arch/sparc/kernel/leon_kernel.c
··· 124 124 125 125 if (!(LEON3_BYPASS_LOAD_PA(&leon3_gptimer_regs->config) & 126 126 (1<<LEON3_GPTIMER_SEPIRQ))) { 127 - prom_printf("irq timer not configured with seperate irqs \n"); 127 + prom_printf("irq timer not configured with separate irqs\n"); 128 128 BUG(); 129 129 } 130 130
+2 -2
arch/sparc/kernel/leon_smp.c
··· 177 177 int nrcpu = leon_smp_nrcpus(); 178 178 int me = smp_processor_id(); 179 179 180 - printk(KERN_INFO "%d:(%d:%d) cpus mpirq at 0x%x \n", (unsigned int)me, 180 + printk(KERN_INFO "%d:(%d:%d) cpus mpirq at 0x%x\n", (unsigned int)me, 181 181 (unsigned int)nrcpu, (unsigned int)NR_CPUS, 182 182 (unsigned int)&(leon3_irqctrl_regs->mpstatus)); 183 183 ··· 226 226 break; 227 227 udelay(200); 228 228 } 229 - printk(KERN_INFO "Started CPU %d \n", (unsigned int)i); 229 + printk(KERN_INFO "Started CPU %d\n", (unsigned int)i); 230 230 231 231 if (!(cpu_callin_map[i])) { 232 232 printk(KERN_ERR "Processor %d is stuck.\n", i);
+75
arch/sparc/kernel/pci.c
··· 1095 1095 return 0; 1096 1096 } 1097 1097 subsys_initcall(pcibios_init); 1098 + 1099 + #ifdef CONFIG_SYSFS 1100 + static void __devinit pci_bus_slot_names(struct device_node *node, 1101 + struct pci_bus *bus) 1102 + { 1103 + const struct pci_slot_names { 1104 + u32 slot_mask; 1105 + char names[0]; 1106 + } *prop; 1107 + const char *sp; 1108 + int len, i; 1109 + u32 mask; 1110 + 1111 + prop = of_get_property(node, "slot-names", &len); 1112 + if (!prop) 1113 + return; 1114 + 1115 + mask = prop->slot_mask; 1116 + sp = prop->names; 1117 + 1118 + if (ofpci_verbose) 1119 + printk("PCI: Making slots for [%s] mask[0x%02x]\n", 1120 + node->full_name, mask); 1121 + 1122 + i = 0; 1123 + while (mask) { 1124 + struct pci_slot *pci_slot; 1125 + u32 this_bit = 1 << i; 1126 + 1127 + if (!(mask & this_bit)) { 1128 + i++; 1129 + continue; 1130 + } 1131 + 1132 + if (ofpci_verbose) 1133 + printk("PCI: Making slot [%s]\n", sp); 1134 + 1135 + pci_slot = pci_create_slot(bus, i, sp, NULL); 1136 + if (IS_ERR(pci_slot)) 1137 + printk(KERN_ERR "PCI: pci_create_slot returned %ld\n", 1138 + PTR_ERR(pci_slot)); 1139 + 1140 + sp += strlen(sp) + 1; 1141 + mask &= ~this_bit; 1142 + i++; 1143 + } 1144 + } 1145 + 1146 + static int __init of_pci_slot_init(void) 1147 + { 1148 + struct pci_bus *pbus = NULL; 1149 + 1150 + while ((pbus = pci_find_next_bus(pbus)) != NULL) { 1151 + struct device_node *node; 1152 + 1153 + if (pbus->self) { 1154 + struct dev_archdata *sd = pbus->self->sysdata; 1155 + 1156 + /* PCI->PCI bridge */ 1157 + node = sd->prom_node; 1158 + } else { 1159 + struct pci_pbm_info *pbm = pbus->sysdata; 1160 + 1161 + /* Host PCI controller */ 1162 + node = pbm->op->node; 1163 + } 1164 + 1165 + pci_bus_slot_names(node, pbus); 1166 + } 1167 + 1168 + return 0; 1169 + } 1170 + 1171 + module_init(of_pci_slot_init); 1172 + #endif
-2
arch/sparc/kernel/pcic.c
··· 585 585 writew(ivec, pcic->pcic_regs+PCI_INT_SELECT_LO); 586 586 } 587 587 } 588 - 589 - return; 590 588 } 591 589 592 590 /*
-2
arch/sparc/kernel/setup_32.c
··· 95 95 "nop\n\t" 96 96 "nop\n\t" : : "r" (prom_tbr)); 97 97 local_irq_restore(flags); 98 - 99 - return; 100 98 } 101 99 102 100 static unsigned int boot_flags __initdata = 0;
+1 -1
arch/sparc/kernel/sun4d_smp.c
··· 194 194 smp_penguin_ctable.reg_size = 0; 195 195 196 196 /* whirrr, whirrr, whirrrrrrrrr... */ 197 - SMP_PRINTK(("Starting CPU %d at %p \n", i, entry)); 197 + SMP_PRINTK(("Starting CPU %d at %p\n", i, entry)); 198 198 local_flush_cache_all(); 199 199 prom_startcpu(cpu_node, 200 200 &smp_penguin_ctable, 0, (char *)entry);
+3 -8
arch/sparc/kernel/unaligned_64.c
··· 21 21 #include <linux/smp.h> 22 22 #include <linux/bitops.h> 23 23 #include <linux/perf_event.h> 24 + #include <linux/ratelimit.h> 24 25 #include <asm/fpumacro.h> 25 26 26 27 enum direction { ··· 275 274 276 275 static void log_unaligned(struct pt_regs *regs) 277 276 { 278 - static unsigned long count, last_time; 277 + static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5); 279 278 280 - if (time_after(jiffies, last_time + 5 * HZ)) 281 - count = 0; 282 - if (count < 5) { 283 - last_time = jiffies; 284 - count++; 279 + if (__ratelimit(&ratelimit)) { 285 280 printk("Kernel unaligned access at TPC[%lx] %pS\n", 286 281 regs->tpc, (void *) regs->tpc); 287 282 } ··· 633 636 return; 634 637 } 635 638 advance(regs); 636 - return; 637 639 } 638 640 639 641 void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr) ··· 681 685 return; 682 686 } 683 687 advance(regs); 684 - return; 685 688 }
+60 -46
arch/sparc/mm/fault_32.c
··· 35 35 36 36 extern int prom_node_root; 37 37 38 + int show_unhandled_signals = 1; 39 + 38 40 /* At boot time we determine these two values necessary for setting 39 41 * up the segment maps and page table entries (pte's). 40 42 */ ··· 151 149 return 0; 152 150 } 153 151 152 + static inline void 153 + show_signal_msg(struct pt_regs *regs, int sig, int code, 154 + unsigned long address, struct task_struct *tsk) 155 + { 156 + if (!unhandled_signal(tsk, sig)) 157 + return; 158 + 159 + if (!printk_ratelimit()) 160 + return; 161 + 162 + printk("%s%s[%d]: segfault at %lx ip %p (rpc %p) sp %p error %x", 163 + task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, 164 + tsk->comm, task_pid_nr(tsk), address, 165 + (void *)regs->pc, (void *)regs->u_regs[UREG_I7], 166 + (void *)regs->u_regs[UREG_FP], code); 167 + 168 + print_vma_addr(KERN_CONT " in ", regs->pc); 169 + 170 + printk(KERN_CONT "\n"); 171 + } 172 + 173 + static void __do_fault_siginfo(int code, int sig, struct pt_regs *regs, 174 + unsigned long addr) 175 + { 176 + siginfo_t info; 177 + 178 + info.si_signo = sig; 179 + info.si_code = code; 180 + info.si_errno = 0; 181 + info.si_addr = (void __user *) addr; 182 + info.si_trapno = 0; 183 + 184 + if (unlikely(show_unhandled_signals)) 185 + show_signal_msg(regs, sig, info.si_code, 186 + addr, current); 187 + 188 + force_sig_info (sig, &info, current); 189 + } 190 + 154 191 extern unsigned long safe_compute_effective_address(struct pt_regs *, 155 192 unsigned int); 156 193 ··· 209 168 return safe_compute_effective_address(regs, insn); 210 169 } 211 170 171 + static noinline void do_fault_siginfo(int code, int sig, struct pt_regs *regs, 172 + int text_fault) 173 + { 174 + unsigned long addr = compute_si_addr(regs, text_fault); 175 + 176 + __do_fault_siginfo(code, sig, regs, addr); 177 + } 178 + 212 179 asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, 213 180 unsigned long address) 214 181 { ··· 225 176 struct mm_struct *mm = tsk->mm; 226 177 unsigned int fixup; 227 178 unsigned long g2; 228 - siginfo_t info; 229 179 int from_user = !(regs->psr & PSR_PS); 230 - int fault; 180 + int fault, code; 231 181 232 182 if(text_fault) 233 183 address = regs->pc; ··· 243 195 if (!ARCH_SUN4C && address >= TASK_SIZE) 244 196 goto vmalloc_fault; 245 197 246 - info.si_code = SEGV_MAPERR; 198 + code = SEGV_MAPERR; 247 199 248 200 /* 249 201 * If we're in an interrupt or have no user ··· 277 229 * we can handle it.. 278 230 */ 279 231 good_area: 280 - info.si_code = SEGV_ACCERR; 232 + code = SEGV_ACCERR; 281 233 if(write) { 282 234 if(!(vma->vm_flags & VM_WRITE)) 283 235 goto bad_area; ··· 321 273 322 274 bad_area_nosemaphore: 323 275 /* User mode accesses just cause a SIGSEGV */ 324 - if(from_user) { 325 - #if 0 326 - printk("Fault whee %s [%d]: segfaults at %08lx pc=%08lx\n", 327 - tsk->comm, tsk->pid, address, regs->pc); 328 - #endif 329 - info.si_signo = SIGSEGV; 330 - info.si_errno = 0; 331 - /* info.si_code set above to make clear whether 332 - this was a SEGV_MAPERR or SEGV_ACCERR fault. */ 333 - info.si_addr = (void __user *)compute_si_addr(regs, text_fault); 334 - info.si_trapno = 0; 335 - force_sig_info (SIGSEGV, &info, tsk); 276 + if (from_user) { 277 + do_fault_siginfo(code, SIGSEGV, regs, text_fault); 336 278 return; 337 279 } 338 280 ··· 373 335 374 336 do_sigbus: 375 337 up_read(&mm->mmap_sem); 376 - info.si_signo = SIGBUS; 377 - info.si_errno = 0; 378 - info.si_code = BUS_ADRERR; 379 - info.si_addr = (void __user *) compute_si_addr(regs, text_fault); 380 - info.si_trapno = 0; 381 - force_sig_info (SIGBUS, &info, tsk); 338 + do_fault_siginfo(BUS_ADRERR, SIGBUS, regs, text_fault); 382 339 if (!from_user) 383 340 goto no_context; 384 341 ··· 499 466 struct vm_area_struct *vma; 500 467 struct task_struct *tsk = current; 501 468 struct mm_struct *mm = tsk->mm; 502 - siginfo_t info; 469 + int code; 503 470 504 - info.si_code = SEGV_MAPERR; 471 + code = SEGV_MAPERR; 505 472 506 - #if 0 507 - printk("wf<pid=%d,wr=%d,addr=%08lx>\n", 508 - tsk->pid, write, address); 509 - #endif 510 473 down_read(&mm->mmap_sem); 511 474 vma = find_vma(mm, address); 512 475 if(!vma) ··· 514 485 if(expand_stack(vma, address)) 515 486 goto bad_area; 516 487 good_area: 517 - info.si_code = SEGV_ACCERR; 488 + code = SEGV_ACCERR; 518 489 if(write) { 519 490 if(!(vma->vm_flags & VM_WRITE)) 520 491 goto bad_area; ··· 531 502 return; 532 503 bad_area: 533 504 up_read(&mm->mmap_sem); 534 - #if 0 535 - printk("Window whee %s [%d]: segfaults at %08lx\n", 536 - tsk->comm, tsk->pid, address); 537 - #endif 538 - info.si_signo = SIGSEGV; 539 - info.si_errno = 0; 540 - /* info.si_code set above to make clear whether 541 - this was a SEGV_MAPERR or SEGV_ACCERR fault. */ 542 - info.si_addr = (void __user *) address; 543 - info.si_trapno = 0; 544 - force_sig_info (SIGSEGV, &info, tsk); 505 + __do_fault_siginfo(code, SIGSEGV, tsk->thread.kregs, address); 545 506 return; 546 507 547 508 do_sigbus: 548 509 up_read(&mm->mmap_sem); 549 - info.si_signo = SIGBUS; 550 - info.si_errno = 0; 551 - info.si_code = BUS_ADRERR; 552 - info.si_addr = (void __user *) address; 553 - info.si_trapno = 0; 554 - force_sig_info (SIGBUS, &info, tsk); 510 + __do_fault_siginfo(BUS_ADRERR, SIGBUS, tsk->thread.kregs, address); 555 511 } 556 512 557 513 void window_overflow_fault(void)
+31 -3
arch/sparc/mm/fault_64.c
··· 32 32 #include <asm/sections.h> 33 33 #include <asm/mmu_context.h> 34 34 35 + int show_unhandled_signals = 1; 36 + 35 37 static inline __kprobes int notify_page_fault(struct pt_regs *regs) 36 38 { 37 39 int ret = 0; ··· 130 128 return insn; 131 129 } 132 130 131 + static inline void 132 + show_signal_msg(struct pt_regs *regs, int sig, int code, 133 + unsigned long address, struct task_struct *tsk) 134 + { 135 + if (!unhandled_signal(tsk, sig)) 136 + return; 137 + 138 + if (!printk_ratelimit()) 139 + return; 140 + 141 + printk("%s%s[%d]: segfault at %lx ip %p (rpc %p) sp %p error %x", 142 + task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, 143 + tsk->comm, task_pid_nr(tsk), address, 144 + (void *)regs->tpc, (void *)regs->u_regs[UREG_I7], 145 + (void *)regs->u_regs[UREG_FP], code); 146 + 147 + print_vma_addr(KERN_CONT " in ", regs->tpc); 148 + 149 + printk(KERN_CONT "\n"); 150 + } 151 + 133 152 extern unsigned long compute_effective_address(struct pt_regs *, unsigned int, unsigned int); 134 153 135 154 static void do_fault_siginfo(int code, int sig, struct pt_regs *regs, 136 155 unsigned int insn, int fault_code) 137 156 { 157 + unsigned long addr; 138 158 siginfo_t info; 139 159 140 160 info.si_code = code; 141 161 info.si_signo = sig; 142 162 info.si_errno = 0; 143 163 if (fault_code & FAULT_CODE_ITLB) 144 - info.si_addr = (void __user *) regs->tpc; 164 + addr = regs->tpc; 145 165 else 146 - info.si_addr = (void __user *) 147 - compute_effective_address(regs, insn, 0); 166 + addr = compute_effective_address(regs, insn, 0); 167 + info.si_addr = (void __user *) addr; 148 168 info.si_trapno = 0; 169 + 170 + if (unlikely(show_unhandled_signals)) 171 + show_signal_msg(regs, sig, code, addr, current); 172 + 149 173 force_sig_info(sig, &info, current); 150 174 } 151 175
-1
arch/sparc/prom/console_32.c
··· 94 94 prom_putchar(char c) 95 95 { 96 96 while(prom_nbputchar(c) == -1) ; 97 - return; 98 97 }
-1
arch/sparc/prom/console_64.c
··· 62 62 prom_putchar(char c) 63 63 { 64 64 prom_nbputchar(c); 65 - return; 66 65 } 67 66 68 67 void
-1
arch/sparc/prom/devmap.c
··· 50 50 (*(romvec->pv_v2devops.v2_dumb_munmap))(vaddr, num_bytes); 51 51 restore_current(); 52 52 spin_unlock_irqrestore(&prom_lock, flags); 53 - return; 54 53 }
-2
arch/sparc/prom/devops_32.c
··· 84 84 }; 85 85 restore_current(); 86 86 spin_unlock_irqrestore(&prom_lock, flags); 87 - 88 - return; 89 87 }
-1
arch/sparc/prom/init_32.c
··· 75 75 romvec->pv_romvers, prom_rev); 76 76 77 77 /* Initialization successful. */ 78 - return; 79 78 }
-1
arch/sparc/prom/palloc.c
··· 40 40 { 41 41 if((prom_vers == PROM_V0) || (num_bytes == 0x0)) return; 42 42 (*(romvec->pv_v2devops.v2_dumb_mem_free))(vaddr, num_bytes); 43 - return; 44 43 }
-2
arch/sparc/prom/ranges.c
··· 87 87 88 88 if(num_obio_ranges) 89 89 prom_printf("PROMLIB: obio_ranges %d\n", num_obio_ranges); 90 - 91 - return; 92 90 } 93 91 94 92 void
-1
arch/sparc/prom/segment.c
··· 25 25 (*(romvec->pv_setctxt))(ctx, (char *) vaddr, segment); 26 26 restore_current(); 27 27 spin_unlock_irqrestore(&prom_lock, flags); 28 - return; 29 28 }
-1
arch/sparc/prom/tree_32.c
··· 173 173 len = prom_getproperty(node, prop, user_buf, ubuf_size); 174 174 if(len != -1) return; 175 175 user_buf[0] = 0; 176 - return; 177 176 } 178 177 EXPORT_SYMBOL(prom_getstring); 179 178
-1
arch/sparc/prom/tree_64.c
··· 154 154 len = prom_getproperty(node, prop, user_buf, ubuf_size); 155 155 if(len != -1) return; 156 156 user_buf[0] = 0; 157 - return; 158 157 } 159 158 EXPORT_SYMBOL(prom_getstring); 160 159
+1
drivers/video/sunxvr500.c
··· 400 400 401 401 static struct pci_device_id e3d_pci_table[] = { 402 402 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a0), }, 403 + { PCI_DEVICE(0x1091, 0x7a0), }, 403 404 { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a2), }, 404 405 { .vendor = PCI_VENDOR_ID_3DLABS, 405 406 .device = PCI_ANY_ID,
+1 -1
kernel/sysctl.c
··· 1441 1441 }; 1442 1442 1443 1443 static struct ctl_table debug_table[] = { 1444 - #if defined(CONFIG_X86) || defined(CONFIG_PPC) 1444 + #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) 1445 1445 { 1446 1446 .procname = "exception-trace", 1447 1447 .data = &show_unhandled_signals,