heterogeneousDataSynchronization.c 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. /*
  2. * linux/arch/alpha/kernel/err_marvel.c
  3. *
  4. * Copyright (C) 2001 Jeff Wiedemeier (Compaq Computer Corporation)
  5. *
  6. */
  7. #include <linux/init.h>
  8. #include <linux/pci.h>
  9. #include <linux/sched.h>
  10. #include <asm/io.h>
  11. #include <asm/console.h>
  12. #include <asm/core_marvel.h>
  13. #include <asm/hwrpb.h>
  14. #include <asm/smp.h>
  15. #include <asm/err_common.h>
  16. #include <asm/err_ev7.h>
  17. #include "err_impl.h"
  18. #include "proto.h"
  19. static void
  20. marvel_print_680_frame(struct ev7_lf_subpackets *lf_subpackets)
  21. {
  22. #ifdef CONFIG_VERBOSE_MCHECK
  23. struct ev7_pal_environmental_subpacket *env;
  24. struct { int type; char *name; } ev_packets[] = {
  25. { EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE,
  26. "Ambient Temperature" },
  27. { EL_TYPE__PAL__ENV__AIRMOVER_FAN,
  28. "AirMover / Fan" },
  29. { EL_TYPE__PAL__ENV__VOLTAGE,
  30. "Voltage" },
  31. { EL_TYPE__PAL__ENV__INTRUSION,
  32. "Intrusion" },
  33. { EL_TYPE__PAL__ENV__POWER_SUPPLY,
  34. "Power Supply" },
  35. { EL_TYPE__PAL__ENV__LAN,
  36. "LAN" },
  37. { EL_TYPE__PAL__ENV__HOT_PLUG,
  38. "Hot Plug" },
  39. { 0, NULL }
  40. };
  41. int i;
  42. for (i = 0; ev_packets[i].type != 0; i++) {
  43. env = lf_subpackets->env[ev7_lf_env_index(ev_packets[i].type)];
  44. if (!env)
  45. continue;
  46. printk("%s**%s event (cabinet %d, drawer %d)\n",
  47. err_print_prefix,
  48. ev_packets[i].name,
  49. env->cabinet,
  50. env->drawer);
  51. printk("%s Module Type: 0x%x - Unit ID 0x%x - "
  52. "Condition 0x%x\n",
  53. err_print_prefix,
  54. env->module_type,
  55. env->unit_id,
  56. env->condition);
  57. }
  58. #endif /* CONFIG_VERBOSE_MCHECK */
  59. }
  60. static int
  61. marvel_process_680_frame(struct ev7_lf_subpackets *lf_subpackets, int print)
  62. {
  63. int status = MCHK_DISPOSITION_UNKNOWN_ERROR;
  64. int i;
  65. for (i = ev7_lf_env_index(EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE);
  66. i <= ev7_lf_env_index(EL_TYPE__PAL__ENV__HOT_PLUG);
  67. i++) {
  68. if (lf_subpackets->env[i])
  69. status = MCHK_DISPOSITION_REPORT;
  70. }
  71. if (print)
  72. marvel_print_680_frame(lf_subpackets);
  73. return status;
  74. }
  75. #ifdef CONFIG_VERBOSE_MCHECK
  76. static void
  77. marvel_print_err_cyc(u64 err_cyc)
  78. {
  79. static char *packet_desc[] = {
  80. "No Error",
  81. "UNKNOWN",
  82. "1 cycle (1 or 2 flit packet)",
  83. "2 cycles (3 flit packet)",
  84. "9 cycles (18 flit packet)",
  85. "10 cycles (19 flit packet)",
  86. "UNKNOWN",
  87. "UNKNOWN",
  88. "UNKNOWN"
  89. };
  90. #define IO7__ERR_CYC__ODD_FLT (1UL << 0)
  91. #define IO7__ERR_CYC__EVN_FLT (1UL << 1)
  92. #define IO7__ERR_CYC__PACKET__S (6)
  93. #define IO7__ERR_CYC__PACKET__M (0x7)
  94. #define IO7__ERR_CYC__LOC (1UL << 5)
  95. #define IO7__ERR_CYC__CYCLE__S (2)
  96. #define IO7__ERR_CYC__CYCLE__M (0x7)
  97. printk("%s Packet In Error: %s\n"
  98. "%s Error in %s, cycle %lld%s%s\n",
  99. err_print_prefix,
  100. packet_desc[EXTRACT(err_cyc, IO7__ERR_CYC__PACKET)],
  101. err_print_prefix,
  102. (err_cyc & IO7__ERR_CYC__LOC) ? "DATA" : "HEADER",
  103. EXTRACT(err_cyc, IO7__ERR_CYC__CYCLE),
  104. (err_cyc & IO7__ERR_CYC__ODD_FLT) ? " [ODD Flit]": "",
  105. (err_cyc & IO7__ERR_CYC__EVN_FLT) ? " [Even Flit]": "");
  106. }
  107. static void
  108. marvel_print_po7_crrct_sym(u64 crrct_sym)
  109. {
  110. #define IO7__PO7_CRRCT_SYM__SYN__S (0)
  111. #define IO7__PO7_CRRCT_SYM__SYN__M (0x7f)
  112. #define IO7__PO7_CRRCT_SYM__ERR_CYC__S (7) /* ERR_CYC + ODD_FLT + EVN_FLT */
  113. #define IO7__PO7_CRRCT_SYM__ERR_CYC__M (0x1ff)
  114. printk("%s Correctable Error Symptoms:\n"
  115. "%s Syndrome: 0x%llx\n",
  116. err_print_prefix,
  117. err_print_prefix, EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__SYN));
  118. marvel_print_err_cyc(EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__ERR_CYC));
  119. }
  120. static void
  121. marvel_print_po7_uncrr_sym(u64 uncrr_sym, u64 valid_mask)
  122. {
  123. static char *clk_names[] = { "_h[0]", "_h[1]", "_n[0]", "_n[1]" };
  124. static char *clk_decode[] = {
  125. "No Error",
  126. "One extra rising edge",
  127. "Two extra rising edges",
  128. "Lost one clock"
  129. };
  130. static char *port_names[] = { "Port 0", "Port 1",
  131. "Port 2", "Port 3",
  132. "Unknown Port", "Unknown Port",
  133. "Unknown Port", "Port 7" };
  134. int scratch, i;
  135. #define IO7__PO7_UNCRR_SYM__SYN__S (0)
  136. #define IO7__PO7_UNCRR_SYM__SYN__M (0x7f)
  137. #define IO7__PO7_UNCRR_SYM__ERR_CYC__S (7) /* ERR_CYC + ODD_FLT... */
  138. #define IO7__PO7_UNCRR_SYM__ERR_CYC__M (0x1ff) /* ... + EVN_FLT */
  139. #define IO7__PO7_UNCRR_SYM__CLK__S (16)
  140. #define IO7__PO7_UNCRR_SYM__CLK__M (0xff)
  141. #define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__REQ (1UL << 24)
  142. #define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__RIO (1UL << 25)
  143. #define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__WIO (1UL << 26)
  144. #define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__BLK (1UL << 27)
  145. #define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__NBK (1UL << 28)
  146. #define IO7__PO7_UNCRR_SYM__OVF__READIO (1UL << 29)
  147. #define IO7__PO7_UNCRR_SYM__OVF__WRITEIO (1UL << 30)
  148. #define IO7__PO7_UNCRR_SYM__OVF__FWD (1UL << 31)
  149. #define IO7__PO7_UNCRR_SYM__VICTIM_SP__S (32)
  150. #define IO7__PO7_UNCRR_SYM__VICTIM_SP__M (0xff)
  151. #define IO7__PO7_UNCRR_SYM__DETECT_SP__S (40)
  152. #define IO7__PO7_UNCRR_SYM__DETECT_SP__M (0xff)
  153. #define IO7__PO7_UNCRR_SYM__STRV_VTR__S (48)
  154. #define IO7__PO7_UNCRR_SYM__STRV_VTR__M (0x3ff)
  155. #define IO7__STRV_VTR__LSI__INTX__S (0)
  156. #define IO7__STRV_VTR__LSI__INTX__M (0x3)
  157. #define IO7__STRV_VTR__LSI__SLOT__S (2)
  158. #define IO7__STRV_VTR__LSI__SLOT__M (0x7)
  159. #define IO7__STRV_VTR__LSI__BUS__S (5)
  160. #define IO7__STRV_VTR__LSI__BUS__M (0x3)
  161. #define IO7__STRV_VTR__MSI__INTNUM__S (0)
  162. #define IO7__STRV_VTR__MSI__INTNUM__M (0x1ff)
  163. #define IO7__STRV_VTR__IS_MSI (1UL << 9)
  164. printk("%s Uncorrectable Error Symptoms:\n", err_print_prefix);
  165. uncrr_sym &= valid_mask;
  166. if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__SYN))
  167. printk("%s Syndrome: 0x%llx\n",
  168. err_print_prefix,
  169. EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__SYN));
  170. if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__ERR_CYC))
  171. marvel_print_err_cyc(EXTRACT(uncrr_sym,
  172. IO7__PO7_UNCRR_SYM__ERR_CYC));
  173. scratch = EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__CLK);
  174. for (i = 0; i < 4; i++, scratch >>= 2) {
  175. if (scratch & 0x3)
  176. printk("%s Clock %s: %s\n",
  177. err_print_prefix,
  178. clk_names[i], clk_decode[scratch & 0x3]);
  179. }
  180. if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__REQ)
  181. printk("%s REQ Credit Timeout or Overflow\n",
  182. err_print_prefix);
  183. if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__RIO)
  184. printk("%s RIO Credit Timeout or Overflow\n",
  185. err_print_prefix);
  186. if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__WIO)
  187. printk("%s WIO Credit Timeout or Overflow\n",
  188. err_print_prefix);
  189. if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__BLK)
  190. printk("%s BLK Credit Timeout or Overflow\n",
  191. err_print_prefix);
  192. if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__NBK)
  193. printk("%s NBK Credit Timeout or Overflow\n",
  194. err_print_prefix);
  195. if (uncrr_sym & IO7__PO7_UNCRR_SYM__OVF__READIO)
  196. printk("%s Read I/O Buffer Overflow\n",
  197. err_print_prefix);
  198. if (uncrr_sym & IO7__PO7_UNCRR_SYM__OVF__WRITEIO)
  199. printk("%s Write I/O Buffer Overflow\n",
  200. err_print_prefix);
  201. if (uncrr_sym & IO7__PO7_UNCRR_SYM__OVF__FWD)
  202. printk("%s FWD Buffer Overflow\n",
  203. err_print_prefix);
  204. if ((scratch = EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__VICTIM_SP))) {
  205. int lost = scratch & (1UL << 4);
  206. scratch &= ~lost;
  207. for (i = 0; i < 8; i++, scratch >>= 1) {
  208. if (!(scratch & 1))
  209. continue;
  210. printk("%s Error Response sent to %s",
  211. err_print_prefix, port_names[i]);
  212. }
  213. if (lost)
  214. printk("%s Lost Error sent somewhere else\n",
  215. err_print_prefix);
  216. }
  217. if ((scratch = EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__DETECT_SP))) {
  218. for (i = 0; i < 8; i++, scratch >>= 1) {
  219. if (!(scratch & 1))
  220. continue;
  221. printk("%s Error Reported by %s",
  222. err_print_prefix, port_names[i]);
  223. }
  224. }
  225. if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__STRV_VTR)) {
  226. char starvation_message[80];
  227. scratch = EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__STRV_VTR);
  228. if (scratch & IO7__STRV_VTR__IS_MSI)
  229. sprintf(starvation_message,
  230. "MSI Interrupt 0x%x",
  231. EXTRACT(scratch, IO7__STRV_VTR__MSI__INTNUM));
  232. else
  233. sprintf(starvation_message,
  234. "LSI INT%c for Bus:Slot (%d:%d)\n",
  235. 'A' + EXTRACT(scratch,
  236. IO7__STRV_VTR__LSI__INTX),
  237. EXTRACT(scratch, IO7__STRV_VTR__LSI__BUS),
  238. EXTRACT(scratch, IO7__STRV_VTR__LSI__SLOT));
  239. printk("%s Starvation Int Trigger By: %s\n",
  240. err_print_prefix, starvation_message);
  241. }
  242. }
  243. static void
  244. marvel_print_po7_ugbge_sym(u64 ugbge_sym)
  245. {
  246. char opcode_str[10];
  247. #define IO7__PO7_UGBGE_SYM__UPH_PKT_OFF__S (6)
  248. #define IO7__PO7_UGBGE_SYM__UPH_PKT_OFF__M (0xfffffffful)
  249. #define IO7__PO7_UGBGE_SYM__UPH_OPCODE__S (40)
  250. #define IO7__PO7_UGBGE_SYM__UPH_OPCODE__M (0xff)
  251. #define IO7__PO7_UGBGE_SYM__UPH_SRC_PORT__S (48)
  252. #define IO7__PO7_UGBGE_SYM__UPH_SRC_PORT__M (0xf)
  253. #define IO7__PO7_UGBGE_SYM__UPH_DEST_PID__S (52)
  254. #define IO7__PO7_UGBGE_SYM__UPH_DEST_PID__M (0x7ff)
  255. #define IO7__PO7_UGBGE_SYM__VALID (1UL << 63)
  256. if (!(ugbge_sym & IO7__PO7_UGBGE_SYM__VALID))
  257. return;
  258. switch(EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE)) {
  259. case 0x51:
  260. sprintf(opcode_str, "Wr32");
  261. break;
  262. case 0x50:
  263. sprintf(opcode_str, "WrQW");
  264. break;
  265. case 0x54:
  266. sprintf(opcode_str, "WrIPR");
  267. break;
  268. case 0xD8:
  269. sprintf(opcode_str, "Victim");
  270. break;
  271. case 0xC5:
  272. sprintf(opcode_str, "BlkIO");
  273. break;
  274. default:
  275. sprintf(opcode_str, "0x%llx\n",
  276. EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE));
  277. break;
  278. }
  279. printk("%s Up Hose Garbage Symptom:\n"
  280. "%s Source Port: %lld - Dest PID: %lld - OpCode: %s\n",
  281. err_print_prefix,
  282. err_print_prefix,
  283. EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_SRC_PORT),
  284. EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_DEST_PID),
  285. opcode_str);
  286. if (0xC5 != EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE))
  287. printk("%s Packet Offset 0x%08llx\n",
  288. err_print_prefix,
  289. EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_PKT_OFF));
  290. }
  291. static void
  292. marvel_print_po7_err_sum(struct ev7_pal_io_subpacket *io)
  293. {
  294. u64 uncrr_sym_valid = 0;
  295. #define IO7__PO7_ERRSUM__CR_SBE (1UL << 32)
  296. #define IO7__PO7_ERRSUM__CR_SBE2 (1UL << 33)
  297. #define IO7__PO7_ERRSUM__CR_PIO_WBYTE (1UL << 34)
  298. #define IO7__PO7_ERRSUM__CR_CSR_NXM (1UL << 35)
  299. #define IO7__PO7_ERRSUM__CR_RPID_ACV (1UL << 36)
  300. #define IO7__PO7_ERRSUM__CR_RSP_NXM (1UL << 37)
  301. #define IO7__PO7_ERRSUM__CR_ERR_RESP (1UL << 38)
  302. #define IO7__PO7_ERRSUM__CR_CLK_DERR (1UL << 39)
  303. #define IO7__PO7_ERRSUM__CR_DAT_DBE (1UL << 40)
  304. #define IO7__PO7_ERRSUM__CR_DAT_GRBG (1UL << 41)
  305. #define IO7__PO7_ERRSUM__MAF_TO (1UL << 42)
  306. #define IO7__PO7_ERRSUM__UGBGE (1UL << 43)
  307. #define IO7__PO7_ERRSUM__UN_MAF_LOST (1UL << 44)
  308. #define IO7__PO7_ERRSUM__UN_PKT_OVF (1UL << 45)
  309. #define IO7__PO7_ERRSUM__UN_CDT_OVF (1UL << 46)