synchronousMemoryDatabase.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. /*
  2. * linux/arch/alpha/kernel/err_titan.c
  3. *
  4. * Copyright (C) 2000 Jeff Wiedemeier (Compaq Computer Corporation)
  5. *
  6. * Error handling code supporting TITAN systems
  7. */
  8. #include <linux/init.h>
  9. #include <linux/pci.h>
  10. #include <linux/sched.h>
  11. #include <asm/io.h>
  12. #include <asm/core_titan.h>
  13. #include <asm/hwrpb.h>
  14. #include <asm/smp.h>
  15. #include <asm/err_common.h>
  16. #include <asm/err_ev6.h>
  17. #include <asm/irq_regs.h>
  18. #include "err_impl.h"
  19. #include "proto.h"
  20. static int
  21. titan_parse_c_misc(u64 c_misc, int print)
  22. {
  23. #ifdef CONFIG_VERBOSE_MCHECK
  24. char *src;
  25. int nxs = 0;
  26. #endif
  27. int status = MCHK_DISPOSITION_REPORT;
  28. #define TITAN__CCHIP_MISC__NXM (1UL << 28)
  29. #define TITAN__CCHIP_MISC__NXS__S (29)
  30. #define TITAN__CCHIP_MISC__NXS__M (0x7)
  31. if (!(c_misc & TITAN__CCHIP_MISC__NXM))
  32. return MCHK_DISPOSITION_UNKNOWN_ERROR;
  33. #ifdef CONFIG_VERBOSE_MCHECK
  34. if (!print)
  35. return status;
  36. nxs = EXTRACT(c_misc, TITAN__CCHIP_MISC__NXS);
  37. switch(nxs) {
  38. case 0: /* CPU 0 */
  39. case 1: /* CPU 1 */
  40. case 2: /* CPU 2 */
  41. case 3: /* CPU 3 */
  42. src = "CPU";
  43. /* num is already the CPU number */
  44. break;
  45. case 4: /* Pchip 0 */
  46. case 5: /* Pchip 1 */
  47. src = "Pchip";
  48. nxs -= 4;
  49. break;
  50. default:/* reserved */
  51. src = "Unknown, NXS =";
  52. /* leave num untouched */
  53. break;
  54. }
  55. printk("%s Non-existent memory access from: %s %d\n",
  56. err_print_prefix, src, nxs);
  57. #endif /* CONFIG_VERBOSE_MCHECK */
  58. return status;
  59. }
  60. static int
  61. titan_parse_p_serror(int which, u64 serror, int print)
  62. {
  63. int status = MCHK_DISPOSITION_REPORT;
  64. #ifdef CONFIG_VERBOSE_MCHECK
  65. static const char * const serror_src[] = {
  66. "GPCI", "APCI", "AGP HP", "AGP LP"
  67. };
  68. static const char * const serror_cmd[] = {
  69. "DMA Read", "DMA RMW", "SGTE Read", "Reserved"
  70. };
  71. #endif /* CONFIG_VERBOSE_MCHECK */
  72. #define TITAN__PCHIP_SERROR__LOST_UECC (1UL << 0)
  73. #define TITAN__PCHIP_SERROR__UECC (1UL << 1)
  74. #define TITAN__PCHIP_SERROR__CRE (1UL << 2)
  75. #define TITAN__PCHIP_SERROR__NXIO (1UL << 3)
  76. #define TITAN__PCHIP_SERROR__LOST_CRE (1UL << 4)
  77. #define TITAN__PCHIP_SERROR__ECCMASK (TITAN__PCHIP_SERROR__UECC | \
  78. TITAN__PCHIP_SERROR__CRE)
  79. #define TITAN__PCHIP_SERROR__ERRMASK (TITAN__PCHIP_SERROR__LOST_UECC | \
  80. TITAN__PCHIP_SERROR__UECC | \
  81. TITAN__PCHIP_SERROR__CRE | \
  82. TITAN__PCHIP_SERROR__NXIO | \
  83. TITAN__PCHIP_SERROR__LOST_CRE)
  84. #define TITAN__PCHIP_SERROR__SRC__S (52)
  85. #define TITAN__PCHIP_SERROR__SRC__M (0x3)
  86. #define TITAN__PCHIP_SERROR__CMD__S (54)
  87. #define TITAN__PCHIP_SERROR__CMD__M (0x3)
  88. #define TITAN__PCHIP_SERROR__SYN__S (56)
  89. #define TITAN__PCHIP_SERROR__SYN__M (0xff)
  90. #define TITAN__PCHIP_SERROR__ADDR__S (15)
  91. #define TITAN__PCHIP_SERROR__ADDR__M (0xffffffffUL)
  92. if (!(serror & TITAN__PCHIP_SERROR__ERRMASK))
  93. return MCHK_DISPOSITION_UNKNOWN_ERROR;
  94. #ifdef CONFIG_VERBOSE_MCHECK
  95. if (!print)
  96. return status;
  97. printk("%s PChip %d SERROR: %016llx\n",
  98. err_print_prefix, which, serror);
  99. if (serror & TITAN__PCHIP_SERROR__ECCMASK) {
  100. printk("%s %sorrectable ECC Error:\n"
  101. " Source: %-6s Command: %-8s Syndrome: 0x%08x\n"
  102. " Address: 0x%llx\n",
  103. err_print_prefix,
  104. (serror & TITAN__PCHIP_SERROR__UECC) ? "Unc" : "C",
  105. serror_src[EXTRACT(serror, TITAN__PCHIP_SERROR__SRC)],
  106. serror_cmd[EXTRACT(serror, TITAN__PCHIP_SERROR__CMD)],
  107. (unsigned)EXTRACT(serror, TITAN__PCHIP_SERROR__SYN),
  108. EXTRACT(serror, TITAN__PCHIP_SERROR__ADDR));
  109. }
  110. if (serror & TITAN__PCHIP_SERROR__NXIO)
  111. printk("%s Non Existent I/O Error\n", err_print_prefix);
  112. if (serror & TITAN__PCHIP_SERROR__LOST_UECC)
  113. printk("%s Lost Uncorrectable ECC Error\n",
  114. err_print_prefix);
  115. if (serror & TITAN__PCHIP_SERROR__LOST_CRE)
  116. printk("%s Lost Correctable ECC Error\n", err_print_prefix);
  117. #endif /* CONFIG_VERBOSE_MCHECK */
  118. return status;
  119. }
  120. static int
  121. titan_parse_p_perror(int which, int port, u64 perror, int print)
  122. {
  123. int cmd;
  124. unsigned long addr;
  125. int status = MCHK_DISPOSITION_REPORT;
  126. #ifdef CONFIG_VERBOSE_MCHECK
  127. static const char * const perror_cmd[] = {
  128. "Interrupt Acknowledge", "Special Cycle",
  129. "I/O Read", "I/O Write",
  130. "Reserved", "Reserved",
  131. "Memory Read", "Memory Write",
  132. "Reserved", "Reserved",
  133. "Configuration Read", "Configuration Write",
  134. "Memory Read Multiple", "Dual Address Cycle",
  135. "Memory Read Line", "Memory Write and Invalidate"
  136. };
  137. #endif /* CONFIG_VERBOSE_MCHECK */
  138. #define TITAN__PCHIP_PERROR__LOST (1UL << 0)
  139. #define TITAN__PCHIP_PERROR__SERR (1UL << 1)
  140. #define TITAN__PCHIP_PERROR__PERR (1UL << 2)
  141. #define TITAN__PCHIP_PERROR__DCRTO (1UL << 3)
  142. #define TITAN__PCHIP_PERROR__SGE (1UL << 4)
  143. #define TITAN__PCHIP_PERROR__APE (1UL << 5)
  144. #define TITAN__PCHIP_PERROR__TA (1UL << 6)
  145. #define TITAN__PCHIP_PERROR__DPE (1UL << 7)
  146. #define TITAN__PCHIP_PERROR__NDS (1UL << 8)
  147. #define TITAN__PCHIP_PERROR__IPTPR (1UL << 9)
  148. #define TITAN__PCHIP_PERROR__IPTPW (1UL << 10)
  149. #define TITAN__PCHIP_PERROR__ERRMASK (TITAN__PCHIP_PERROR__LOST | \
  150. TITAN__PCHIP_PERROR__SERR | \
  151. TITAN__PCHIP_PERROR__PERR | \
  152. TITAN__PCHIP_PERROR__DCRTO | \
  153. TITAN__PCHIP_PERROR__SGE | \
  154. TITAN__PCHIP_PERROR__APE | \
  155. TITAN__PCHIP_PERROR__TA | \
  156. TITAN__PCHIP_PERROR__DPE | \
  157. TITAN__PCHIP_PERROR__NDS | \
  158. TITAN__PCHIP_PERROR__IPTPR | \
  159. TITAN__PCHIP_PERROR__IPTPW)
  160. #define TITAN__PCHIP_PERROR__DAC (1UL << 47)
  161. #define TITAN__PCHIP_PERROR__MWIN (1UL << 48)
  162. #define TITAN__PCHIP_PERROR__CMD__S (52)
  163. #define TITAN__PCHIP_PERROR__CMD__M (0x0f)
  164. #define TITAN__PCHIP_PERROR__ADDR__S (14)
  165. #define TITAN__PCHIP_PERROR__ADDR__M (0x1fffffffful)
  166. if (!(perror & TITAN__PCHIP_PERROR__ERRMASK))
  167. return MCHK_DISPOSITION_UNKNOWN_ERROR;
  168. cmd = EXTRACT(perror, TITAN__PCHIP_PERROR__CMD);
  169. addr = EXTRACT(perror, TITAN__PCHIP_PERROR__ADDR) << 2;
  170. /*
  171. * Initializing the BIOS on a video card on a bus without
  172. * a south bridge (subtractive decode agent) can result in
  173. * master aborts as the BIOS probes the capabilities of the
  174. * card. XFree86 does such initialization. If the error
  175. * is a master abort (No DevSel as PCI Master) and the command
  176. * is an I/O read or write below the address where we start
  177. * assigning PCI I/O spaces (SRM uses 0x1000), then mark the
  178. * error as dismissable so starting XFree86 doesn't result
  179. * in a series of uncorrectable errors being reported. Also
  180. * dismiss master aborts to VGA frame buffer space
  181. * (0xA0000 - 0xC0000) and legacy BIOS space (0xC0000 - 0x100000)
  182. * for the same reason.
  183. *
  184. * Also mark the error dismissible if it looks like the right
  185. * error but only the Lost bit is set. Since the BIOS initialization
  186. * can cause multiple master aborts and the error interrupt can
  187. * be handled on a different CPU than the BIOS code is run on,
  188. * it is possible for a second master abort to occur between the
  189. * time the PALcode reads PERROR and the time it writes PERROR
  190. * to acknowledge the error. If this timing happens, a second
  191. * error will be signalled after the first, and if no additional
  192. * errors occur, will look like a Lost error with no additional
  193. * errors on the same transaction as the previous error.
  194. */
  195. if (((perror & TITAN__PCHIP_PERROR__NDS) ||
  196. ((perror & TITAN__PCHIP_PERROR__ERRMASK) ==
  197. TITAN__PCHIP_PERROR__LOST)) &&
  198. ((((cmd & 0xE) == 2) && (addr < 0x1000)) ||
  199. (((cmd & 0xE) == 6) && (addr >= 0xA0000) && (addr < 0x100000)))) {
  200. status = MCHK_DISPOSITION_DISMISS;
  201. }
  202. #ifdef CONFIG_VERBOSE_MCHECK
  203. if (!print)
  204. return status;
  205. printk("%s PChip %d %cPERROR: %016llx\n",
  206. err_print_prefix, which,
  207. port ? 'A' : 'G', perror);
  208. if (perror & TITAN__PCHIP_PERROR__IPTPW)
  209. printk("%s Invalid Peer-to-Peer Write\n", err_print_prefix);
  210. if (perror & TITAN__PCHIP_PERROR__IPTPR)
  211. printk("%s Invalid Peer-to-Peer Read\n", err_print_prefix);
  212. if (perror & TITAN__PCHIP_PERROR__NDS)
  213. printk("%s No DEVSEL as PCI Master [Master Abort]\n",
  214. err_print_prefix);
  215. if (perror & TITAN__PCHIP_PERROR__DPE)
  216. printk("%s Data Parity Error\n", err_print_prefix);
  217. if (perror & TITAN__PCHIP_PERROR__TA)
  218. printk("%s Target Abort\n", err_print_prefix);
  219. if (perror & TITAN__PCHIP_PERROR__APE)
  220. printk("%s Address Parity Error\n", err_print_prefix);
  221. if (perror & TITAN__PCHIP_PERROR__SGE)
  222. printk("%s Scatter-Gather Error, Invalid PTE\n",
  223. err_print_prefix);
  224. if (perror & TITAN__PCHIP_PERROR__DCRTO)
  225. printk("%s Delayed-Completion Retry Timeout\n",
  226. err_print_prefix);
  227. if (perror & TITAN__PCHIP_PERROR__PERR)
  228. printk("%s PERR Asserted\n", err_print_prefix);
  229. if (perror & TITAN__PCHIP_PERROR__SERR)
  230. printk("%s SERR Asserted\n", err_print_prefix);
  231. if (perror & TITAN__PCHIP_PERROR__LOST)
  232. printk("%s Lost Error\n", err_print_prefix);
  233. printk("%s Command: 0x%x - %s\n"
  234. " Address: 0x%lx\n",
  235. err_print_prefix,
  236. cmd, perror_cmd[cmd],
  237. addr);
  238. if (perror & TITAN__PCHIP_PERROR__DAC)
  239. printk("%s Dual Address Cycle\n", err_print_prefix);
  240. if (perror & TITAN__PCHIP_PERROR__MWIN)
  241. printk("%s Hit in Monster Window\n", err_print_prefix);
  242. #endif /* CONFIG_VERBOSE_MCHECK */
  243. return status;
  244. }
  245. static int
  246. titan_parse_p_agperror(int which, u64 agperror, int print)
  247. {
  248. int status = MCHK_DISPOSITION_REPORT;
  249. #ifdef CONFIG_VERBOSE_MCHECK
  250. int cmd, len;
  251. unsigned long addr;
  252. static const char * const agperror_cmd[] = {
  253. "Read (low-priority)", "Read (high-priority)",
  254. "Write (low-priority)", "Write (high-priority)",
  255. "Reserved", "Reserved",
  256. "Flush", "Fence"
  257. };
  258. #endif /* CONFIG_VERBOSE_MCHECK */
  259. #define TITAN__PCHIP_AGPERROR__LOST (1UL << 0)
  260. #define TITAN__PCHIP_AGPERROR__LPQFULL (1UL << 1)
  261. #define TITAN__PCHIP_AGPERROR__HPQFULL (1UL << 2)
  262. #define TITAN__PCHIP_AGPERROR__RESCMD (1UL << 3)
  263. #define TITAN__PCHIP_AGPERROR__IPTE (1UL << 4)
  264. #define TITAN__PCHIP_AGPERROR__PTP (1UL << 5)
  265. #define TITAN__PCHIP_AGPERROR__NOWINDOW (1UL << 6)
  266. #define TITAN__PCHIP_AGPERROR__ERRMASK (TITAN__PCHIP_AGPERROR__LOST | \
  267. TITAN__PCHIP_AGPERROR__LPQFULL | \
  268. TITAN__PCHIP_AGPERROR__HPQFULL | \
  269. TITAN__PCHIP_AGPERROR__RESCMD | \
  270. TITAN__PCHIP_AGPERROR__IPTE | \
  271. TITAN__PCHIP_AGPERROR__PTP | \
  272. TITAN__PCHIP_AGPERROR__NOWINDOW)
  273. #define TITAN__PCHIP_AGPERROR__DAC (1UL << 48)
  274. #define TITAN__PCHIP_AGPERROR__MWIN (1UL << 49)
  275. #define TITAN__PCHIP_AGPERROR__FENCE (1UL << 59)
  276. #define TITAN__PCHIP_AGPERROR__CMD__S (50)
  277. #define TITAN__PCHIP_AGPERROR__CMD__M (0x07)
  278. #define TITAN__PCHIP_AGPERROR__ADDR__S (15)
  279. #define TITAN__PCHIP_AGPERROR__ADDR__M (0xffffffffUL)
  280. #define TITAN__PCHIP_AGPERROR__LEN__S (53)
  281. #define TITAN__PCHIP_AGPERROR__LEN__M (0x3f)
  282. if (!(agperror & TITAN__PCHIP_AGPERROR__ERRMASK))
  283. return MCHK_DISPOSITION_UNKNOWN_ERROR;
  284. #ifdef CONFIG_VERBOSE_MCHECK
  285. if (!print)
  286. return status;
  287. cmd = EXTRACT(agperror, TITAN__PCHIP_AGPERROR__CMD);
  288. addr = EXTRACT(agperror, TITAN__PCHIP_AGPERROR__ADDR) << 3;
  289. len = EXTRACT(agperror, TITAN__PCHIP_AGPERROR__LEN);
  290. printk("%s PChip %d AGPERROR: %016llx\n", err_print_prefix,
  291. which, agperror);
  292. if (agperror & TITAN__PCHIP_AGPERROR__NOWINDOW)
  293. printk("%s No Window\n", err_print_prefix);
  294. if (agperror & TITAN__PCHIP_AGPERROR__PTP)
  295. printk("%s Peer-to-Peer set\n", err_print_prefix);
  296. if (agperror & TITAN__PCHIP_AGPERROR__IPTE)
  297. printk("%s Invalid PTE\n", err_print_prefix);
  298. if (agperror & TITAN__PCHIP_AGPERROR__RESCMD)
  299. printk("%s Reserved Command\n", err_print_prefix);
  300. if (agperror & TITAN__PCHIP_AGPERROR__HPQFULL)
  301. printk("%s HP Transaction Received while Queue Full\n",
  302. err_print_prefix);
  303. if (agperror & TITAN__PCHIP_AGPERROR__LPQFULL)
  304. printk("%s LP Transaction Received while Queue Full\n",
  305. err_print_prefix);
  306. if (agperror & TITAN__PCHIP_AGPERROR__LOST)
  307. printk("%s Lost Error\n", err_print_prefix);
  308. printk("%s Command: 0x%x - %s, %d Quadwords%s\n"
  309. " Address: 0x%lx\n",
  310. err_print_prefix, cmd, agperror_cmd[cmd], len,
  311. (agperror & TITAN__PCHIP_AGPERROR__FENCE) ? ", FENCE" : "",
  312. addr);
  313. if (agperror & TITAN__PCHIP_AGPERROR__DAC)
  314. printk("%s Dual Address Cycle\n", err_print_prefix);
  315. if (agperror & TITAN__PCHIP_AGPERROR__MWIN)
  316. printk("%s Hit in Monster Window\n", err_print_prefix);
  317. #endif /* CONFIG_VERBOSE_MCHECK */
  318. return status;
  319. }
  320. static int
  321. titan_parse_p_chip(int which, u64 serror, u64 gperror,
  322. u64 aperror, u64 agperror, int print)
  323. {
  324. int status = MCHK_DISPOSITION_UNKNOWN_ERROR;
  325. status |= titan_parse_p_serror(which, serror, print);
  326. status |= titan_parse_p_perror(which, 0, gperror, print);
  327. status |= titan_parse_p_perror(which, 1, aperror, print);
  328. status |= titan_parse_p_agperror(which, agperror, print);
  329. return status;
  330. }
  331. int
  332. titan_process_logout_frame(struct el_common *mchk_header, int print)
  333. {
  334. struct el_TITAN_sysdata_mcheck *tmchk =
  335. (struct el_TITAN_sysdata_mcheck *)
  336. ((unsigned long)mchk_header + mchk_header->sys_offset);