| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759 | /* *	linux/arch/alpha/kernel/err_marvel.c * *	Copyright (C) 2001 Jeff Wiedemeier (Compaq Computer Corporation) * */#include <linux/init.h>#include <linux/pci.h>#include <linux/sched.h>#include <asm/io.h>#include <asm/console.h>#include <asm/core_marvel.h>#include <asm/hwrpb.h>#include <asm/smp.h>#include <asm/err_common.h>#include <asm/err_ev7.h>#include "err_impl.h"#include "proto.h"static voidmarvel_print_680_frame(struct ev7_lf_subpackets *lf_subpackets){#ifdef CONFIG_VERBOSE_MCHECK	struct ev7_pal_environmental_subpacket *env;	struct { int type; char *name; } ev_packets[] = {		{ EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE,		  "Ambient Temperature" },		{ EL_TYPE__PAL__ENV__AIRMOVER_FAN,		  "AirMover / Fan" },		{ EL_TYPE__PAL__ENV__VOLTAGE,		  "Voltage" },		{ EL_TYPE__PAL__ENV__INTRUSION,		  "Intrusion" },		{ EL_TYPE__PAL__ENV__POWER_SUPPLY,		  "Power Supply" },		{ EL_TYPE__PAL__ENV__LAN,		  "LAN" },		{ EL_TYPE__PAL__ENV__HOT_PLUG,		  "Hot Plug" },		{ 0, NULL }	};	int i;	for (i = 0; ev_packets[i].type != 0; i++) {		env = lf_subpackets->env[ev7_lf_env_index(ev_packets[i].type)];		if (!env)			continue;		printk("%s**%s event (cabinet %d, drawer %d)\n",		       err_print_prefix,		       ev_packets[i].name,		       env->cabinet,		       env->drawer);		printk("%s   Module Type: 0x%x - Unit ID 0x%x - "		       "Condition 0x%x\n",		       err_print_prefix,		       env->module_type,		       env->unit_id,		       env->condition);	}#endif /* CONFIG_VERBOSE_MCHECK */}static intmarvel_process_680_frame(struct ev7_lf_subpackets *lf_subpackets, int print){	int status = MCHK_DISPOSITION_UNKNOWN_ERROR;	int i;	for (i = ev7_lf_env_index(EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE);	     i <= ev7_lf_env_index(EL_TYPE__PAL__ENV__HOT_PLUG);	     i++) {		if (lf_subpackets->env[i])			status = MCHK_DISPOSITION_REPORT;	}	if (print)		marvel_print_680_frame(lf_subpackets);	return status;}#ifdef CONFIG_VERBOSE_MCHECKstatic voidmarvel_print_err_cyc(u64 err_cyc){	static char *packet_desc[] = {		"No Error",		"UNKNOWN",		"1 cycle (1 or 2 flit packet)",		"2 cycles (3 flit packet)",		"9 cycles (18 flit packet)",		"10 cycles (19 flit packet)",		"UNKNOWN",		"UNKNOWN",		"UNKNOWN"	};#define IO7__ERR_CYC__ODD_FLT	(1UL <<  0)#define IO7__ERR_CYC__EVN_FLT	(1UL <<  1)#define IO7__ERR_CYC__PACKET__S	(6)#define IO7__ERR_CYC__PACKET__M	(0x7)#define IO7__ERR_CYC__LOC	(1UL <<  5)#define IO7__ERR_CYC__CYCLE__S	(2)#define IO7__ERR_CYC__CYCLE__M	(0x7)	printk("%s        Packet In Error: %s\n"	       "%s        Error in %s, cycle %lld%s%s\n",	       err_print_prefix, 	       packet_desc[EXTRACT(err_cyc, IO7__ERR_CYC__PACKET)],	       err_print_prefix,	       (err_cyc & IO7__ERR_CYC__LOC) ? "DATA" : "HEADER",	       EXTRACT(err_cyc, IO7__ERR_CYC__CYCLE),	       (err_cyc & IO7__ERR_CYC__ODD_FLT) ? " [ODD Flit]": "",	       (err_cyc & IO7__ERR_CYC__EVN_FLT) ? " [Even Flit]": "");}static voidmarvel_print_po7_crrct_sym(u64 crrct_sym){#define IO7__PO7_CRRCT_SYM__SYN__S	(0)#define IO7__PO7_CRRCT_SYM__SYN__M	(0x7f)#define IO7__PO7_CRRCT_SYM__ERR_CYC__S	(7)   /* ERR_CYC + ODD_FLT + EVN_FLT */#define IO7__PO7_CRRCT_SYM__ERR_CYC__M	(0x1ff)	printk("%s      Correctable Error Symptoms:\n"	       "%s        Syndrome: 0x%llx\n",	       err_print_prefix,	       err_print_prefix, EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__SYN));	marvel_print_err_cyc(EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__ERR_CYC));}static voidmarvel_print_po7_uncrr_sym(u64 uncrr_sym, u64 valid_mask){	static char *clk_names[] = { "_h[0]", "_h[1]", "_n[0]", "_n[1]" };	static char *clk_decode[] = {		"No Error",		"One extra rising edge",		"Two extra rising edges",		"Lost one clock"	};	static char *port_names[] = { "Port 0", 	"Port 1", 				      "Port 2", 	"Port 3",				      "Unknown Port",	"Unknown Port",				      "Unknown Port",	"Port 7" };	int scratch, i;#define IO7__PO7_UNCRR_SYM__SYN__S	    (0)#define IO7__PO7_UNCRR_SYM__SYN__M	    (0x7f)#define IO7__PO7_UNCRR_SYM__ERR_CYC__S	    (7)      /* ERR_CYC + ODD_FLT... */#define IO7__PO7_UNCRR_SYM__ERR_CYC__M	    (0x1ff)  /* ... + EVN_FLT        */#define IO7__PO7_UNCRR_SYM__CLK__S	    (16)#define IO7__PO7_UNCRR_SYM__CLK__M	    (0xff)#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__REQ (1UL << 24)#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__RIO (1UL << 25)#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__WIO (1UL << 26)#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__BLK (1UL << 27)#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__NBK (1UL << 28)#define IO7__PO7_UNCRR_SYM__OVF__READIO	    (1UL << 29)#define IO7__PO7_UNCRR_SYM__OVF__WRITEIO    (1UL << 30)#define IO7__PO7_UNCRR_SYM__OVF__FWD        (1UL << 31)#define IO7__PO7_UNCRR_SYM__VICTIM_SP__S    (32)#define IO7__PO7_UNCRR_SYM__VICTIM_SP__M    (0xff)#define IO7__PO7_UNCRR_SYM__DETECT_SP__S    (40)#define IO7__PO7_UNCRR_SYM__DETECT_SP__M    (0xff)#define IO7__PO7_UNCRR_SYM__STRV_VTR__S     (48)#define IO7__PO7_UNCRR_SYM__STRV_VTR__M     (0x3ff)#define IO7__STRV_VTR__LSI__INTX__S	    (0)#define IO7__STRV_VTR__LSI__INTX__M	    (0x3)#define IO7__STRV_VTR__LSI__SLOT__S	    (2)#define IO7__STRV_VTR__LSI__SLOT__M	    (0x7)#define IO7__STRV_VTR__LSI__BUS__S	    (5)#define IO7__STRV_VTR__LSI__BUS__M	    (0x3)#define IO7__STRV_VTR__MSI__INTNUM__S	    (0)#define IO7__STRV_VTR__MSI__INTNUM__M	    (0x1ff)#define IO7__STRV_VTR__IS_MSI		    (1UL << 9)	printk("%s      Uncorrectable Error Symptoms:\n", err_print_prefix);	uncrr_sym &= valid_mask;	if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__SYN))		printk("%s        Syndrome: 0x%llx\n",		       err_print_prefix, 		       EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__SYN));	if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__ERR_CYC))		marvel_print_err_cyc(EXTRACT(uncrr_sym, 					     IO7__PO7_UNCRR_SYM__ERR_CYC));	scratch = EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__CLK);	for (i = 0; i < 4; i++, scratch >>= 2) {		if (scratch & 0x3)			printk("%s        Clock %s: %s\n",			       err_print_prefix,			       clk_names[i], clk_decode[scratch & 0x3]);	}	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__REQ) 		printk("%s       REQ Credit Timeout or Overflow\n",		       err_print_prefix);	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__RIO) 		printk("%s       RIO Credit Timeout or Overflow\n",		       err_print_prefix);	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__WIO) 		printk("%s       WIO Credit Timeout or Overflow\n",		       err_print_prefix);	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__BLK) 		printk("%s       BLK Credit Timeout or Overflow\n",		       err_print_prefix);	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__NBK) 		printk("%s       NBK Credit Timeout or Overflow\n",		       err_print_prefix);	if (uncrr_sym & IO7__PO7_UNCRR_SYM__OVF__READIO) 		printk("%s       Read I/O Buffer Overflow\n", 		       err_print_prefix);	if (uncrr_sym & IO7__PO7_UNCRR_SYM__OVF__WRITEIO) 		printk("%s       Write I/O Buffer Overflow\n", 		       err_print_prefix);	if (uncrr_sym & IO7__PO7_UNCRR_SYM__OVF__FWD) 		printk("%s       FWD Buffer Overflow\n", 		       err_print_prefix);	if ((scratch = EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__VICTIM_SP))) {		int lost = scratch & (1UL << 4);		scratch &= ~lost;		for (i = 0; i < 8; i++, scratch >>= 1) {			if (!(scratch & 1))				continue;			printk("%s        Error Response sent to %s",			       err_print_prefix, port_names[i]);		}		if (lost)			printk("%s        Lost Error sent somewhere else\n",			       err_print_prefix);	}		if ((scratch = EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__DETECT_SP))) {		for (i = 0; i < 8; i++, scratch >>= 1) {			if (!(scratch & 1))				continue;			printk("%s        Error Reported by %s",			       err_print_prefix, port_names[i]);		}	}	if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__STRV_VTR)) {		char starvation_message[80];		scratch = EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__STRV_VTR);		if (scratch & IO7__STRV_VTR__IS_MSI) 			sprintf(starvation_message, 				"MSI Interrupt 0x%x",				EXTRACT(scratch, IO7__STRV_VTR__MSI__INTNUM));		else			sprintf(starvation_message,				"LSI INT%c for Bus:Slot (%d:%d)\n",				'A' + EXTRACT(scratch, 					      IO7__STRV_VTR__LSI__INTX),				EXTRACT(scratch, IO7__STRV_VTR__LSI__BUS),				EXTRACT(scratch, IO7__STRV_VTR__LSI__SLOT));		printk("%s        Starvation Int Trigger By: %s\n",		       err_print_prefix, starvation_message);	}}static voidmarvel_print_po7_ugbge_sym(u64 ugbge_sym){	char opcode_str[10];#define IO7__PO7_UGBGE_SYM__UPH_PKT_OFF__S	(6)#define IO7__PO7_UGBGE_SYM__UPH_PKT_OFF__M	(0xfffffffful)#define IO7__PO7_UGBGE_SYM__UPH_OPCODE__S	(40)#define IO7__PO7_UGBGE_SYM__UPH_OPCODE__M	(0xff)#define IO7__PO7_UGBGE_SYM__UPH_SRC_PORT__S	(48)#define IO7__PO7_UGBGE_SYM__UPH_SRC_PORT__M	(0xf)#define IO7__PO7_UGBGE_SYM__UPH_DEST_PID__S	(52)#define IO7__PO7_UGBGE_SYM__UPH_DEST_PID__M	(0x7ff)#define IO7__PO7_UGBGE_SYM__VALID		(1UL << 63)	if (!(ugbge_sym & IO7__PO7_UGBGE_SYM__VALID))		return;	switch(EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE)) {	case 0x51:		sprintf(opcode_str, "Wr32");		break;	case 0x50:		sprintf(opcode_str, "WrQW");		break;	case 0x54:		sprintf(opcode_str, "WrIPR");		break;	case 0xD8:		sprintf(opcode_str, "Victim");		break;	case 0xC5:		sprintf(opcode_str, "BlkIO");		break;	default:		sprintf(opcode_str, "0x%llx\n",			EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE));		break;	}	printk("%s      Up Hose Garbage Symptom:\n"	       "%s        Source Port: %lld - Dest PID: %lld - OpCode: %s\n",	       err_print_prefix,	       err_print_prefix, 	       EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_SRC_PORT),	       EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_DEST_PID),	       opcode_str);	if (0xC5 != EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_OPCODE))		printk("%s        Packet Offset 0x%08llx\n",		       err_print_prefix,		       EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_PKT_OFF));}static voidmarvel_print_po7_err_sum(struct ev7_pal_io_subpacket *io){	u64	uncrr_sym_valid = 0;#define IO7__PO7_ERRSUM__CR_SBE		(1UL << 32)#define IO7__PO7_ERRSUM__CR_SBE2	(1UL << 33)#define IO7__PO7_ERRSUM__CR_PIO_WBYTE	(1UL << 34)#define IO7__PO7_ERRSUM__CR_CSR_NXM	(1UL << 35)#define IO7__PO7_ERRSUM__CR_RPID_ACV	(1UL << 36)#define IO7__PO7_ERRSUM__CR_RSP_NXM	(1UL << 37)#define IO7__PO7_ERRSUM__CR_ERR_RESP	(1UL << 38)#define IO7__PO7_ERRSUM__CR_CLK_DERR	(1UL << 39)#define IO7__PO7_ERRSUM__CR_DAT_DBE	(1UL << 40)#define IO7__PO7_ERRSUM__CR_DAT_GRBG	(1UL << 41)#define IO7__PO7_ERRSUM__MAF_TO		(1UL << 42)#define IO7__PO7_ERRSUM__UGBGE		(1UL << 43)#define IO7__PO7_ERRSUM__UN_MAF_LOST	(1UL << 44)#define IO7__PO7_ERRSUM__UN_PKT_OVF	(1UL << 45)#define IO7__PO7_ERRSUM__UN_CDT_OVF	(1UL << 46)#define IO7__PO7_ERRSUM__UN_DEALLOC	(1UL << 47)#define IO7__PO7_ERRSUM__BH_CDT_TO	(1UL << 51)#define IO7__PO7_ERRSUM__BH_CLK_HDR	(1UL << 52)#define IO7__PO7_ERRSUM__BH_DBE_HDR	(1UL << 53)#define IO7__PO7_ERRSUM__BH_GBG_HDR	(1UL << 54)#define IO7__PO7_ERRSUM__BH_BAD_CMD	(1UL << 55)#define IO7__PO7_ERRSUM__HLT_INT	(1UL << 56)#define IO7__PO7_ERRSUM__HP_INT		(1UL << 57)#define IO7__PO7_ERRSUM__CRD_INT	(1UL << 58)#define IO7__PO7_ERRSUM__STV_INT	(1UL << 59)#define IO7__PO7_ERRSUM__HRD_INT	(1UL << 60)#define IO7__PO7_ERRSUM__BH_SUM		(1UL << 61)#define IO7__PO7_ERRSUM__ERR_LST	(1UL << 62)#define IO7__PO7_ERRSUM__ERR_VALID	(1UL << 63)#define IO7__PO7_ERRSUM__ERR_MASK	(IO7__PO7_ERRSUM__ERR_VALID |	\					 IO7__PO7_ERRSUM__CR_SBE)	/*	 * Single bit errors aren't covered by ERR_VALID.	 */	if (io->po7_error_sum & IO7__PO7_ERRSUM__CR_SBE) {		printk("%s    %sSingle Bit Error(s) detected/corrected\n",		       err_print_prefix,		       (io->po7_error_sum & IO7__PO7_ERRSUM__CR_SBE2) 		       ? "Multiple " : "");		marvel_print_po7_crrct_sym(io->po7_crrct_sym);	}	/*	 * Neither are the interrupt status bits	 */	if (io->po7_error_sum & IO7__PO7_ERRSUM__HLT_INT)		printk("%s    Halt Interrupt posted", err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__HP_INT) {		printk("%s    Hot Plug Event Interrupt posted", 		       err_print_prefix);		uncrr_sym_valid |= GEN_MASK(IO7__PO7_UNCRR_SYM__DETECT_SP);	}	if (io->po7_error_sum & IO7__PO7_ERRSUM__CRD_INT)		printk("%s    Correctable Error Interrupt posted", 		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__STV_INT) {		printk("%s    Starvation Interrupt posted", err_print_prefix);		uncrr_sym_valid |= GEN_MASK(IO7__PO7_UNCRR_SYM__STRV_VTR);	}	if (io->po7_error_sum & IO7__PO7_ERRSUM__HRD_INT) {		printk("%s    Hard Error Interrupt posted", err_print_prefix);		uncrr_sym_valid |= GEN_MASK(IO7__PO7_UNCRR_SYM__DETECT_SP);	}	/*	 * Everything else is valid only with ERR_VALID, so skip to the end	 * (uncrr_sym check) unless ERR_VALID is set.	 */	if (!(io->po7_error_sum & IO7__PO7_ERRSUM__ERR_VALID)) 		goto check_uncrr_sym;	/*	 * Since ERR_VALID is set, VICTIM_SP in uncrr_sym is valid.	 * For bits [29:0] to also be valid, the following bits must	 * not be set:	 *	CR_PIO_WBYTE	CR_CSR_NXM	CR_RSP_NXM	 *	CR_ERR_RESP	MAF_TO	 */	uncrr_sym_valid |= GEN_MASK(IO7__PO7_UNCRR_SYM__VICTIM_SP);	if (!(io->po7_error_sum & (IO7__PO7_ERRSUM__CR_PIO_WBYTE |				   IO7__PO7_ERRSUM__CR_CSR_NXM |				   IO7__PO7_ERRSUM__CR_RSP_NXM |				   IO7__PO7_ERRSUM__CR_ERR_RESP |				   IO7__PO7_ERRSUM__MAF_TO)))		uncrr_sym_valid |= 0x3ffffffful;	if (io->po7_error_sum & IO7__PO7_ERRSUM__CR_PIO_WBYTE)		printk("%s    Write byte into IO7 CSR\n", err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__CR_CSR_NXM)		printk("%s    PIO to non-existent CSR\n", err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__CR_RPID_ACV)		printk("%s    Bus Requester PID (Access Violation)\n",		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__CR_RSP_NXM)		printk("%s    Received NXM response from EV7\n",		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__CR_ERR_RESP)		printk("%s    Received ERROR RESPONSE\n", err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__CR_CLK_DERR)		printk("%s    Clock error on data flit\n", err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__CR_DAT_DBE)		printk("%s    Double Bit Error Data Error Detected\n",		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__CR_DAT_GRBG)		printk("%s    Garbage Encoding Detected on the data\n",		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__UGBGE) {		printk("%s    Garbage Encoding sent up hose\n",		       err_print_prefix);		marvel_print_po7_ugbge_sym(io->po7_ugbge_sym);	}	if (io->po7_error_sum & IO7__PO7_ERRSUM__UN_MAF_LOST)		printk("%s    Orphan response (unexpected response)\n",		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__UN_PKT_OVF)		printk("%s    Down hose packet overflow\n", err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__UN_CDT_OVF)		printk("%s    Down hose credit overflow\n", err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__UN_DEALLOC)		printk("%s    Unexpected or bad dealloc field\n",		       err_print_prefix);	/*	 * The black hole events.	 */	if (io->po7_error_sum & IO7__PO7_ERRSUM__MAF_TO)		printk("%s    BLACK HOLE: Timeout for all responses\n",		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__BH_CDT_TO)		printk("%s    BLACK HOLE: Credit Timeout\n", err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__BH_CLK_HDR)		printk("%s    BLACK HOLE: Clock check on header\n", 		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__BH_DBE_HDR)		printk("%s    BLACK HOLE: Uncorrectable Error on header\n",		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__BH_GBG_HDR)		printk("%s    BLACK HOLE: Garbage on header\n", 		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__BH_BAD_CMD)		printk("%s    BLACK HOLE: Bad EV7 command\n", 		       err_print_prefix);	if (io->po7_error_sum & IO7__PO7_ERRSUM__ERR_LST) 		printk("%s    Lost Error\n", err_print_prefix);	printk("%s    Failing Packet:\n"	       "%s      Cycle 1: %016llx\n"	       "%s      Cycle 2: %016llx\n",	       err_print_prefix,	       err_print_prefix, io->po7_err_pkt0,	       err_print_prefix, io->po7_err_pkt1);	/*	 * If there are any valid bits in UNCRR sym for this err, 	 * print UNCRR_SYM as well.	 */check_uncrr_sym:	if (uncrr_sym_valid)		marvel_print_po7_uncrr_sym(io->po7_uncrr_sym, uncrr_sym_valid);}static voidmarvel_print_pox_tlb_err(u64 tlb_err){	static char *tlb_errors[] = {		"No Error",		"North Port Signaled Error fetching TLB entry",		"PTE invalid or UCC or GBG error on this entry",		"Address did not hit any DMA window"	};#define IO7__POX_TLBERR__ERR_VALID		(1UL << 63)#define IO7__POX_TLBERR__ERRCODE__S		(0)#define IO7__POX_TLBERR__ERRCODE__M		(0x3)#define IO7__POX_TLBERR__ERR_TLB_PTR__S		(3)#define IO7__POX_TLBERR__ERR_TLB_PTR__M		(0x7)#define IO7__POX_TLBERR__FADDR__S		(6)#define IO7__POX_TLBERR__FADDR__M		(0x3fffffffffful)	if (!(tlb_err & IO7__POX_TLBERR__ERR_VALID))		return;	printk("%s      TLB Error on index 0x%llx:\n"	       "%s        - %s\n"	       "%s        - Addr: 0x%016llx\n",	       err_print_prefix,	       EXTRACT(tlb_err, IO7__POX_TLBERR__ERR_TLB_PTR),	       err_print_prefix,	       tlb_errors[EXTRACT(tlb_err, IO7__POX_TLBERR__ERRCODE)],	       err_print_prefix,	       EXTRACT(tlb_err, IO7__POX_TLBERR__FADDR) << 6);}static  voidmarvel_print_pox_spl_cmplt(u64 spl_cmplt){	char message[80];#define IO7__POX_SPLCMPLT__MESSAGE__S		(0)#define IO7__POX_SPLCMPLT__MESSAGE__M		(0x0fffffffful)#define IO7__POX_SPLCMPLT__SOURCE_BUS__S	(40)#define IO7__POX_SPLCMPLT__SOURCE_BUS__M	(0xfful)#define IO7__POX_SPLCMPLT__SOURCE_DEV__S	(35)#define IO7__POX_SPLCMPLT__SOURCE_DEV__M	(0x1ful)#define IO7__POX_SPLCMPLT__SOURCE_FUNC__S	(32)#define IO7__POX_SPLCMPLT__SOURCE_FUNC__M	(0x07ul)#define IO7__POX_SPLCMPLT__MSG_CLASS__S		(28)#define IO7__POX_SPLCMPLT__MSG_CLASS__M		(0xf)#define IO7__POX_SPLCMPLT__MSG_INDEX__S		(20)#define IO7__POX_SPLCMPLT__MSG_INDEX__M		(0xff)#define IO7__POX_SPLCMPLT__MSG_CLASSINDEX__S	(20)#define IO7__POX_SPLCMPLT__MSG_CLASSINDEX__M    (0xfff)#define IO7__POX_SPLCMPLT__REM_LOWER_ADDR__S	(12)#define IO7__POX_SPLCMPLT__REM_LOWER_ADDR__M	(0x7f)#define IO7__POX_SPLCMPLT__REM_BYTE_COUNT__S	(0)#define IO7__POX_SPLCMPLT__REM_BYTE_COUNT__M	(0xfff)	printk("%s      Split Completion Error:\n"		       "%s         Source (Bus:Dev:Func): %lld:%lld:%lld\n",	       err_print_prefix,	       err_print_prefix,	       EXTRACT(spl_cmplt, IO7__POX_SPLCMPLT__SOURCE_BUS),	       EXTRACT(spl_cmplt, IO7__POX_SPLCMPLT__SOURCE_DEV),	       EXTRACT(spl_cmplt, IO7__POX_SPLCMPLT__SOURCE_FUNC));	switch(EXTRACT(spl_cmplt, IO7__POX_SPLCMPLT__MSG_CLASSINDEX)) {	case 0x000:		sprintf(message, "Normal completion");		break;	case 0x100:		sprintf(message, "Bridge - Master Abort");		break;	case 0x101:		sprintf(message, "Bridge - Target Abort");		break;	case 0x102:		sprintf(message, "Bridge - Uncorrectable Write Data Error");		break;	case 0x200:		sprintf(message, "Byte Count Out of Range");		break;	case 0x201:		sprintf(message, "Uncorrectable Split Write Data Error");		break;	default:		sprintf(message, "%08llx\n",			EXTRACT(spl_cmplt, IO7__POX_SPLCMPLT__MESSAGE));		break;	}	printk("%s	   Message: %s\n", err_print_prefix, message);}static voidmarvel_print_pox_trans_sum(u64 trans_sum){	static const char * const pcix_cmd[] = {		"Interrupt Acknowledge",		"Special Cycle",		"I/O Read",		"I/O Write",		"Reserved",		"Reserved / Device ID Message",		"Memory Read",		"Memory Write",		"Reserved / Alias to Memory Read Block",		"Reserved / Alias to Memory Write Block",		"Configuration Read",		"Configuration Write",		"Memory Read Multiple / Split Completion",		"Dual Address Cycle",		"Memory Read Line / Memory Read Block",		"Memory Write and Invalidate / Memory Write Block"	};#define IO7__POX_TRANSUM__PCI_ADDR__S		(0)#define IO7__POX_TRANSUM__PCI_ADDR__M		(0x3fffffffffffful)#define IO7__POX_TRANSUM__DAC			(1UL << 50)#define IO7__POX_TRANSUM__PCIX_MASTER_SLOT__S	(52)#define IO7__POX_TRANSUM__PCIX_MASTER_SLOT__M	(0xf)#define IO7__POX_TRANSUM__PCIX_CMD__S		(56)#define IO7__POX_TRANSUM__PCIX_CMD__M		(0xf)#define IO7__POX_TRANSUM__ERR_VALID		(1UL << 63)	if (!(trans_sum & IO7__POX_TRANSUM__ERR_VALID))		return;	printk("%s      Transaction Summary:\n"	       "%s        Command: 0x%llx - %s\n"	       "%s        Address: 0x%016llx%s\n"	       "%s        PCI-X Master Slot: 0x%llx\n",	       err_print_prefix, 	       err_print_prefix, 	       EXTRACT(trans_sum, IO7__POX_TRANSUM__PCIX_CMD),	       pcix_cmd[EXTRACT(trans_sum, IO7__POX_TRANSUM__PCIX_CMD)],	       err_print_prefix,	       EXTRACT(trans_sum, IO7__POX_TRANSUM__PCI_ADDR),	       (trans_sum & IO7__POX_TRANSUM__DAC) ? " (DAC)" : "",	       err_print_prefix,	       EXTRACT(trans_sum, IO7__POX_TRANSUM__PCIX_MASTER_SLOT));}static voidmarvel_print_pox_err(u64 err_sum, struct ev7_pal_io_one_port *port){#define IO7__POX_ERRSUM__AGP_REQQ_OVFL    (1UL <<  4)#define IO7__POX_ERRSUM__AGP_SYNC_ERR     (1UL <<  5)#define IO7__POX_ERRSUM__MRETRY_TO        (1UL <<  6)#define IO7__POX_ERRSUM__PCIX_UX_SPL      (1UL <<  7)#define IO7__POX_ERRSUM__PCIX_SPLIT_TO    (1UL <<  8)#define IO7__POX_ERRSUM__PCIX_DISCARD_SPL (1UL <<  9)#define IO7__POX_ERRSUM__DMA_RD_TO        (1UL << 10)#define IO7__POX_ERRSUM__CSR_NXM_RD       (1UL << 11)#define IO7__POX_ERRSUM__CSR_NXM_WR       (1UL << 12)#define IO7__POX_ERRSUM__DMA_TO           (1UL << 13)#define IO7__POX_ERRSUM__ALL_MABORTS      (1UL << 14)#define IO7__POX_ERRSUM__MABORT		  (1UL << 15)#define IO7__POX_ERRSUM__MABORT_MASK	  (IO7__POX_ERRSUM__ALL_MABORTS|\					   IO7__POX_ERRSUM__MABORT)#define IO7__POX_ERRSUM__PT_TABORT        (1UL << 16)#define IO7__POX_ERRSUM__PM_TABORT        (1UL << 17)#define IO7__POX_ERRSUM__TABORT_MASK      (IO7__POX_ERRSUM__PT_TABORT | \                                           IO7__POX_ERRSUM__PM_TABORT)#define IO7__POX_ERRSUM__SERR             (1UL << 18)#define IO7__POX_ERRSUM__ADDRERR_STB      (1UL << 19)#define IO7__POX_ERRSUM__DETECTED_SERR    (1UL << 20)#define IO7__POX_ERRSUM__PERR             (1UL << 21)#define IO7__POX_ERRSUM__DATAERR_STB_NIOW (1UL << 22)#define IO7__POX_ERRSUM__DETECTED_PERR    (1UL << 23)#define IO7__POX_ERRSUM__PM_PERR          (1UL << 24)#define IO7__POX_ERRSUM__PT_SCERROR       (1UL << 26)#define IO7__POX_ERRSUM__HUNG_BUS         (1UL << 28)#define IO7__POX_ERRSUM__UPE_ERROR__S     (51)#define IO7__POX_ERRSUM__UPE_ERROR__M     (0xffUL)#define IO7__POX_ERRSUM__UPE_ERROR        GEN_MASK(IO7__POX_ERRSUM__UPE_ERROR)#define IO7__POX_ERRSUM__TLB_ERR          (1UL << 59)#define IO7__POX_ERRSUM__ERR_VALID        (1UL << 63)#define IO7__POX_ERRSUM__TRANS_SUM__MASK  (IO7__POX_ERRSUM__MRETRY_TO |       \					   IO7__POX_ERRSUM__PCIX_UX_SPL |     \					   IO7__POX_ERRSUM__PCIX_SPLIT_TO |   \					   IO7__POX_ERRSUM__DMA_TO |          \					   IO7__POX_ERRSUM__MABORT_MASK |     \					   IO7__POX_ERRSUM__TABORT_MASK |     \					   IO7__POX_ERRSUM__SERR |            \					   IO7__POX_ERRSUM__ADDRERR_STB |     \					   IO7__POX_ERRSUM__PERR |            \					   IO7__POX_ERRSUM__DATAERR_STB_NIOW |\					   IO7__POX_ERRSUM__DETECTED_PERR |   \					   IO7__POX_ERRSUM__PM_PERR |         \					   IO7__POX_ERRSUM__PT_SCERROR |      \					   IO7__POX_ERRSUM__UPE_ERROR)	if (!(err_sum & IO7__POX_ERRSUM__ERR_VALID))		return;	/*	 * First the transaction summary errors	 */	if (err_sum & IO7__POX_ERRSUM__MRETRY_TO)		printk("%s    IO7 Master Retry Timeout expired\n",		       err_print_prefix);	if (err_sum & IO7__POX_ERRSUM__PCIX_UX_SPL)		printk("%s    Unexpected Split Completion\n",		       err_print_prefix);	if (err_sum & IO7__POX_ERRSUM__PCIX_SPLIT_TO)		printk("%s    IO7 Split Completion Timeout expired\n",		       err_print_prefix);	if (err_sum & IO7__POX_ERRSUM__DMA_TO)		printk("%s    Hung bus during DMA transaction\n",		       err_print_prefix);	if (err_sum & IO7__POX_ERRSUM__MABORT_MASK)		printk("%s    Master Abort\n", err_print_prefix);	if (err_sum & IO7__POX_ERRSUM__PT_TABORT)		printk("%s    IO7 Asserted Target Abort\n", err_print_prefix);	if (err_sum & IO7__POX_ERRSUM__PM_TABORT)		printk("%s    IO7 Received Target Abort\n", err_print_prefix);	if (err_sum & IO7__POX_ERRSUM__ADDRERR_STB) {		printk("%s    Address or PCI-X Attribute Parity Error\n", 		       err_print_prefix);		if (err_sum & IO7__POX_ERRSUM__SERR)			printk("%s     IO7 Asserted SERR\n", err_print_prefix);	}	if (err_sum & IO7__POX_ERRSUM__PERR) {		if (err_sum & IO7__POX_ERRSUM__DATAERR_STB_NIOW)			printk("%s    IO7 Detected Data Parity Error\n",			       err_print_prefix);		else			printk("%s    Split Completion Response with "			       "Parity Error\n", err_print_prefix);	}	if (err_sum & IO7__POX_ERRSUM__DETECTED_PERR)		printk("%s    PERR detected\n", err_print_prefix);	if (err_sum & IO7__POX_ERRSUM__PM_PERR)		printk("%s    PERR while IO7 is master\n", err_print_prefix);	if (err_sum & IO7__POX_ERRSUM__PT_SCERROR) {		printk("%s    IO7 Received Split Completion Error message\n",		       err_print_prefix);		marvel_print_pox_spl_cmplt(port->pox_spl_cmplt);	}	if (err_sum & IO7__POX_ERRSUM__UPE_ERROR) {		unsigned int upe_error = EXTRACT(err_sum,						 IO7__POX_ERRSUM__UPE_ERROR);		int i;		static char *upe_errors[] = {			"Parity Error on MSI write data",			"MSI read (MSI window is write only",			"TLB - Invalid WR transaction",			"TLB - Invalid RD transaction",			"DMA - WR error (see north port)",			"DMA - RD error (see north port)",			"PPR - WR error (see north port)",			"PPR - RD error (see north port)"		};		printk("%s    UPE Error:\n", err_print_prefix);		for (i = 0; i < 8; i++) {			if (upe_error & (1 << i))				printk("%s      %s\n", err_print_prefix,				       upe_errors[i]);		}	}	/*
 |