~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/sgi-ip27/ip27-berr.c

Version: ~ [ linux-5.4-rc7 ] ~ [ linux-5.3.11 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.84 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.154 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.201 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.201 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.77 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * Copyright (C) 1994, 1995, 1996, 1999, 2000 by Ralf Baechle
  7  * Copyright (C) 1999, 2000 by Silicon Graphics
  8  * Copyright (C) 2002  Maciej W. Rozycki
  9  */
 10 #include <linux/init.h>
 11 #include <linux/kernel.h>
 12 #include <linux/module.h>
 13 #include <linux/signal.h>       /* for SIGBUS */
 14 #include <linux/sched.h>        /* schow_regs(), force_sig() */
 15 
 16 #include <asm/module.h>
 17 #include <asm/sn/addrs.h>
 18 #include <asm/sn/arch.h>
 19 #include <asm/sn/sn0/hub.h>
 20 #include <asm/tlbdebug.h>
 21 #include <asm/traps.h>
 22 #include <asm/uaccess.h>
 23 
 24 static void dump_hub_information(unsigned long errst0, unsigned long errst1)
 25 {
 26         static char *err_type[2][8] = {
 27                 { NULL, "Uncached Partial Read PRERR", "DERR", "Read Timeout",
 28                   NULL, NULL, NULL, NULL },
 29                 { "WERR", "Uncached Partial Write", "PWERR", "Write Timeout",
 30                   NULL, NULL, NULL, NULL }
 31         };
 32         int wrb = errst1 & PI_ERR_ST1_WRBRRB_MASK;
 33 
 34         if (!(errst0 & PI_ERR_ST0_VALID_MASK)) {
 35                 printk("Hub does not contain valid error information\n");
 36                 return;
 37         }
 38 
 39 
 40         printk("Hub has valid error information:\n");
 41         if (errst0 & PI_ERR_ST0_OVERRUN_MASK)
 42                 printk("Overrun is set.  Error stack may contain additional "
 43                        "information.\n");
 44         printk("Hub error address is %08lx\n",
 45                (errst0 & PI_ERR_ST0_ADDR_MASK) >> (PI_ERR_ST0_ADDR_SHFT - 3));
 46         printk("Incoming message command 0x%lx\n",
 47                (errst0 & PI_ERR_ST0_CMD_MASK) >> PI_ERR_ST0_CMD_SHFT);
 48         printk("Supplemental field of incoming message is 0x%lx\n",
 49                (errst0 & PI_ERR_ST0_SUPPL_MASK) >> PI_ERR_ST0_SUPPL_SHFT);
 50         printk("T5 Rn (for RRB only) is 0x%lx\n",
 51                (errst0 & PI_ERR_ST0_REQNUM_MASK) >> PI_ERR_ST0_REQNUM_SHFT);
 52         printk("Error type is %s\n", err_type[wrb]
 53                [(errst0 & PI_ERR_ST0_TYPE_MASK) >> PI_ERR_ST0_TYPE_SHFT]
 54                 ? : "invalid");
 55 }
 56 
 57 int ip27_be_handler(struct pt_regs *regs, int is_fixup)
 58 {
 59         unsigned long errst0, errst1;
 60         int data = regs->cp0_cause & 4;
 61         int cpu = LOCAL_HUB_L(PI_CPU_NUM);
 62 
 63         if (is_fixup)
 64                 return MIPS_BE_FIXUP;
 65 
 66         printk("Slice %c got %cbe at 0x%lx\n", 'A' + cpu, data ? 'd' : 'i',
 67                regs->cp0_epc);
 68         printk("Hub information:\n");
 69         printk("ERR_INT_PEND = 0x%06llx\n", LOCAL_HUB_L(PI_ERR_INT_PEND));
 70         errst0 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS0_B : PI_ERR_STATUS0_A);
 71         errst1 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS1_B : PI_ERR_STATUS1_A);
 72         dump_hub_information(errst0, errst1);
 73         show_regs(regs);
 74         dump_tlb_all();
 75         while(1);
 76         force_sig(SIGBUS, current);
 77 }
 78 
 79 void __init ip27_be_init(void)
 80 {
 81         /* XXX Initialize all the Hub & Bridge error handling here.  */
 82         int cpu = LOCAL_HUB_L(PI_CPU_NUM);
 83         int cpuoff = cpu << 8;
 84 
 85         board_be_handler = ip27_be_handler;
 86 
 87         LOCAL_HUB_S(PI_ERR_INT_PEND,
 88                     cpu ? PI_ERR_CLEAR_ALL_B : PI_ERR_CLEAR_ALL_A);
 89         LOCAL_HUB_S(PI_ERR_INT_MASK_A + cpuoff, 0);
 90         LOCAL_HUB_S(PI_ERR_STACK_ADDR_A + cpuoff, 0);
 91         LOCAL_HUB_S(PI_ERR_STACK_SIZE, 0);      /* Disable error stack */
 92         LOCAL_HUB_S(PI_SYSAD_ERRCHK_EN, PI_SYSAD_CHECK_ALL);
 93 }
 94 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp