[Skiboot] [PATCH] hw/xscom: Reset XSCOM engine after querying sleeping core FIR

Vipin K Parashar vipin at linux.vnet.ibm.com
Tue May 31 21:46:08 AEST 2016


XSCOM engine blocks subsequently after querying FIR of any
sleeping core. This causes subsequent XSCOM opertions to hang
forever due to XSCOM engine being continuously busy. Reset XSCOM
engine after querying FIR of any sleeping core.

Cc: stable
Signed-off-by: Vipin K Parashar <vipin at linux.vnet.ibm.com>
Signed-off-by: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>
---
Note: This patch needs below patch:
hw/xscom: Reset XSCOM engine after finite number of
Link: https://patchwork.ozlabs.org/patch/628160/
Please apply above patch first for trying out this one.

 hw/xscom.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/hw/xscom.c b/hw/xscom.c
index 2649a50..d081c4d 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -126,6 +126,7 @@ static void xscom_reset(uint32_t gcid)
 static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_addr,
 			      bool is_write, int64_t retries)
 {
+	int64_t ret;
 	struct timespec ts;
 	unsigned int stat = GETFIELD(SPR_HMER_XSCOM_STATUS, hmer);
 
@@ -163,21 +164,23 @@ static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_add
 				gcid, pcb_addr, stat);
 		return OPAL_BUSY;
 
-	/* CPU is asleep, don't retry */
+	/* CPU is asleep, reset and return. */
 	case 2:
-		return OPAL_WRONG_STATE;
-	}
+		ret = OPAL_WRONG_STATE;
+		break;
 
-	/* XXX: Create error log entry ? */
-	log_simple_error(&e_info(OPAL_RC_XSCOM_RW),
-		"XSCOM: %s error gcid=0x%x pcb_addr=0x%x stat=0x%x\n",
-		is_write ? "write" : "read", gcid, pcb_addr, stat);
+	/* Log error, reset and return. */
+	default:
+		ret = OPAL_HARDWARE;
+		log_simple_error(&e_info(OPAL_RC_XSCOM_RW),
+			"XSCOM: %s error gcid=0x%x pcb_addr=0x%x stat=0x%x\n",
+			is_write ? "write" : "read", gcid, pcb_addr, stat);
+	}
 
-	/* We need to reset the XSCOM or we'll hang on the next access */
+	/* Reset XSCOM engine before returning else we'll hang on the next access */
 	xscom_reset(gcid);
 
-	/* Non recovered ... just fail */
-	return OPAL_HARDWARE;
+	return ret;
 }
 
 static void xscom_handle_ind_error(uint64_t data, uint32_t gcid,
-- 
2.1.4



More information about the Skiboot mailing list