From b9984b78e0cda7fc00e66b96688b1977a0e74914 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 18 Jan 2004 18:47:56 -0800 Subject: [PATCH] [PATCH] sn: Some small bte code clean ups From: Pat Gefre Some small bte code clean ups --- arch/ia64/sn/io/sn2/bte_error.c | 31 +++---------------------------- include/asm-ia64/sn/bte.h | 23 ++++++++++++++++------- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/arch/ia64/sn/io/sn2/bte_error.c b/arch/ia64/sn/io/sn2/bte_error.c index e5a2b6f5edcea..79c3a77ec07a5 100644 --- a/arch/ia64/sn/io/sn2/bte_error.c +++ b/arch/ia64/sn/io/sn2/bte_error.c @@ -62,36 +62,11 @@ bte_crb_error_handler(vertex_hdl_t hub_v, int btenum, * in the bte handle structure for the thread excercising the * interface to consume. */ - switch (ioe->ie_errortype) { - case IIO_ICRB_ECODE_PERR: - bte->bh_error = BTEFAIL_POISON; - break; - case IIO_ICRB_ECODE_WERR: - bte->bh_error = BTEFAIL_PROT; - break; - case IIO_ICRB_ECODE_AERR: - bte->bh_error = BTEFAIL_ACCESS; - break; - case IIO_ICRB_ECODE_TOUT: - bte->bh_error = BTEFAIL_TOUT; - break; - case IIO_ICRB_ECODE_XTERR: - bte->bh_error = BTEFAIL_XTERR; - break; - case IIO_ICRB_ECODE_DERR: - bte->bh_error = BTEFAIL_DIR; - break; - case IIO_ICRB_ECODE_PWERR: - case IIO_ICRB_ECODE_PRERR: - /* NO BREAK */ - default: - bte->bh_error = BTEFAIL_ERROR; - } - + bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET; bte->bte_error_count++; - BTE_PRINTK(("Got an error on cnode %d bte %d\n", - bte->bte_cnode, bte->bte_num)); + BTE_PRINTK(("Got an error on cnode %d bte %d: HW error type 0x%x\n", + bte->bte_cnode, bte->bte_num, ioe->ie_errortype)); bte_error_handler((unsigned long) hinfo->h_nodepda); } diff --git a/include/asm-ia64/sn/bte.h b/include/asm-ia64/sn/bte.h index 7cdf590ea4fd5..2e96438b8d2b8 100644 --- a/include/asm-ia64/sn/bte.h +++ b/include/asm-ia64/sn/bte.h @@ -81,16 +81,25 @@ /* Possible results from bte_copy and bte_unaligned_copy */ +/* The following error codes map into the BTE hardware codes + * IIO_ICRB_ECODE_* (in shubio.h). The hardware uses + * an error code of 0 (IIO_ICRB_ECODE_DERR), but we want zero + * to mean BTE_SUCCESS, so add one (BTEFAIL_OFFSET) to the error + * codes to give the following error codes. + */ +#define BTEFAIL_OFFSET 1 + typedef enum { BTE_SUCCESS, /* 0 is success */ + BTEFAIL_DIR, /* Directory error due to IIO access*/ + BTEFAIL_POISON, /* poison error on IO access (write to poison page) */ + BTEFAIL_WERR, /* Write error (ie WINV to a Read only line) */ + BTEFAIL_ACCESS, /* access error (protection violation) */ + BTEFAIL_PWERR, /* Partial Write Error */ + BTEFAIL_PRERR, /* Partial Read Error */ + BTEFAIL_TOUT, /* CRB Time out */ + BTEFAIL_XTERR, /* Incoming xtalk pkt had error bit */ BTEFAIL_NOTAVAIL, /* BTE not available */ - BTEFAIL_POISON, /* poison page */ - BTEFAIL_PROT, /* Protection violation */ - BTEFAIL_ACCESS, /* access error */ - BTEFAIL_TOUT, /* Time out */ - BTEFAIL_XTERR, /* Diretory error */ - BTEFAIL_DIR, /* Diretory error */ - BTEFAIL_ERROR, /* Generic error */ } bte_result_t; -- 2.53.0