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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull sparc fixes from David Miller:
"Various sparc bug fixes, in particular:

1) TSB hashes have to be flushed before TLB on sparc64, from Dave
Kleikamp.

2) LEON timer interrupts can get stuck, from Andreas Larsson.

3) Sparc64 needs to handle lack of address-congruence devicetree
property, from Bob Picco"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
sparc: tsb must be flushed before tlb
sparc,leon: Convert to use devm_ioremap_resource
sparc64 address-congruence property
sparc32, leon: Enable interrupts before going idle to avoid getting stuck
sparc32, leon: Remove separate "ticker" timer for SMP
sparc: kernel: using strlcpy() instead of strcpy()
arch: sparc: prom: looping issue, need additional length check in the outside looping
sparc: remove inline marking of EXPORT_SYMBOL functions
sparc: Switch to asm-generic/linkage.h

+65 -74
+1
arch/sparc/include/asm/Kbuild
··· 6 6 generic-y += div64.h 7 7 generic-y += emergency-restart.h 8 8 generic-y += exec.h 9 + generic-y += linkage.h 9 10 generic-y += local64.h 10 11 generic-y += mutex.h 11 12 generic-y += irq_regs.h
+1 -1
arch/sparc/include/asm/leon.h
··· 135 135 136 136 #ifdef CONFIG_SMP 137 137 # define LEON3_IRQ_IPI_DEFAULT 13 138 - # define LEON3_IRQ_TICKER (leon3_ticker_irq) 138 + # define LEON3_IRQ_TICKER (leon3_gptimer_irq) 139 139 # define LEON3_IRQ_CROSS_CALL 15 140 140 #endif 141 141
+1
arch/sparc/include/asm/leon_amba.h
··· 47 47 #define LEON3_GPTIMER_LD 4 48 48 #define LEON3_GPTIMER_IRQEN 8 49 49 #define LEON3_GPTIMER_SEPIRQ 8 50 + #define LEON3_GPTIMER_TIMERS 0x7 50 51 51 52 #define LEON23_REG_TIMER_CONTROL_EN 0x00000001 /* 1 = enable counting */ 52 53 /* 0 = hold scalar and counter */
-6
arch/sparc/include/asm/linkage.h
··· 1 - #ifndef __ASM_LINKAGE_H 2 - #define __ASM_LINKAGE_H 3 - 4 - /* Nothing to see here... */ 5 - 6 - #endif
+2 -1
arch/sparc/kernel/ds.c
··· 843 843 unsigned long len; 844 844 845 845 strcpy(full_boot_str, "boot "); 846 - strcpy(full_boot_str + strlen("boot "), boot_command); 846 + strlcpy(full_boot_str + strlen("boot "), boot_command, 847 + sizeof(full_boot_str + strlen("boot "))); 847 848 len = strlen(full_boot_str); 848 849 849 850 if (reboot_data_supported) {
+24 -44
arch/sparc/kernel/leon_kernel.c
··· 38 38 39 39 unsigned long leon3_gptimer_irq; /* interrupt controller irq number */ 40 40 unsigned long leon3_gptimer_idx; /* Timer Index (0..6) within Timer Core */ 41 - int leon3_ticker_irq; /* Timer ticker IRQ */ 42 41 unsigned int sparc_leon_eirq; 43 42 #define LEON_IMASK(cpu) (&leon3_irqctrl_regs->mask[cpu]) 44 43 #define LEON_IACK (&leon3_irqctrl_regs->iclear) ··· 277 278 278 279 leon_clear_profile_irq(cpu); 279 280 281 + if (cpu == boot_cpu_id) 282 + timer_interrupt(irq, NULL); 283 + 280 284 ce = &per_cpu(sparc32_clockevent, cpu); 281 285 282 286 irq_enter(); ··· 301 299 int icsel; 302 300 int ampopts; 303 301 int err; 302 + u32 config; 304 303 305 304 sparc_config.get_cycles_offset = leon_cycles_offset; 306 305 sparc_config.cs_period = 1000000 / HZ; ··· 380 377 LEON3_BYPASS_STORE_PA( 381 378 &leon3_gptimer_regs->e[leon3_gptimer_idx].ctrl, 0); 382 379 383 - #ifdef CONFIG_SMP 384 - leon3_ticker_irq = leon3_gptimer_irq + 1 + leon3_gptimer_idx; 385 - 386 - if (!(LEON3_BYPASS_LOAD_PA(&leon3_gptimer_regs->config) & 387 - (1<<LEON3_GPTIMER_SEPIRQ))) { 388 - printk(KERN_ERR "timer not configured with separate irqs\n"); 389 - BUG(); 390 - } 391 - 392 - LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[leon3_gptimer_idx+1].val, 393 - 0); 394 - LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[leon3_gptimer_idx+1].rld, 395 - (((1000000/HZ) - 1))); 396 - LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[leon3_gptimer_idx+1].ctrl, 397 - 0); 398 - #endif 399 - 400 380 /* 401 381 * The IRQ controller may (if implemented) consist of multiple 402 382 * IRQ controllers, each mapped on a 4Kb boundary. ··· 402 416 if (eirq != 0) 403 417 leon_eirq_setup(eirq); 404 418 405 - irq = _leon_build_device_irq(NULL, leon3_gptimer_irq+leon3_gptimer_idx); 406 - err = request_irq(irq, timer_interrupt, IRQF_TIMER, "timer", NULL); 407 - if (err) { 408 - printk(KERN_ERR "unable to attach timer IRQ%d\n", irq); 409 - prom_halt(); 410 - } 411 - 412 419 #ifdef CONFIG_SMP 413 420 { 414 421 unsigned long flags; ··· 418 439 } 419 440 #endif 420 441 442 + config = LEON3_BYPASS_LOAD_PA(&leon3_gptimer_regs->config); 443 + if (config & (1 << LEON3_GPTIMER_SEPIRQ)) 444 + leon3_gptimer_irq += leon3_gptimer_idx; 445 + else if ((config & LEON3_GPTIMER_TIMERS) > 1) 446 + pr_warn("GPTIMER uses shared irqs, using other timers of the same core will fail.\n"); 447 + 448 + #ifdef CONFIG_SMP 449 + /* Install per-cpu IRQ handler for broadcasted ticker */ 450 + irq = leon_build_device_irq(leon3_gptimer_irq, handle_percpu_irq, 451 + "per-cpu", 0); 452 + err = request_irq(irq, leon_percpu_timer_ce_interrupt, 453 + IRQF_PERCPU | IRQF_TIMER, "timer", NULL); 454 + #else 455 + irq = _leon_build_device_irq(NULL, leon3_gptimer_irq); 456 + err = request_irq(irq, timer_interrupt, IRQF_TIMER, "timer", NULL); 457 + #endif 458 + if (err) { 459 + pr_err("Unable to attach timer IRQ%d\n", irq); 460 + prom_halt(); 461 + } 421 462 LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[leon3_gptimer_idx].ctrl, 422 463 LEON3_GPTIMER_EN | 423 464 LEON3_GPTIMER_RL | 424 465 LEON3_GPTIMER_LD | 425 466 LEON3_GPTIMER_IRQEN); 426 - 427 - #ifdef CONFIG_SMP 428 - /* Install per-cpu IRQ handler for broadcasted ticker */ 429 - irq = leon_build_device_irq(leon3_ticker_irq, handle_percpu_irq, 430 - "per-cpu", 0); 431 - err = request_irq(irq, leon_percpu_timer_ce_interrupt, 432 - IRQF_PERCPU | IRQF_TIMER, "ticker", 433 - NULL); 434 - if (err) { 435 - printk(KERN_ERR "unable to attach ticker IRQ%d\n", irq); 436 - prom_halt(); 437 - } 438 - 439 - LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[leon3_gptimer_idx+1].ctrl, 440 - LEON3_GPTIMER_EN | 441 - LEON3_GPTIMER_RL | 442 - LEON3_GPTIMER_LD | 443 - LEON3_GPTIMER_IRQEN); 444 - #endif 445 467 return; 446 468 bad: 447 469 printk(KERN_ERR "No Timer/irqctrl found\n");
+3 -5
arch/sparc/kernel/leon_pci_grpci1.c
··· 536 536 537 537 /* find device register base address */ 538 538 res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); 539 - regs = devm_request_and_ioremap(&ofdev->dev, res); 540 - if (!regs) { 541 - dev_err(&ofdev->dev, "io-regs mapping failed\n"); 542 - return -EADDRNOTAVAIL; 543 - } 539 + regs = devm_ioremap_resource(&ofdev->dev, res); 540 + if (IS_ERR(regs)) 541 + return PTR_ERR(regs); 544 542 545 543 /* 546 544 * check that we're in Host Slot and that we can act as a Host Bridge
+7
arch/sparc/kernel/leon_pmc.c
··· 47 47 * MMU does not get a TLB miss here by using the MMU BYPASS ASI. 48 48 */ 49 49 register unsigned int address = (unsigned int)leon3_irqctrl_regs; 50 + 51 + /* Interrupts need to be enabled to not hang the CPU */ 52 + local_irq_enable(); 53 + 50 54 __asm__ __volatile__ ( 51 55 "wr %%g0, %%asr19\n" 52 56 "lda [%0] %1, %%g0\n" ··· 64 60 */ 65 61 void pmc_leon_idle(void) 66 62 { 63 + /* Interrupts need to be enabled to not hang the CPU */ 64 + local_irq_enable(); 65 + 67 66 /* For systems without power-down, this will be no-op */ 68 67 __asm__ __volatile__ ("wr %g0, %asr19\n\t"); 69 68 }
+1 -1
arch/sparc/kernel/setup_32.c
··· 304 304 305 305 /* Initialize PROM console and command line. */ 306 306 *cmdline_p = prom_getbootargs(); 307 - strcpy(boot_command_line, *cmdline_p); 307 + strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE); 308 308 parse_early_param(); 309 309 310 310 boot_flags_init(*cmdline_p);
+1 -1
arch/sparc/kernel/setup_64.c
··· 555 555 { 556 556 /* Initialize PROM console and command line. */ 557 557 *cmdline_p = prom_getbootargs(); 558 - strcpy(boot_command_line, *cmdline_p); 558 + strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE); 559 559 parse_early_param(); 560 560 561 561 boot_flags_init(*cmdline_p);
+8 -1
arch/sparc/mm/init_64.c
··· 1098 1098 m->size = *val; 1099 1099 val = mdesc_get_property(md, node, 1100 1100 "address-congruence-offset", NULL); 1101 - m->offset = *val; 1101 + 1102 + /* The address-congruence-offset property is optional. 1103 + * Explicity zero it be identifty this. 1104 + */ 1105 + if (val) 1106 + m->offset = *val; 1107 + else 1108 + m->offset = 0UL; 1102 1109 1103 1110 numadbg("MBLOCK[%d]: base[%llx] size[%llx] offset[%llx]\n", 1104 1111 count - 1, m->base, m->size, m->offset);
+1 -1
arch/sparc/mm/tlb.c
··· 85 85 } 86 86 87 87 if (!tb->active) { 88 - global_flush_tlb_page(mm, vaddr); 89 88 flush_tsb_user_page(mm, vaddr); 89 + global_flush_tlb_page(mm, vaddr); 90 90 goto out; 91 91 } 92 92
+7 -5
arch/sparc/prom/bootstr_32.c
··· 23 23 return barg_buf; 24 24 } 25 25 26 - switch(prom_vers) { 26 + switch (prom_vers) { 27 27 case PROM_V0: 28 28 cp = barg_buf; 29 29 /* Start from 1 and go over fd(0,0,0)kernel */ 30 - for(iter = 1; iter < 8; iter++) { 30 + for (iter = 1; iter < 8; iter++) { 31 31 arg = (*(romvec->pv_v0bootargs))->argv[iter]; 32 32 if (arg == NULL) 33 33 break; 34 - while(*arg != 0) { 34 + while (*arg != 0) { 35 35 /* Leave place for space and null. */ 36 - if(cp >= barg_buf + BARG_LEN-2){ 36 + if (cp >= barg_buf + BARG_LEN - 2) 37 37 /* We might issue a warning here. */ 38 38 break; 39 - } 40 39 *cp++ = *arg++; 41 40 } 42 41 *cp++ = ' '; 42 + if (cp >= barg_buf + BARG_LEN - 1) 43 + /* We might issue a warning here. */ 44 + break; 43 45 } 44 46 *cp = 0; 45 47 break;
+8 -8
arch/sparc/prom/tree_64.c
··· 39 39 return prom_node_to_node("child", node); 40 40 } 41 41 42 - inline phandle prom_getchild(phandle node) 42 + phandle prom_getchild(phandle node) 43 43 { 44 44 phandle cnode; 45 45 ··· 72 72 return prom_node_to_node(prom_peer_name, node); 73 73 } 74 74 75 - inline phandle prom_getsibling(phandle node) 75 + phandle prom_getsibling(phandle node) 76 76 { 77 77 phandle sibnode; 78 78 ··· 89 89 /* Return the length in bytes of property 'prop' at node 'node'. 90 90 * Return -1 on error. 91 91 */ 92 - inline int prom_getproplen(phandle node, const char *prop) 92 + int prom_getproplen(phandle node, const char *prop) 93 93 { 94 94 unsigned long args[6]; 95 95 ··· 113 113 * 'buffer' which has a size of 'bufsize'. If the acquisition 114 114 * was successful the length will be returned, else -1 is returned. 115 115 */ 116 - inline int prom_getproperty(phandle node, const char *prop, 117 - char *buffer, int bufsize) 116 + int prom_getproperty(phandle node, const char *prop, 117 + char *buffer, int bufsize) 118 118 { 119 119 unsigned long args[8]; 120 120 int plen; ··· 141 141 /* Acquire an integer property and return its value. Returns -1 142 142 * on failure. 143 143 */ 144 - inline int prom_getint(phandle node, const char *prop) 144 + int prom_getint(phandle node, const char *prop) 145 145 { 146 146 int intprop; 147 147 ··· 235 235 /* Return the first property type for node 'node'. 236 236 * buffer should be at least 32B in length 237 237 */ 238 - inline char *prom_firstprop(phandle node, char *buffer) 238 + char *prom_firstprop(phandle node, char *buffer) 239 239 { 240 240 unsigned long args[7]; 241 241 ··· 261 261 * at node 'node' . Returns NULL string if no more 262 262 * property types for this node. 263 263 */ 264 - inline char *prom_nextprop(phandle node, const char *oprop, char *buffer) 264 + char *prom_nextprop(phandle node, const char *oprop, char *buffer) 265 265 { 266 266 unsigned long args[7]; 267 267 char buf[32];