[Skiboot] [PATCH v2 3/9] opal: Recover from TB residue error.

Mahesh J Salgaonkar mahesh at linux.vnet.ibm.com
Wed Mar 11 21:30:16 AEDT 2015


From: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>

Handle TB residue error reported through HMER[bit 5] and TFMR bit 45
i.e tb_residu_err. For recovery, reset TB register with all zeros and
then clear tb errors by writing 1 to TFMR bit 45 and 24. Clearing TB error
bits from TFMR would set the time state machine to RESET state and then
fall through existing code path which reloads the TB with TOD value and
get TB running.

To inject TB parity error issue:
	$ putscom pu.ex 10013281 0003080000000000 -all

Signed-off-by: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
---
 hw/chiptod.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/chiptod.c b/hw/chiptod.c
index e64f239..c7de0a4 100644
--- a/hw/chiptod.c
+++ b/hw/chiptod.c
@@ -648,6 +648,14 @@ static bool tfmr_recover_tb_errors(uint64_t tfmr)
 	if (tfmr & SPR_TFMR_TB_MISSING_STEP)
 		tfmr_reset_error |= SPR_TFMR_TB_MISSING_STEP;
 
+	if (tfmr & SPR_TFMR_TB_RESIDUE_ERR) {
+		/* To recover TB residue error, reset the TB register. */
+		mtspr(SPR_TBWU, 0);
+		mtspr(SPR_TBWL, 0);
+
+		/* write 1 to bit 45 to clear the error */
+		tfmr_reset_error |= SPR_TFMR_TB_RESIDUE_ERR;
+	}
 	mtspr(SPR_TFMR, tfmr_reset_error);
 
 	/* We have to write "Clear TB Errors" again */
@@ -700,6 +708,7 @@ int chiptod_recover_tb_errors(void)
 	 * clear it.
 	 */
 	if ((tfmr & SPR_TFMR_TB_MISSING_STEP) ||
+		(tfmr & SPR_TFMR_TB_RESIDUE_ERR) ||
 		(tfmr & SPR_TFMR_TB_MISSING_SYNC)) {
 		if (!tfmr_recover_tb_errors(tfmr)) {
 			rc = 0;



More information about the Skiboot mailing list