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

bf60x: Add double fault, hardware error and NMI SEC handler

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>

authored by

Sonic Zhang and committed by
Bob Liu
06051fde 2a26a205

+35 -1
+2
arch/blackfin/include/asm/traps.h
··· 125 125 level " for Supervisor use: Supervisor only registers, all MMRs, and Supervisor\n" \ 126 126 level " only instructions.\n" 127 127 128 + extern void double_fault_c(struct pt_regs *fp); 129 + 128 130 #endif /* __ASSEMBLY__ */ 129 131 #endif /* _BFIN_TRAPS_H */
+33 -1
arch/blackfin/mach-common/ints-priority.c
··· 26 26 #include <asm/gpio.h> 27 27 #include <asm/irq_handler.h> 28 28 #include <asm/dpmc.h> 29 + #include <asm/traps.h> 29 30 30 31 #ifndef SEC_GCTL 31 32 # define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1)) ··· 414 413 raw_spin_unlock(&desc->lock); 415 414 } 416 415 416 + void handle_core_fault(unsigned int irq, struct irq_desc *desc) 417 + { 418 + struct pt_regs *fp = get_irq_regs(); 419 + 420 + raw_spin_lock(&desc->lock); 421 + 422 + switch (irq) { 423 + case IRQ_C0_DBL_FAULT: 424 + double_fault_c(fp); 425 + break; 426 + case IRQ_C0_HW_ERR: 427 + dump_bfin_process(fp); 428 + dump_bfin_mem(fp); 429 + show_regs(fp); 430 + printk(KERN_NOTICE "Kernel Stack\n"); 431 + show_stack(current, NULL); 432 + print_modules(); 433 + panic("Kernel core hardware error"); 434 + break; 435 + case IRQ_C0_NMI_L1_PARITY_ERR: 436 + panic("NMI %d occurs unexpectedly"); 437 + break; 438 + default: 439 + panic("Core 1 fault %d occurs unexpectedly"); 440 + } 441 + 442 + raw_spin_unlock(&desc->lock); 443 + } 417 444 #endif 418 445 419 446 #ifdef CONFIG_SMP ··· 1551 1522 } else if (irq < BFIN_IRQ(0)) { 1552 1523 irq_set_chip_and_handler(irq, &bfin_internal_irqchip, 1553 1524 handle_simple_irq); 1554 - } else if (irq < CORE_IRQS && irq != IRQ_CGU_EVT) { 1525 + } else if (irq == IRQ_SEC_ERR) { 1555 1526 irq_set_chip_and_handler(irq, &bfin_sec_irqchip, 1556 1527 handle_sec_fault); 1528 + } else if (irq < CORE_IRQS && irq >= IRQ_C0_DBL_FAULT) { 1529 + irq_set_chip_and_handler(irq, &bfin_sec_irqchip, 1530 + handle_core_fault); 1557 1531 } else if (irq >= BFIN_IRQ(21) && irq <= BFIN_IRQ(26)) { 1558 1532 irq_set_chip(irq, &bfin_sec_irqchip); 1559 1533 irq_set_chained_handler(irq, bfin_demux_gpio_irq);